make testing the CodeBlocks and Eclipse generators easier by not requiring the CMAKE_EDIT_COMMAND variable

Both generators use the CMAKE_EDIT_COMMAND variable to determine whether
they should add the edit_cache target, i.e. they don't add it if it's
ccmake, since this does not work inside the output log view of
Eclipse/Codeblocks. But instead of requiring the variable to be set they now
check it for 0 and handle this appropriately. This should help Dave getting
some testing for them :-)

Alex
This commit is contained in:
Alexander Neundorf 2009-10-20 17:14:12 -04:00
parent bc43b0f2a4
commit 9ab9bb0ece
2 changed files with 14 additions and 4 deletions

View File

@ -352,8 +352,13 @@ void cmExtraCodeBlocksGenerator
// this will not work within the IDE
if (ti->first == "edit_cache")
{
if (strstr(makefile->GetRequiredDefinition
("CMAKE_EDIT_COMMAND"), "ccmake")!=NULL)
const char* editCommand = makefile->GetDefinition
("CMAKE_EDIT_COMMAND");
if (editCommand == 0)
{
insertTarget = false;
}
else if (strstr(editCommand, "ccmake")!=NULL)
{
insertTarget = false;
}

View File

@ -727,8 +727,13 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// this will not work within the IDE
if (ti->first == "edit_cache")
{
if (strstr(makefile->GetRequiredDefinition
("CMAKE_EDIT_COMMAND"), "ccmake")!=NULL)
const char* editCommand = makefile->GetDefinition
("CMAKE_EDIT_COMMAND");
if (editCommand == 0)
{
insertTarget = false;
}
else if (strstr(editCommand, "ccmake")!=NULL)
{
insertTarget = false;
}