summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-04-29 13:14:45 (GMT)
committerBrad King <brad.king@kitware.com>2014-04-29 13:36:14 (GMT)
commit416761e35c828092bc8a7dbe68b3fbe65495f01e (patch)
tree4514d9c256fd8fccdca1a55d8de3854d83740b4a /Source/cmGlobalGenerator.cxx
parent20b46a09e38be7521a903e1846716ce9a2ed2df6 (diff)
downloadCMake-416761e35c828092bc8a7dbe68b3fbe65495f01e.zip
CMake-416761e35c828092bc8a7dbe68b3fbe65495f01e.tar.gz
CMake-416761e35c828092bc8a7dbe68b3fbe65495f01e.tar.bz2
Add platform-specific initialization step when enabling languages
Create a Modules/CMakeSystemSpecificInitialize.cmake module loaded after CMakeSystem.cmake but before per-language initialization. Use it to load an optional Platform/<os>-Initialize.cmake module. This will be useful to do per-platform initialization that does not depend on the language and use the results when enabling specific languages.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index beb10da..f933f27 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -308,6 +308,9 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
// CMakeSystem.cmake - configured file created by
// CMakeDetermineSystem.cmake IF CMAKE_SYSTEM_LOADED
+// CMakeSystemSpecificInitialize.cmake
+// - includes Platform/${CMAKE_SYSTEM_NAME}-Initialize.cmake
+
// Next try and enable all languages found in the languages vector
//
// FOREACH LANG in languages
@@ -432,6 +435,18 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
fpath += "/CMakeSystem.cmake";
mf->ReadListFile(0,fpath.c_str());
}
+
+ // **** Load the system specific initialization if not yet loaded
+ if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INITIALIZE_LOADED"))
+ {
+ fpath = mf->GetModulesFile("CMakeSystemSpecificInitialize.cmake");
+ if(!mf->ReadListFile(0,fpath.c_str()))
+ {
+ cmSystemTools::Error("Could not find cmake module file: ",
+ fpath.c_str());
+ }
+ }
+
std::map<cmStdString, bool> needTestLanguage;
std::map<cmStdString, bool> needSetLanguageEnabledMaps;
// foreach language