summaryrefslogtreecommitdiffstats
path: root/Source/cmUnixMakefileGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r--Source/cmUnixMakefileGenerator.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx
index 9a878e7..209765b 100644
--- a/Source/cmUnixMakefileGenerator.cxx
+++ b/Source/cmUnixMakefileGenerator.cxx
@@ -1154,11 +1154,6 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
"cmake.depends ${TARGETS} ${SUBDIR_BUILD} ${CMAKE_COMMAND}",
0);
this->OutputMakeRule(fout,
- "run any tests",
- "test",
- "",
- "ctest");
- this->OutputMakeRule(fout,
"remove generated files",
"clean",
"${SUBDIR_CLEAN}",
@@ -1224,6 +1219,20 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
0,
"echo \"cmake might be out of date\"");
}
+
+ // find ctest
+ std::string ctest = m_Makefile->GetDefinition("CMAKE_COMMAND");
+ ctest = cmSystemTools::GetFilenamePath(ctest.c_str());
+ ctest += "/";
+ ctest += "ctest";
+ if (cmSystemTools::FileExists(ctest.c_str()))
+ {
+ this->OutputMakeRule(fout,
+ "run any tests",
+ "test",
+ "",
+ ctest.c_str());
+ }
}