diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-05-07 13:02:45 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-05-07 13:02:45 (GMT) |
commit | 3bc9830686f25304024d3bc2849d530ac057763d (patch) | |
tree | 13031f07ef9e2128ca7a3e23d535242ca3634e85 /Source/cmake.cxx | |
parent | e9e69b7e5e5a331662093f801ada63494ffac0be (diff) | |
download | CMake-3bc9830686f25304024d3bc2849d530ac057763d.zip CMake-3bc9830686f25304024d3bc2849d530ac057763d.tar.gz CMake-3bc9830686f25304024d3bc2849d530ac057763d.tar.bz2 |
ENH: add an edit_cache target that runs ccmake or CMakeSetup
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 47f204c..95f62ea 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -254,10 +254,10 @@ void cmake::AddCMakePaths(const std::vector<std::string>& args) // Find ccommand std::string cCommand = cmSystemTools::GetFilenamePath(cMakeSelf) + "/ccommand" + cmSystemTools::GetFilenameExtension(cMakeSelf); - if( !cmSystemTools::FileExists(cMakeSelf.c_str())) + if( !cmSystemTools::FileExists(cCommand.c_str())) { cmSystemTools::Error("CMAKE can not find the command line program " - "ccommand. Attempted path: ", cMakeSelf.c_str()); + "ccommand. Attempted path: ", cCommand.c_str()); return; } @@ -265,6 +265,21 @@ void cmake::AddCMakePaths(const std::vector<std::string>& args) cmCacheManager::GetInstance()->AddCacheEntry ("CCOMMAND_COMMAND",cCommand.c_str(), "Path to CMakeCommand executable.", cmCacheManager::INTERNAL); + + // Find and save the command to edit the cache + std::string editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf) + + "/ccmake" + cmSystemTools::GetFilenameExtension(cMakeSelf); + if( !cmSystemTools::FileExists(editCacheCommand.c_str())) + { + editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf) + + "/CMakeSetup" + cmSystemTools::GetFilenameExtension(cMakeSelf); + } + if(cmSystemTools::FileExists(editCacheCommand.c_str())) + { + cmCacheManager::GetInstance()->AddCacheEntry + ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(), + "Path to cache edit program executable.", cmCacheManager::INTERNAL); + } // do CMAKE_ROOT, look for the environment variable first std::string cMakeRoot; |