summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-03-15 20:42:59 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-03-15 20:42:59 (GMT)
commit5bbae885693f74b50b1f4265d8ab32fe65288194 (patch)
tree55fc5a134bde8f54292155952273ac549c49ec12 /Source/cmake.cxx
parentc8924864fdcf66fcc62d4c6a95606ad200b7ba1a (diff)
downloadCMake-5bbae885693f74b50b1f4265d8ab32fe65288194.zip
CMake-5bbae885693f74b50b1f4265d8ab32fe65288194.tar.gz
CMake-5bbae885693f74b50b1f4265d8ab32fe65288194.tar.bz2
Add ccommand for executing commands on the system, so by using ADD_CUSTOM_COMMAND, you can make rules to do some system commands during build. Currently supported commands are copy and remove. Others will follow.
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;