summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-01-17 21:29:00 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-01-17 21:29:00 (GMT)
commit57bacd199c36698533b5375a7ac9b0df3e00f8ac (patch)
treeea9b7df48586574226669e0f3a9b80769b7a6fbb
parente7bc462755b72af9ecf8869a295619bc36108a67 (diff)
downloadCMake-57bacd199c36698533b5375a7ac9b0df3e00f8ac.zip
CMake-57bacd199c36698533b5375a7ac9b0df3e00f8ac.tar.gz
CMake-57bacd199c36698533b5375a7ac9b0df3e00f8ac.tar.bz2
BUG: when ctest is looking for cmake look in the build directory as well as where ctest is so that purify will work
-rw-r--r--Source/cmCTest.cxx42
1 files changed, 30 insertions, 12 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 73ac926..4080811 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1626,7 +1626,7 @@ void cmCTest::FindRunningCMake(const char* arg0)
{
failures.push_back(m_CTestSelf);
cmOStringStream msg;
- msg << "CTEST can not find the command line program cmake.\n";
+ msg << "CTEST can not find the command line program ctest.\n";
msg << " argv[0] = \"" << arg0 << "\"\n";
msg << " Attempted paths:\n";
std::vector<cmStdString>::iterator i;
@@ -1639,22 +1639,40 @@ void cmCTest::FindRunningCMake(const char* arg0)
std::string dir;
std::string file;
if(cmSystemTools::SplitProgramPath(m_CTestSelf.c_str(),
- dir,
- file,
- true))
+ dir, file, true))
{
m_CMakeSelf = dir += "/cmake";
m_CMakeSelf += cmSystemTools::GetExecutableExtension();
- if(!cmSystemTools::FileExists(m_CMakeSelf.c_str()))
+ if(cmSystemTools::FileExists(m_CMakeSelf.c_str()))
+ {
+ return;
+ }
+ }
+ failures.push_back(m_CMakeSelf);
+#ifdef CMAKE_BUILD_DIR
+ std::string intdir = ".";
+#ifdef CMAKE_INTDIR
+ intdir = CMAKE_INTDIR;
+#endif
+ m_CMakeSelf = CMAKE_BUILD_DIR;
+ m_CMakeSelf += "/bin/";
+ m_CMakeSelf += intdir;
+ m_CMakeSelf += "/cmake";
+ m_CMakeSelf += cmSystemTools::GetExecutableExtension();
+#endif
+ if(!cmSystemTools::FileExists(m_CMakeSelf.c_str()))
+ {
+ failures.push_back(m_CMakeSelf);
+ cmOStringStream msg;
+ msg << "CTEST can not find the command line program cmake.\n";
+ msg << " argv[0] = \"" << arg0 << "\"\n";
+ msg << " Attempted paths:\n";
+ std::vector<cmStdString>::iterator i;
+ for(i=failures.begin(); i != failures.end(); ++i)
{
- cmOStringStream msg;
- failures.push_back(m_CMakeSelf);
- msg << "CTEST can not find the command line program cmake.\n";
- msg << " argv[0] = \"" << arg0 << "\"\n";
- msg << " Attempted path:\n";
- msg << " \"" << m_CMakeSelf.c_str() << "\"\n";
- cmSystemTools::Error(msg.str().c_str());
+ msg << " \"" << i->c_str() << "\"\n";
}
+ cmSystemTools::Error(msg.str().c_str());
}
}