From 444ba9e4420ce5410627ba2e46173c718f074853 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Mon, 5 May 2003 08:42:11 -0400 Subject: [PATCH] ENH: Add support for make test even for fresh build of cmake --- Source/cmLocalUnixMakefileGenerator.cxx | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 1522f2698..3ebd1997d 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