diff options
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 1522f26..3ebd199 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -2302,17 +2302,24 @@ void cmLocalUnixMakefileGenerator::OutputMakeRules(std::ostream& fout) ctest += "ctest"; ctest += cmSystemTools::GetExecutableExtension(); } - if (cmSystemTools::FileExists(ctest.c_str())) + if (!cmSystemTools::FileExists(ctest.c_str())) { - fout << "ARGS=\n"; - std::string cmd = this->ConvertToOutputForExisting(ctest.c_str()); - cmd += " $(ARGS)"; - this->OutputMakeRule(fout, - "tests", - "test", - "", - cmd.c_str()); + if ( !m_Makefile->GetDefinition("PROJECT_NAME") || + strcmp(m_Makefile->GetDefinition("PROJECT_NAME"), "CMake") ) + { + return; + } + ctest = m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); + ctest += "/ctest"; } + fout << "ARGS=\n"; + std::string cmd = this->ConvertToOutputForExisting(ctest.c_str()); + cmd += " $(ARGS)"; + this->OutputMakeRule(fout, + "tests", + "test", + "", + cmd.c_str()); } void |