Commit 1e8914ad authored by Bill Hoffman's avatar Bill Hoffman
Browse files

BUG: fix get make command problems.

parent 3a211819
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)
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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"))
{
......
......@@ -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);
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment