summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index c2cec36..e2a1dd8 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -252,6 +252,23 @@ void cmake::AddCMakePaths(const std::vector<std::string>& args)
cmSystemTools::EscapeSpaces(cMakeSelf.c_str()).c_str(),
"Path to CMake executable.",
cmCacheManager::INTERNAL);
+
+ // Find ccommand
+ std::string cCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
+ "/ccommand" + cmSystemTools::GetFilenameExtension(cMakeSelf);
+ if( !cmSystemTools::FileExists(cMakeSelf.c_str()))
+ {
+ cmSystemTools::Error("CMAKE can not find the command line program "
+ "ccommand. Attempted path: ", cMakeSelf.c_str());
+ return;
+ }
+
+ // Save the value in the cache
+ cmCacheManager::GetInstance()->AddCacheEntry
+ ("CCOMMAND_COMMAND",
+ cmSystemTools::EscapeSpaces(cCommand.c_str()).c_str(),
+ "Path to CMakeCommand executable.",
+ cmCacheManager::INTERNAL);
// do CMAKE_ROOT, look for the environment variable first
std::string cMakeRoot;