ENH: fix build issue with config type not being specified by ctest
This commit is contained in:
parent
5c48eab7a8
commit
267fd538d8
|
@ -264,7 +264,6 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
|
||||||
config,
|
config,
|
||||||
!this->BuildNoClean,
|
!this->BuildNoClean,
|
||||||
false, remainingTime);
|
false, remainingTime);
|
||||||
|
|
||||||
out << output;
|
out << output;
|
||||||
// if the build failed then return
|
// if the build failed then return
|
||||||
if (retVal)
|
if (retVal)
|
||||||
|
|
|
@ -92,11 +92,25 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
|
||||||
this->GlobalGenerator->FindMakeProgram(this->Makefile);
|
this->GlobalGenerator->FindMakeProgram(this->Makefile);
|
||||||
const char* cmakeMakeProgram
|
const char* cmakeMakeProgram
|
||||||
= this->Makefile->GetDefinition("CMAKE_MAKE_PROGRAM");
|
= this->Makefile->GetDefinition("CMAKE_MAKE_PROGRAM");
|
||||||
|
if(strlen(cmakeBuildConfiguration) == 0)
|
||||||
|
{
|
||||||
|
const char* config = 0;
|
||||||
|
#ifdef CMAKE_INTDIR
|
||||||
|
config = CMAKE_INTDIR;
|
||||||
|
#endif
|
||||||
|
if(!config)
|
||||||
|
{
|
||||||
|
config = "Debug";
|
||||||
|
}
|
||||||
|
cmakeBuildConfiguration = config;
|
||||||
|
}
|
||||||
|
|
||||||
std::string buildCommand
|
std::string buildCommand
|
||||||
= this->GlobalGenerator->GenerateBuildCommand(cmakeMakeProgram,
|
= this->GlobalGenerator->
|
||||||
cmakeProjectName,
|
GenerateBuildCommand(cmakeMakeProgram,
|
||||||
cmakeBuildAdditionalFlags, cmakeBuildTarget,
|
cmakeProjectName,
|
||||||
cmakeBuildConfiguration, true, false);
|
cmakeBuildAdditionalFlags, cmakeBuildTarget,
|
||||||
|
cmakeBuildConfiguration, true, false);
|
||||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||||
"SetMakeCommand:"
|
"SetMakeCommand:"
|
||||||
<< buildCommand.c_str() << "\n");
|
<< buildCommand.c_str() << "\n");
|
||||||
|
|
|
@ -1206,6 +1206,18 @@ std::string cmCTestTestHandler
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(fullPath.size() == 0)
|
||||||
|
{
|
||||||
|
cmCTestLog(ctest, HANDLER_OUTPUT,
|
||||||
|
"Could not find executable " << testCommand << "\n"
|
||||||
|
<< "Looked in the following places:\n");
|
||||||
|
for(std::vector<std::string>::iterator i = failed.begin();
|
||||||
|
i != failed.end(); ++i)
|
||||||
|
{
|
||||||
|
cmCTestLog(ctest, HANDLER_OUTPUT,
|
||||||
|
i->c_str() << "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return fullPath;
|
return fullPath;
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,6 +187,11 @@ std::string cmGlobalXCodeGenerator
|
||||||
makeCommand += " build";
|
makeCommand += " build";
|
||||||
}
|
}
|
||||||
makeCommand += " -target ";
|
makeCommand += " -target ";
|
||||||
|
// if it is a null string for config don't use it
|
||||||
|
if(config && *config == 0)
|
||||||
|
{
|
||||||
|
config = 0;
|
||||||
|
}
|
||||||
if (targetName && strlen(targetName))
|
if (targetName && strlen(targetName))
|
||||||
{
|
{
|
||||||
makeCommand += targetName;
|
makeCommand += targetName;
|
||||||
|
@ -209,6 +214,7 @@ std::string cmGlobalXCodeGenerator
|
||||||
makeCommand += " ";
|
makeCommand += " ";
|
||||||
makeCommand += additionalOptions;
|
makeCommand += additionalOptions;
|
||||||
}
|
}
|
||||||
|
std::cerr << "**** build command " << makeCommand.c_str() << "\n";
|
||||||
return makeCommand;
|
return makeCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue