I built a source tree with several independent projects using CMake to build each individual project.
Important: I do NOT have a global CMakeLists.txt file to perform the whole build, I use generic scripts (windows (.cmd) and unix (.sh)) to loop on all subprojects. I want to keep projects independent and yet have the ability to build them all automatically.
In CDash on the other hand, I'd like to see all these independent projects as CDash subprojects as part of a bigger unique artificial CDash project.
To work with CDash, I followed the method described at: http://www.cmake.org/Wiki/CMake/Testing_With_CTest
I'll name this method A.
Namely, I do:
enable_testing()
include(CTest)
And, then put some tests of my own.
Afterwards, I tried to follow following page indications to make my individual projects seen as subprojects: http://www.kitware.com/media/html/CDashSubprojects.html
I'll name this method B.
The problem is that the xml that are submited to CDash lack the SubProject
and Labels
xml elements (tags for xml abusers), those under Sites
, although my CMakeLists.txt (actually my CTestConfig.cmake) file has the following global property settings (I tried to put it in both files):
set_property(GLOBAL PROPERTY SubProject ${CMAKE_PROJECT_NAME})
set_property(GLOBAL PROPERTY Label ${CMAKE_PROJECT_NAME})
where CMAKE_PROJECT_NAME is -of course- well defined.
- Do you know wjy
SubProject
andLabels
elements are missing underSites
element of submited xml files? - Can methods A and B be mixed?
Furthermore, I checked CTest source, these global properties are added by this function (I took it from 2.8.10, couldn't download the source of 2.8.11 I'm using, so I hope there's no change it that otherwise sorry):
//----------------------------------------------------------------------
void cmCTest::AddSiteProperties(std::ostream& ostr)
{
cmCTestScriptHandler* ch =
static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
cmake* cm = ch->GetCMake();
// if no CMake then this is the old style script and props like
// this will not work anyway.
if(!cm)
{
return;
}
// This code should go when cdash is changed to use labels only
const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL);
if(subproject)
{
ostr << "<Subproject name=\"" << subproject << "\">\n";
const char* labels =
ch->GetCMake()->GetProperty("SubProjectLabels", cmProperty::GLOBAL);
if(labels)
{
ostr << " <Labels>\n";
std::string l = labels;
std::vector<std::string> args;
cmSystemTools::ExpandListArgument(l, args);
for(std::vector<std::string>::iterator i = args.begin();
i != args.end(); ++i)
{
ostr << " <Label>" << i->c_str() << "</Label>\n";
}
ostr << " </Labels>\n";
}
ostr << "</Subproject>\n";
}
// This code should stay when cdash only does label based sub-projects
const char* label = cm->GetProperty("Label", cmProperty::GLOBAL);
if(label)
{
ostr << "<Labels>\n";
ostr << " <Label>" << label << "</Label>\n";
ostr << "</Labels>\n";
}
}
- Does
ch->GetCMake()
return NULL somehow in my case?
Thanks in advance for your help. Regards.
P.-S.: Please refrain yourself from asking me why I do this or that (unless you have a relevante point to make), because -one- it doesn't help, -two- if I do it, it's because I've got a good reason where this place is not a good one to expose it. I come here to seek your kind help preferably from someone who knows what s/he's talking about or a clear final "no it's not possible that way, do it that other way, because of this" (the because being mandatory - please no peremptory answers).