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
This commit is contained in:
Alexander Neundorf 2008-11-07 15:56:54 -05:00
parent 81bc893520
commit 45aec04508
1 changed files with 20 additions and 0 deletions

View File

@ -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())