diff --git a/Modules/CMakeBorlandFindMake.cmake b/Modules/CMakeBorlandFindMake.cmake new file mode 100644 index 000000000..7efc1c2d0 --- /dev/null +++ b/Modules/CMakeBorlandFindMake.cmake @@ -0,0 +1,3 @@ +SET (CMAKE_MAKE_PROGRAM "make" CACHE STRING + "Program used to build from makefiles.") +MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) diff --git a/Modules/CMakeNMakeFindMake.cmake b/Modules/CMakeNMakeFindMake.cmake new file mode 100644 index 000000000..13befca8f --- /dev/null +++ b/Modules/CMakeNMakeFindMake.cmake @@ -0,0 +1,3 @@ +SET (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING + "Program used to build from makefiles.") +MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake index d61e429c8..a73dd8767 100644 --- a/Modules/CMakeSystemSpecificInformation.cmake +++ b/Modules/CMakeSystemSpecificInformation.cmake @@ -143,8 +143,6 @@ IF(CMAKE_USER_MAKE_RULES_OVERRIDE) INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE}) ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE) -FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES nmake gmake make ) - SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only.") # default build type is none SET (CMAKE_BUILD_TYPE "" CACHE STRING diff --git a/Modules/CMakeUnixFindMake.cmake b/Modules/CMakeUnixFindMake.cmake new file mode 100644 index 000000000..19930597f --- /dev/null +++ b/Modules/CMakeUnixFindMake.cmake @@ -0,0 +1,2 @@ +FIND_PROGRAM(CMAKE_MAKE_PROGRAM gmake make ) +MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake index 4dd273d1f..78a12e02a 100644 --- a/Modules/Platform/CYGWIN.cmake +++ b/Modules/Platform/CYGWIN.cmake @@ -6,4 +6,3 @@ SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) -FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES gmake make ) diff --git a/Modules/Platform/Windows-bcc32.cmake b/Modules/Platform/Windows-bcc32.cmake index ee714fe25..da90d82b1 100644 --- a/Modules/Platform/Windows-bcc32.cmake +++ b/Modules/Platform/Windows-bcc32.cmake @@ -96,6 +96,5 @@ SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO ${CMAKE_EXE_LINKER_FLAGS_RELWITHDE SET (CMAKE_STANDARD_LIBRARIES "import32.lib" CACHE STRING "Libraries linked by defalut with all applications.") -FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES make ) -MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES CMAKE_MAKE_PROGRAM) +MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES) diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index ced7b7b46..3b4d6217e 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -65,9 +65,6 @@ SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib co "Libraries linked by defalut with all applications.") MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES) -FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES nmake ) - - # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:I386 /INCREMENTAL:YES") diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index e53fee6aa..d6aa008e7 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -40,6 +40,11 @@ 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"); + this->cmGlobalUnixMakefileGenerator::EnableLanguage(l, mf); } diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index ce0dbd2ca..114876fe2 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -24,7 +24,10 @@ 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()); + this->cmGlobalUnixMakefileGenerator::EnableLanguage(l, mf); } diff --git a/Source/cmGlobalUnixMakefileGenerator.cxx b/Source/cmGlobalUnixMakefileGenerator.cxx index d6082c7dc..fbe0eef8f 100644 --- a/Source/cmGlobalUnixMakefileGenerator.cxx +++ b/Source/cmGlobalUnixMakefileGenerator.cxx @@ -23,14 +23,19 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, cmMakefile *mf) { + if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")) + { + std::string setMakeProgram = mf->GetDefinition("CMAKE_ROOT"); + setMakeProgram += "/Modules/CMakeUnixFindMake.cmake"; + mf->ReadListFile(0, setMakeProgram.c_str()); + } + bool isLocal = m_CMakeInstance->GetLocal(); // if no lang specified use CXX if(!lang ) { lang = "CXX"; } - //std::string root - // = cmSystemTools::ConvertToOutputPath(mf->GetDefinition("CMAKE_ROOT")); std::string root = mf->GetDefinition("CMAKE_ROOT"); std::string rootBin = mf->GetHomeOutputDirectory(); if(m_ConfiguredFilesPath.size())