BUG: fix get make command problems.

This commit is contained in:
Bill Hoffman 2002-12-04 10:57:22 -05:00
parent 3a21181941
commit 1e8914ada8
6 changed files with 41 additions and 14 deletions

View File

@ -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)

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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"))
{

View File

@ -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);

View File

@ -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.