From 9ab9bb0eceb853edd6621ed2fe8cf221daadabfc Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Tue, 20 Oct 2009 17:14:12 -0400 Subject: [PATCH] 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 --- Source/cmExtraCodeBlocksGenerator.cxx | 9 +++++++-- Source/cmExtraEclipseCDT4Generator.cxx | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 3bf89765f..4bedea357 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -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; } diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 61be23302..0a5101ff9 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -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; }