ENH: Add support for make test even for fresh build of cmake

This commit is contained in:
Andy Cedilnik 2003-05-05 08:42:11 -04:00
parent 74eb17767d
commit 444ba9e442
1 changed files with 16 additions and 9 deletions

View File

@ -2302,17 +2302,24 @@ void cmLocalUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
ctest += "ctest"; ctest += "ctest";
ctest += cmSystemTools::GetExecutableExtension(); ctest += cmSystemTools::GetExecutableExtension();
} }
if (cmSystemTools::FileExists(ctest.c_str())) if (!cmSystemTools::FileExists(ctest.c_str()))
{ {
fout << "ARGS=\n"; if ( !m_Makefile->GetDefinition("PROJECT_NAME") ||
std::string cmd = this->ConvertToOutputForExisting(ctest.c_str()); strcmp(m_Makefile->GetDefinition("PROJECT_NAME"), "CMake") )
cmd += " $(ARGS)"; {
this->OutputMakeRule(fout, return;
"tests", }
"test", ctest = m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH");
"", ctest += "/ctest";
cmd.c_str());
} }
fout << "ARGS=\n";
std::string cmd = this->ConvertToOutputForExisting(ctest.c_str());
cmd += " $(ARGS)";
this->OutputMakeRule(fout,
"tests",
"test",
"",
cmd.c_str());
} }
void void