Browse Source

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
Alexander Neundorf 16 years ago
parent
commit
9ab9bb0ece
2 changed files with 14 additions and 4 deletions
  1. 7 2
      Source/cmExtraCodeBlocksGenerator.cxx
  2. 7 2
      Source/cmExtraEclipseCDT4Generator.cxx

+ 7 - 2
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;
                 }

+ 7 - 2
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;
                }