[Cmake-commits] CMake branch, next, updated. v2.8.12-4097-g2d57232

Brad King brad.king at kitware.com
Thu Oct 17 09:07:28 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  2d5723224d64c4be99285c7ffc3afcda2893fba0 (commit)
       via  d4c3de2f150367457dc8fcffde586e14724bec6c (commit)
      from  c04d34eb19adde782aff21326d1c7c391a7ac236 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d5723224d64c4be99285c7ffc3afcda2893fba0
commit 2d5723224d64c4be99285c7ffc3afcda2893fba0
Merge: c04d34e d4c3de2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 17 09:07:27 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 17 09:07:27 2013 -0400

    Merge topic 'simplify-cmake-E-command-line' into next
    
    d4c3de2 cmake: Simplify -E command line processing


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4c3de2f150367457dc8fcffde586e14724bec6c
commit d4c3de2f150367457dc8fcffde586e14724bec6c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 4 14:22:05 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 17 08:56:50 2013 -0400

    cmake: Simplify -E command line processing
    
    Check for "cmake -E ..." up front (along with "cmake --build ...") and
    skip normal command line processing.  Drop the special handling for -E
    from the normal processing to simplify things.  Strictly speaking, it
    was previously possible to invoke command mode with -E anywhere in the
    command line e.g. "cmake echo -E message" or "cmake echo message -E",
    but no one should be using it as it was not documented and looks
    strange.

diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 5b534f0..5113a75 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -84,6 +84,17 @@ static const char * cmDocumentationOptions[][2] =
 
 #endif
 
+static int do_command(int ac, char** av)
+{
+  std::vector<std::string> args;
+  args.push_back(av[0]);
+  for(int i = 2; i < ac; ++i)
+    {
+    args.push_back(av[i]);
+    }
+  return cmcmd::ExecuteCMakeCommand(args);
+}
+
 int do_cmake(int ac, char** av);
 static int do_build(int ac, char** av);
 
@@ -157,9 +168,16 @@ int main(int ac, char** av)
 {
   cmSystemTools::EnableMSVCDebugHook();
   cmSystemTools::FindExecutableDirectory(av[0]);
-  if(ac > 1 && strcmp(av[1], "--build") == 0)
+  if(ac > 1)
     {
-    return do_build(ac, av);
+    if(strcmp(av[1], "--build") == 0)
+      {
+      return do_build(ac, av);
+      }
+    else if(strcmp(av[1], "-E") == 0)
+      {
+      return do_command(ac, av);
+      }
     }
   int ret = do_cmake(ac, av);
 #ifdef CMAKE_BUILD_WITH_CMAKE
@@ -180,7 +198,7 @@ int do_cmake(int ac, char** av)
 #ifdef CMAKE_BUILD_WITH_CMAKE
   cmDocumentation doc;
   doc.addCMakeStandardDocSections();
-  if(doc.CheckOptions(ac, av, "-E"))
+  if(doc.CheckOptions(ac, av))
     {
     // Construct and print requested documentation.
     cmake hcm;
@@ -220,7 +238,6 @@ int do_cmake(int ac, char** av)
 
   bool wiz = false;
   bool sysinfo = false;
-  bool command = false;
   bool list_cached = false;
   bool list_all_cached = false;
   bool list_help = false;
@@ -229,43 +246,37 @@ int do_cmake(int ac, char** av)
   std::vector<std::string> args;
   for(int i =0; i < ac; ++i)
     {
-    if(!command && strcmp(av[i], "-i") == 0)
+    if(strcmp(av[i], "-i") == 0)
       {
       wiz = true;
       }
-    else if(!command && strcmp(av[i], "--system-information") == 0)
+    else if(strcmp(av[i], "--system-information") == 0)
       {
       sysinfo = true;
       }
-    // if command has already been set, then
-    // do not eat the -E
-    else if (!command && strcmp(av[i], "-E") == 0)
-      {
-      command = true;
-      }
-    else if (!command && strcmp(av[i], "-N") == 0)
+    else if (strcmp(av[i], "-N") == 0)
       {
       view_only = true;
       }
-    else if (!command && strcmp(av[i], "-L") == 0)
+    else if (strcmp(av[i], "-L") == 0)
       {
       list_cached = true;
       }
-    else if (!command && strcmp(av[i], "-LA") == 0)
+    else if (strcmp(av[i], "-LA") == 0)
       {
       list_all_cached = true;
       }
-    else if (!command && strcmp(av[i], "-LH") == 0)
+    else if (strcmp(av[i], "-LH") == 0)
       {
       list_cached = true;
       list_help = true;
       }
-    else if (!command && strcmp(av[i], "-LAH") == 0)
+    else if (strcmp(av[i], "-LAH") == 0)
       {
       list_all_cached = true;
       list_help = true;
       }
-    else if (!command && strncmp(av[i], "-P", strlen("-P")) == 0)
+    else if (strncmp(av[i], "-P", strlen("-P")) == 0)
       {
       if ( i == ac -1 )
         {
@@ -279,8 +290,8 @@ int do_cmake(int ac, char** av)
         args.push_back(av[i]);
         }
       }
-    else if (!command && strncmp(av[i], "--find-package",
-                                 strlen("--find-package")) == 0)
+    else if (strncmp(av[i], "--find-package",
+                     strlen("--find-package")) == 0)
       {
       workingMode = cmake::FIND_PACKAGE_MODE;
       args.push_back(av[i]);
@@ -290,11 +301,6 @@ int do_cmake(int ac, char** av)
       args.push_back(av[i]);
       }
     }
-  if(command)
-    {
-    int ret = cmcmd::ExecuteCMakeCommand(args);
-    return ret;
-    }
   if (wiz)
     {
     cmakewizard wizard;

-----------------------------------------------------------------------

Summary of changes:
 Source/cmakemain.cxx |   56 +++++++++++++++++++++++++++----------------------
 1 files changed, 31 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list