ENH: Add support for automatically preloaded cmake file. Closes Bug #802 - Add auto preload file support in CMake
This commit is contained in:
parent
ddf814f964
commit
df31c576dc
|
@ -1160,6 +1160,13 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
|
|||
cmSystemTools::Error("Problem processing arguments. Aborting.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::string pre_load = this->GetHomeDirectory();
|
||||
pre_load += "/PreLoad.cmake";
|
||||
if ( cmSystemTools::FileExists(pre_load.c_str()) )
|
||||
{
|
||||
this->ReadListFile(pre_load.c_str());
|
||||
}
|
||||
|
||||
std::string systemFile = this->GetHomeOutputDirectory();
|
||||
systemFile += "/CMakeSystem.cmake";
|
||||
|
|
|
@ -23,3 +23,13 @@ ELSE(DUMP_DOC_EXE)
|
|||
ENDIF(DUMP_DOC_EXE)
|
||||
|
||||
ADD_EXECUTABLE(CommandLineTest CommandLineTest.cxx)
|
||||
|
||||
IF(THIS_SHOULD_BE_SET)
|
||||
MESSAGE(STATUS "***************************")
|
||||
MESSAGE(STATUS "PreLoad.cmake works fine.")
|
||||
MESSAGE(STATUS "***************************")
|
||||
ELSE(THIS_SHOULD_BE_SET)
|
||||
MESSAGE("***************************")
|
||||
MESSAGE(FATAL_ERROR "PreLoad.cmake does not work.")
|
||||
ENDIF(THIS_SHOULD_BE_SET)
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
SET(THIS_SHOULD_BE_SET ON CACHE BOOL "Some variable")
|
Loading…
Reference in New Issue