diff options
author | Brad King <brad.king@kitware.com> | 2001-05-03 20:55:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-05-03 20:55:41 (GMT) |
commit | 5e4a89b1b954894a68e36b31e4be4713c5db1f1f (patch) | |
tree | 57daa130d3fd260b62e1afa37d755e934af15c2e /Source | |
parent | 5079efdc68c94d93a2b77e5b42dd229de2a77836 (diff) | |
download | CMake-5e4a89b1b954894a68e36b31e4be4713c5db1f1f.zip CMake-5e4a89b1b954894a68e36b31e4be4713c5db1f1f.tar.gz CMake-5e4a89b1b954894a68e36b31e4be4713c5db1f1f.tar.bz2 |
ENH: Added generation of internal CMAKE cache entry with path to command-line CMake executable.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeBuildTargets.cxx | 15 | ||||
-rw-r--r-- | Source/CMakeSetupCMD.cxx | 14 | ||||
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.cpp | 17 |
3 files changed, 45 insertions, 1 deletions
diff --git a/Source/CMakeBuildTargets.cxx b/Source/CMakeBuildTargets.cxx index 4626ccf..0fa4086 100644 --- a/Source/CMakeBuildTargets.cxx +++ b/Source/CMakeBuildTargets.cxx @@ -116,6 +116,21 @@ int main(int ac, char** av) // Read and parse the input makefile mf.MakeStartDirectoriesCurrent(); cmCacheManager::GetInstance()->LoadCache(&mf); + + // Make sure the internal "CMAKE" cache entry is set. + const char* cacheValue = cmCacheManager::GetInstance()->GetCacheValue("CMAKE"); + if(!cacheValue) + { + // Find our own exectuable. + std::string cMakeSelf = cmSystemTools::FindProgram(av[0]); + // Save the value in the cache + cmCacheManager::GetInstance()->AddCacheEntry("CMAKE", + cMakeSelf.c_str(), + "Path to CMake executable.", + cmCacheManager::INTERNAL); + } + + // Transfer the cache into the makefile's definitions. cmCacheManager::GetInstance()->DefineCache(&mf); if(!mf.ReadListFile(av[1])) { diff --git a/Source/CMakeSetupCMD.cxx b/Source/CMakeSetupCMD.cxx index 64a63eb..a0691f5 100644 --- a/Source/CMakeSetupCMD.cxx +++ b/Source/CMakeSetupCMD.cxx @@ -104,6 +104,20 @@ int main(int ac, char** av) makefile.SetMakefileGenerator(pg); makefile.MakeStartDirectoriesCurrent(); cmCacheManager::GetInstance()->LoadCache(&makefile); + + // Make sure the internal "CMAKE" cache entry is set. + const char* cacheValue = cmCacheManager::GetInstance()->GetCacheValue("CMAKE"); + if(!cacheValue) + { + // Find our own exectuable. + std::string cMakeSelf = "\""+cmSystemTools::FindProgram(av[0])+"\""; + // Save the value in the cache + cmCacheManager::GetInstance()->AddCacheEntry("CMAKE", + cMakeSelf.c_str(), + "Path to CMake executable.", + cmCacheManager::INTERNAL); + } + cmCacheManager::GetInstance()->DefineCache(&makefile); makefile.ReadListFile(av[1]); makefile.GenerateMakefile(); diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp index 6277fe7..2cc6552 100644 --- a/Source/MFCDialog/CMakeSetupDialog.cpp +++ b/Source/MFCDialog/CMakeSetupDialog.cpp @@ -469,7 +469,6 @@ void CMakeSetupDialog::OnChangeWhereBuild() { m_CacheEntriesList.RemoveAll(); } - } void CMakeSetupDialog::OnChangeWhereSource() @@ -483,6 +482,22 @@ void CMakeSetupDialog::LoadCacheFromDiskToGUI() if(m_WhereBuild != "") { cmCacheManager::GetInstance()->LoadCache(m_WhereBuild); + + // Make sure the internal "CMAKE" cache entry is set. + const char* cacheValue = cmCacheManager::GetInstance()->GetCacheValue("CMAKE"); + if(!cacheValue) + { + // Find our own exectuable. + std::string cMakeCMD = "\""+cmSystemTools::GetProgramPath(_pgmptr); + cMakeCMD += "/CMakeSetupCMD.exe\""; + + // Save the value in the cache + cmCacheManager::GetInstance()->AddCacheEntry("CMAKE", + cMakeCMD.c_str(), + "Path to CMake executable.", + cmCacheManager::INTERNAL); + } + this->FillCacheGUIFromCacheManager(); } } |