diff options
author | Alexander Neundorf <neundorf@kde.org> | 2008-11-07 20:56:54 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2008-11-07 20:56:54 (GMT) |
commit | 45aec045089bba7b66ce0920f3baa4fa6eb7a898 (patch) | |
tree | 3cb5a4d6958565c371411ce2c3721ae554c65b20 /Source | |
parent | 81bc893520cac7e30a41a3a7fe59df7b962db2a8 (diff) | |
download | CMake-45aec045089bba7b66ce0920f3baa4fa6eb7a898.zip CMake-45aec045089bba7b66ce0920f3baa4fa6eb7a898.tar.gz CMake-45aec045089bba7b66ce0920f3baa4fa6eb7a898.tar.bz2 |
ENH: load CMakeDetermineSystem and CMakeSystemSpecificInformation when
executing a ctest script so the search paths are fully set up and variables
like CMAKE_SYSTEM are available. This is useful e.g. for new-style ctest
scripting.
(these files are also loaded on startup by cpack, so now they behave
similar).
Hmmm, maybe they should be also loaded by cmake -P ?
Alex
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 40926ad..67b171b 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -380,6 +380,26 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) f->CTestScriptHandler = this; this->Makefile->AddFunctionBlocker(f); + /* Execute CMakeDetermineSystem and CMakeSystemSpecificInformation, so + that variables like CMAKE_SYSTEM and also the search paths for libraries, + header and executables are set correctly and can be used. Makes new-style + ctest scripting easier. */ + std::string systemFile = + this->Makefile->GetModulesFile("CMakeDetermineSystem.cmake"); + if (!this->Makefile->ReadListFile(0, systemFile.c_str()) || + cmSystemTools::GetErrorOccuredFlag()) + { + return 2; + } + + systemFile = + this->Makefile->GetModulesFile("CMakeSystemSpecificInformation.cmake"); + if (!this->Makefile->ReadListFile(0, systemFile.c_str()) || + cmSystemTools::GetErrorOccuredFlag()) + { + return 2; + } + // finally read in the script if (!this->Makefile->ReadListFile(0, script.c_str()) || cmSystemTools::GetErrorOccuredFlag()) |