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:
parent
81bc893520
commit
45aec04508
|
@ -380,6 +380,26 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
|
||||||
f->CTestScriptHandler = this;
|
f->CTestScriptHandler = this;
|
||||||
this->Makefile->AddFunctionBlocker(f);
|
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
|
// finally read in the script
|
||||||
if (!this->Makefile->ReadListFile(0, script.c_str()) ||
|
if (!this->Makefile->ReadListFile(0, script.c_str()) ||
|
||||||
cmSystemTools::GetErrorOccuredFlag())
|
cmSystemTools::GetErrorOccuredFlag())
|
||||||
|
|
Loading…
Reference in New Issue