summaryrefslogtreecommitdiffstats
path: root/Source/CMakeSetupCMD.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2001-05-03 20:55:41 (GMT)
committerBrad King <brad.king@kitware.com>2001-05-03 20:55:41 (GMT)
commit5e4a89b1b954894a68e36b31e4be4713c5db1f1f (patch)
tree57daa130d3fd260b62e1afa37d755e934af15c2e /Source/CMakeSetupCMD.cxx
parent5079efdc68c94d93a2b77e5b42dd229de2a77836 (diff)
downloadCMake-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/CMakeSetupCMD.cxx')
-rw-r--r--Source/CMakeSetupCMD.cxx14
1 files changed, 14 insertions, 0 deletions
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();