ENH: fix build issue with config type not being specified by ctest

This commit is contained in:
Bill Hoffman 2007-09-17 10:40:57 -04:00
parent 5c48eab7a8
commit 267fd538d8
4 changed files with 36 additions and 5 deletions

View File

@ -264,7 +264,6 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
config,
!this->BuildNoClean,
false, remainingTime);
out << output;
// if the build failed then return
if (retVal)

View File

@ -92,11 +92,25 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
this->GlobalGenerator->FindMakeProgram(this->Makefile);
const char* cmakeMakeProgram
= 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
= this->GlobalGenerator->GenerateBuildCommand(cmakeMakeProgram,
cmakeProjectName,
cmakeBuildAdditionalFlags, cmakeBuildTarget,
cmakeBuildConfiguration, true, false);
= this->GlobalGenerator->
GenerateBuildCommand(cmakeMakeProgram,
cmakeProjectName,
cmakeBuildAdditionalFlags, cmakeBuildTarget,
cmakeBuildConfiguration, true, false);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:"
<< buildCommand.c_str() << "\n");

View File

@ -1206,6 +1206,18 @@ std::string cmCTestTestHandler
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;
}

View File

@ -187,6 +187,11 @@ std::string cmGlobalXCodeGenerator
makeCommand += " build";
}
makeCommand += " -target ";
// if it is a null string for config don't use it
if(config && *config == 0)
{
config = 0;
}
if (targetName && strlen(targetName))
{
makeCommand += targetName;
@ -209,6 +214,7 @@ std::string cmGlobalXCodeGenerator
makeCommand += " ";
makeCommand += additionalOptions;
}
std::cerr << "**** build command " << makeCommand.c_str() << "\n";
return makeCommand;
}