summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-07-25 14:57:33 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-07-25 14:57:33 (GMT)
commita39aff52a033943242296bacc193741b0101377d (patch)
tree1ed04854e79820eafa28c5a727f6478c46586d12 /Source/cmake.cxx
parentf4ac0f8373aeb96aae4cd24359586bf1a18c7f7b (diff)
downloadCMake-a39aff52a033943242296bacc193741b0101377d.zip
CMake-a39aff52a033943242296bacc193741b0101377d.tar.gz
CMake-a39aff52a033943242296bacc193741b0101377d.tar.bz2
ENH: add an empty debian package generator, Mathieu volunteered to fill it
:-) Alex
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx23
1 files changed, 19 insertions, 4 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 2746c38..c8d5fde 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -690,10 +690,17 @@ void cmake::SetDirectoriesFromFile(const char* arg)
// cache
int cmake::AddCMakePaths(const char *arg0)
{
- // Find our own executable.
+ // Find the cmake executable
std::vector<cmStdString> failures;
std::string cMakeSelf = arg0;
cmSystemTools::ConvertToUnixSlashes(cMakeSelf);
+ if ((strstr(arg0, "cpack")!=0) || (strstr(arg0, "ctest")!=0))
+ {
+ // when called from cpack or ctest CMAKE_COMMAND would otherwise point
+ // to cpack or ctest and not cmake
+ cMakeSelf = cmSystemTools::GetFilenamePath(cMakeSelf) +
+ "/cmake" + cmSystemTools::GetFilenameExtension(cMakeSelf);
+ }
failures.push_back(cMakeSelf);
cMakeSelf = cmSystemTools::FindProgram(cMakeSelf.c_str());
cmSystemTools::ConvertToUnixSlashes(cMakeSelf);
@@ -746,6 +753,12 @@ int cmake::AddCMakePaths(const char *arg0)
editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
"/CMakeSetup" + cmSystemTools::GetFilenameExtension(cMakeSelf);
}
+ if(cmSystemTools::FileExists(editCacheCommand.c_str()))
+ {
+ this->CacheManager->AddCacheEntry
+ ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(),
+ "Path to cache edit program executable.", cmCacheManager::INTERNAL);
+ }
std::string ctestCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
"/ctest" + cmSystemTools::GetFilenameExtension(cMakeSelf);
if(cmSystemTools::FileExists(ctestCommand.c_str()))
@@ -754,11 +767,13 @@ int cmake::AddCMakePaths(const char *arg0)
("CMAKE_CTEST_COMMAND", ctestCommand.c_str(),
"Path to ctest program executable.", cmCacheManager::INTERNAL);
}
- if(cmSystemTools::FileExists(editCacheCommand.c_str()))
+ std::string cpackCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
+ "/cpack" + cmSystemTools::GetFilenameExtension(cMakeSelf);
+ if(cmSystemTools::FileExists(ctestCommand.c_str()))
{
this->CacheManager->AddCacheEntry
- ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(),
- "Path to cache edit program executable.", cmCacheManager::INTERNAL);
+ ("CMAKE_CPACK_COMMAND", cpackCommand.c_str(),
+ "Path to cpack program executable.", cmCacheManager::INTERNAL);
}
// do CMAKE_ROOT, look for the environment variable first