only add test target if testing is enabled and ctest is found
This commit is contained in:
parent
92c5ff5b40
commit
9ebfec08a0
@ -112,8 +112,23 @@ void cmDSWWriter::WriteDSWFile(std::ostream& fout)
|
|||||||
ctest += "ctest";
|
ctest += "ctest";
|
||||||
ctest += cmSystemTools::GetExecutableExtension();
|
ctest += cmSystemTools::GetExecutableExtension();
|
||||||
}
|
}
|
||||||
m_Makefile->AddUtilityCommand("RUN_TESTS", ctest.c_str(), "-D $(IntDir)",
|
// if we found ctest
|
||||||
false);
|
if (cmSystemTools::FileExists(ctest.c_str()))
|
||||||
|
{
|
||||||
|
// Create a full path filename for output Testfile
|
||||||
|
std::string fname;
|
||||||
|
fname = m_Makefile->GetStartOutputDirectory();
|
||||||
|
fname += "/";
|
||||||
|
fname += "DartTestfile.txt";
|
||||||
|
|
||||||
|
// If the file doesn't exist, then ENABLE_TESTING hasn't been run
|
||||||
|
if (cmSystemTools::FileExists(fname.c_str()))
|
||||||
|
{
|
||||||
|
m_Makefile->AddUtilityCommand("RUN_TESTS", ctest.c_str(), "-D $(IntDir)",
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_Makefile->FindSubDirectoryCMakeListsFiles(allListFiles);
|
m_Makefile->FindSubDirectoryCMakeListsFiles(allListFiles);
|
||||||
// For each cmMakefile, create a DSP for it, and
|
// For each cmMakefile, create a DSP for it, and
|
||||||
// add it to this DSW file
|
// add it to this DSW file
|
||||||
|
@ -182,8 +182,23 @@ void cmMSDotNETGenerator::WriteSLNFile(std::ostream& fout)
|
|||||||
ctest += "ctest";
|
ctest += "ctest";
|
||||||
ctest += cmSystemTools::GetExecutableExtension();
|
ctest += cmSystemTools::GetExecutableExtension();
|
||||||
}
|
}
|
||||||
m_Makefile->AddUtilityCommand("RUN_TESTS", ctest.c_str(), "-D $(IntDir)",
|
// if we found ctest
|
||||||
false);
|
if (cmSystemTools::FileExists(ctest.c_str()))
|
||||||
|
{
|
||||||
|
// Create a full path filename for output Testfile
|
||||||
|
std::string fname;
|
||||||
|
fname = m_Makefile->GetStartOutputDirectory();
|
||||||
|
fname += "/";
|
||||||
|
fname += "DartTestfile.txt";
|
||||||
|
|
||||||
|
// If the file doesn't exist, then ENABLE_TESTING hasn't been run
|
||||||
|
if (cmSystemTools::FileExists(fname.c_str()))
|
||||||
|
{
|
||||||
|
m_Makefile->AddUtilityCommand("RUN_TESTS", ctest.c_str(), "-D $(IntDir)",
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_Makefile->FindSubDirectoryCMakeListsFiles(allListFiles);
|
m_Makefile->FindSubDirectoryCMakeListsFiles(allListFiles);
|
||||||
// For each cmMakefile, create a VCProj for it, and
|
// For each cmMakefile, create a VCProj for it, and
|
||||||
// add it to this SLN file
|
// add it to this SLN file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user