diff options
-rw-r--r-- | Modules/CMakeUnixFindMake.cmake | 4 | ||||
-rw-r--r-- | Source/cmGlobalBorlandMakefileGenerator.cxx | 15 | ||||
-rw-r--r-- | Source/cmGlobalNMakeMakefileGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmake.cxx | 9 | ||||
-rw-r--r-- | Source/cmake.h | 5 |
6 files changed, 41 insertions, 14 deletions
diff --git a/Modules/CMakeUnixFindMake.cmake b/Modules/CMakeUnixFindMake.cmake index 1993059..ba17749 100644 --- a/Modules/CMakeUnixFindMake.cmake +++ b/Modules/CMakeUnixFindMake.cmake @@ -1,2 +1,4 @@ -FIND_PROGRAM(CMAKE_MAKE_PROGRAM gmake make ) +MESSAGE("unix find make sdfsdf ${CMAKE_MAKE_PROGRAM}") +FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES gmake make ) +MESSAGE("unix find make sdfsdf ${CMAKE_MAKE_PROGRAM}") MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index d6aa008..7e85f3a 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -39,13 +39,14 @@ void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char* l, } mf->AddDefinition("BORLAND", "1"); mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32"); - mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32"); - std::string setMakeProgram = mf->GetDefinition("CMAKE_ROOT"); - setMakeProgram += "/Modules/CMakeBorlandFindMake.cmake"; - mf->ReadListFile(0, setMakeProgram.c_str()); - mf->AddDefinition("CMAKE_MAKE_PROGRAM", "make"); - - + mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32"); + if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM") + || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) + { + std::string setMakeProgram = mf->GetDefinition("CMAKE_ROOT"); + setMakeProgram += "/Modules/CMakeBorlandFindMake.cmake"; + mf->ReadListFile(0, setMakeProgram.c_str()); + } this->cmGlobalUnixMakefileGenerator::EnableLanguage(l, mf); } diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 114876f..318b428 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -24,9 +24,14 @@ void cmGlobalNMakeMakefileGenerator::EnableLanguage(const char* l, // pick a default mf->AddDefinition("CMAKE_GENERATOR_CC", "cl"); mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl"); - std::string setMakeProgram = mf->GetDefinition("CMAKE_ROOT"); - setMakeProgram += "/Modules/CMakeNMakeFindMake.cmake"; - mf->ReadListFile(0, setMakeProgram.c_str()); + if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM") + || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) + { + std::string setMakeProgram = mf->GetDefinition("CMAKE_ROOT"); + setMakeProgram += "/Modules/CMakeNMakeFindMake.cmake"; + mf->ReadListFile(0, setMakeProgram.c_str()); + } + this->cmGlobalUnixMakefileGenerator::EnableLanguage(l, mf); } diff --git a/Source/cmGlobalUnixMakefileGenerator.cxx b/Source/cmGlobalUnixMakefileGenerator.cxx index fbe0eef..5132f25 100644 --- a/Source/cmGlobalUnixMakefileGenerator.cxx +++ b/Source/cmGlobalUnixMakefileGenerator.cxx @@ -23,7 +23,8 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, cmMakefile *mf) { - if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")) + if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM") + || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) { std::string setMakeProgram = mf->GetDefinition("CMAKE_ROOT"); setMakeProgram += "/Modules/CMakeUnixFindMake.cmake"; @@ -155,7 +156,13 @@ cmLocalGenerator *cmGlobalUnixMakefileGenerator::CreateLocalGenerator() void cmGlobalUnixMakefileGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen) { - this->SetConfiguredFilesPath(gen->GetCMakeInstance()->GetHomeOutputDirectory()); + this->SetConfiguredFilesPath( + gen->GetCMakeInstance()->GetHomeOutputDirectory()); + const char* make = + gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM"); + this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make, + "make program", + cmCacheManager::FILEPATH); // if C, then enable C if(gen->GetLanguageEnabled("C")) { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 3c705b1..b6b2855 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -939,6 +939,15 @@ const char *cmake::GetReleaseVersion() return cmMakefile::GetReleaseVersion(); } +void cmake::AddCacheEntry(const char* key, const char* value, + const char* helpString, + int type) +{ + m_CacheManager->AddCacheEntry(key, value, + helpString, + cmCacheManager::CacheEntryType(type)); +} + const char* cmake::GetCacheDefinition(const char* name) const { return m_CacheManager->GetCacheValue(name); diff --git a/Source/cmake.h b/Source/cmake.h index cf0d7bf..602f152 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -170,7 +170,10 @@ class cmake * Given a variable name, return its value (as a string). */ const char* GetCacheDefinition(const char*) const; - + ///! Add an entry into the cache + void AddCacheEntry(const char* key, const char* value, + const char* helpString, + int type); /** * Execute commands during the build process. Supports options such * as echo, remove file etc. |