diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-05-05 12:42:11 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-05-05 12:42:11 (GMT) |
commit | 444ba9e4420ce5410627ba2e46173c718f074853 (patch) | |
tree | 37e4ea538bf519338fe03482015380c405bdee2e | |
parent | 74eb17767db5994b5926624e68a317e8ff03a0ed (diff) | |
download | CMake-444ba9e4420ce5410627ba2e46173c718f074853.zip CMake-444ba9e4420ce5410627ba2e46173c718f074853.tar.gz CMake-444ba9e4420ce5410627ba2e46173c718f074853.tar.bz2 |
ENH: Add support for make test even for fresh build of cmake
-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 |