[Cmake-commits] CMake branch, next, updated. v2.8.3-850-g07fa3d3

Ben Boeckel ben.boeckel at kitware.com
Tue Dec 14 13:31:25 EST 2010


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  07fa3d311e56cd7158cb668318fcb58ca0e4218e (commit)
       via  6d3d650df8c67254fb5b7dafd2a02085ca372070 (commit)
      from  67a4de115fac38e526aea034b0aded4cdb55269a (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=07fa3d311e56cd7158cb668318fcb58ca0e4218e
commit 07fa3d311e56cd7158cb668318fcb58ca0e4218e
Merge: 67a4de1 6d3d650
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Dec 14 13:29:02 2010 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Dec 14 13:29:02 2010 -0500

    Merge branch 'dev/add-response-file-support' into next
    
    * dev/add-response-file-support:
      Revert response file support
    
    Conflicts:
    	Source/cmakemain.cxx

diff --cc Source/cmakemain.cxx
index d388d22,ddff71d..a51673c
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@@ -120,19 -120,6 +120,17 @@@ static const char * cmDocumentationOpti
    {"--trace", "Put cmake in trace mode.",
     "Print a trace of all calls made and from where with "
     "message(send_error ) calls."},
 +  {"--warn-uninitialized", "Warn about uninitialized values.",
 +   "Print a warning when an uninitialized variable is used."},
 +  {"--warn-unused-vars", "Warn about unused variables.",
 +   "Find variables that are declared or set, but not used."},
 +  {"--no-warn-unused-cli", "Don't warn about command line options.",
 +   "Don't find variables that are declared on the command line, but not "
 +   "used."},
 +  {"--check-system-vars", "Find problems with variable usage in system "
 +   "files.", "Normally, unused and uninitialized variables are searched for "
 +   "only in CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. This flag tells CMake to "
 +   "warn about other files as well."},
-   {"@[file]", "Specify a response file.",
-    "Read arguments from a file. Each argument should be on its own line."},
    {"--help-command cmd [file]", "Print help for a single command and exit.",
     "Full documentation specific to the given command is displayed. "
     "If a file is specified, the documentation is written into and the output "

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6d3d650df8c67254fb5b7dafd2a02085ca372070
commit 6d3d650df8c67254fb5b7dafd2a02085ca372070
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Dec 14 13:26:32 2010 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Dec 14 13:26:32 2010 -0500

    Revert response file support
    
    This interferes with other tools' response file support and fails on
    Windows which uses response files elsewhere. To properly implement this,
    argument parsing should be refactored first.

diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 28a7f2f..7bc89a4 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -177,62 +177,6 @@ void cmSystemTools::ExpandRegistryValues(std::string& source, KeyWOW64)
 }
 #endif
 
-void cmSystemTools::ExpandResponseFiles(int ac, char** av,
-                                        int& argc, char**& argv)
-{
-  std::vector<std::string> args;
-
-  args.push_back(av[0]);
-  for(int i = 1; i < ac; ++i)
-    {
-    if(av[i][0] == '@')
-      {
-      const char* fname = av[i]+1;
-      std::ifstream fin(fname);
-      if(fin)
-        {
-        std::string line;
-        while(cmSystemTools::GetLineFromStream(fin, line))
-          {
-          if(!line.empty())
-            {
-            args.push_back(line);
-            }
-          }
-        }
-      else
-        {
-        cmOStringStream e;
-        e << "Could not open response file \"" << fname << "\": "
-          << Superclass::GetLastSystemError();
-        cmSystemTools::Error(e.str().c_str());
-        }
-      }
-    else
-      {
-      args.push_back(av[i]);
-      }
-    }
-
-  argc = args.size();
-  argv = new char*[argc + 1];
-
-  for(int i = 0; i < argc; ++i)
-    {
-    argv[i] = strdup(args[i].c_str());
-    }
-  argv[argc] = NULL;
-}
-
-void cmSystemTools::FreeArgv(int argc, char** argv)
-{
-  for(int i = 0; i < argc; ++i)
-    {
-    free(argv[i]);
-    }
-  delete [] argv;
-}
-
 std::string cmSystemTools::EscapeQuotes(const char* str)
 {
   std::string result = "";
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 954eaeb..6f9147c 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -46,13 +46,6 @@ public:
   static void ExpandRegistryValues(std::string& source,
                                    KeyWOW64 view = KeyWOW64_Default);
 
-  ///! Expand response files in an argument list.
-  static void ExpandResponseFiles(int ac, char** av,
-                                  int& argc, char**& argv);
-
-  ///! Free an argument list returned by expanding response files.
-  static void FreeArgv(int ac, char** av);
-
   ///! Escape quotes in a string.
   static std::string EscapeQuotes(const char* str);
 
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 355cb89..ddff71d 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -120,8 +120,6 @@ static const char * cmDocumentationOptions[][3] =
   {"--trace", "Put cmake in trace mode.",
    "Print a trace of all calls made and from where with "
    "message(send_error ) calls."},
-  {"@[file]", "Specify a response file.",
-   "Read arguments from a file. Each argument should be on its own line."},
   {"--help-command cmd [file]", "Print help for a single command and exit.",
    "Full documentation specific to the given command is displayed. "
    "If a file is specified, the documentation is written into and the output "
@@ -311,25 +309,16 @@ static void cmakemainProgressCallback(const char *m, float prog,
 
 int main(int ac, char** av)
 {
-  int argc;
-  char** argv;
-
   cmSystemTools::EnableMSVCDebugHook();
-  cmSystemTools::ExpandResponseFiles(ac, av, argc, argv);
-  cmSystemTools::FindExecutableDirectory(argv[0]);
-  if(argc > 1 && strcmp(argv[1], "--build") == 0)
+  cmSystemTools::FindExecutableDirectory(av[0]);
+  if(ac > 1 && strcmp(av[1], "--build") == 0)
     {
-    int ret = do_build(argc, argv);
-    cmSystemTools::FreeArgv(argc, argv);
-    return ret;
+    return do_build(ac, av);
     }
-  int ret = do_cmake(argc, argv);
+  int ret = do_cmake(ac, av);
 #ifdef CMAKE_BUILD_WITH_CMAKE
   cmDynamicLoader::FlushCache();
 #endif
-
-  cmSystemTools::FreeArgv(argc, argv);
-
   return ret;
 }
 
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 5fbf546..3937d8d 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -232,8 +232,6 @@ static const char * cmDocumentationOptions[][3] =
   {"--print-labels", "Print all available test labels.",
    "This option will not run any tests, it will simply print the list of "
    "all labels associated with the test set."},
-  {"@[file]", "Specify a response file.",
-   "Read arguments from a file. Each argument should be on its own line."},
   {"--help-command <cmd> [<file>]", "Show help for a single command and exit.",
    "Prints the help for the command to stdout or to the specified file." },
   {"--help-command-list [<file>]", "List available commands and exit.",
@@ -253,22 +251,16 @@ static const char * cmDocumentationSeeAlso[][3] =
 };
 
 // this is a test driver program for cmCTest.
-int main (int ac, char *av[])
+int main (int argc, char *argv[])
 {
-  int argc;
-  char** argv;
-
   cmSystemTools::DoNotInheritStdPipes();
   cmSystemTools::EnableMSVCDebugHook();
-  cmSystemTools::ExpandResponseFiles(ac, av, argc, argv);
   cmSystemTools::FindExecutableDirectory(argv[0]);
 
   // Dispatch 'ctest --launch' mode directly.
   if(argc >= 2 && strcmp(argv[1], "--launch") == 0)
     {
-    int ret = cmCTestLaunch::Main(argc, argv);
-    cmSystemTools::FreeArgv(argc, argv);
-    return ret;
+    return cmCTestLaunch::Main(argc, argv);
     }
 
   int nocwd = 0;
@@ -315,9 +307,7 @@ int main (int ac, char *av[])
 #ifdef cout
 #  undef cout
 #endif
-      int ret = doc.PrintRequestedDocumentation(std::cout)? 0:1;
-      cmSystemTools::FreeArgv(argc, argv);
-      return ret;
+      return doc.PrintRequestedDocumentation(std::cout)? 0:1;
 #define cout no_cout_use_cmCTestLog
       }
     }
@@ -337,8 +327,6 @@ int main (int ac, char *av[])
   int res = inst.Run(args,&output);
   cmCTestLog(&inst, OUTPUT, output);
 
-  cmSystemTools::FreeArgv(argc, argv);
-
   return res;
 }
 
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 7805a16..04f0774 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -713,73 +713,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 
   ENDIF(NOT COMPILER_IS_COMO)
 
-  ADD_TEST(ResponseFile.Basic ${CMAKE_CTEST_COMMAND}
-    --build-and-test
-    "${CMake_SOURCE_DIR}/Tests/ResponseFile"
-    "${CMake_BINARY_DIR}/Tests/ResponseFileBasic"
-    --build-generator ${CMAKE_TEST_GENERATOR}
-    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-    --build-noclean
-    --build-project ResponseFileBasic
-    --build-options "@${CMAKE_CURRENT_SOURCE_DIR}/ResponseFile/response-basic")
-  SET_TESTS_PROPERTIES(ResponseFile.Basic PROPERTIES
-    PASS_REGULAR_EXPRESSION "RESPONSE_VARIABLE is: 'foo'")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ResponseFileBasic")
-
-  ADD_TEST(ResponseFile.WithSpaces ${CMAKE_CTEST_COMMAND}
-    --build-and-test
-    "${CMake_SOURCE_DIR}/Tests/ResponseFile"
-    "${CMake_BINARY_DIR}/Tests/ResponseFileWithSpaces"
-    --build-generator ${CMAKE_TEST_GENERATOR}
-    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-    --build-noclean
-    --build-project ResponseFileWithSpaces
-    --build-options "@${CMAKE_CURRENT_SOURCE_DIR}/ResponseFile/response-with-spaces")
-  SET_TESTS_PROPERTIES(ResponseFile.WithSpaces PROPERTIES
-    PASS_REGULAR_EXPRESSION "RESPONSE_VARIABLE is: 'with spaces'")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ResponseFileWithSpaces")
-
-  ADD_TEST(ResponseFile.WithBlankLine ${CMAKE_CTEST_COMMAND}
-    --build-and-test
-    "${CMake_SOURCE_DIR}/Tests/ResponseFile"
-    "${CMake_BINARY_DIR}/Tests/ResponseFileWithBlankLine"
-    --build-generator ${CMAKE_TEST_GENERATOR}
-    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-    --build-noclean
-    --build-project ResponseFileWithBlankLine
-    --build-options "@${CMAKE_CURRENT_SOURCE_DIR}/ResponseFile/response-with-blank-line")
-  SET_TESTS_PROPERTIES(ResponseFile.WithBlankLine PROPERTIES
-    PASS_REGULAR_EXPRESSION "RESPONSE_VARIABLE is: 'after blank line'")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ResponseFileWithBlankLine")
-
-  ADD_TEST(ResponseFile.Duplicate ${CMAKE_CTEST_COMMAND}
-    --build-and-test
-    "${CMake_SOURCE_DIR}/Tests/ResponseFile"
-    "${CMake_BINARY_DIR}/Tests/ResponseFileDuplicate"
-    --build-generator ${CMAKE_TEST_GENERATOR}
-    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-    --build-noclean
-    --build-project ResponseFileDuplicate
-    --build-options "@${CMAKE_CURRENT_SOURCE_DIR}/ResponseFile/response-duplicate")
-  SET_TESTS_PROPERTIES(ResponseFile.Duplicate PROPERTIES
-    PASS_REGULAR_EXPRESSION "RESPONSE_VARIABLE is: 'right'")
-  SET_TESTS_PROPERTIES(ResponseFile.Duplicate PROPERTIES
-    FAIL_REGULAR_EXPRESSION "RESPONSE_VARIABLE is: 'wrong'")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ResponseFileDuplicate")
-
-  ADD_TEST(ResponseFile.WithMany ${CMAKE_CTEST_COMMAND}
-    --build-and-test
-    "${CMake_SOURCE_DIR}/Tests/ResponseFile"
-    "${CMake_BINARY_DIR}/Tests/ResponseFileWithMany"
-    --build-generator ${CMAKE_TEST_GENERATOR}
-    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-    --build-noclean
-    --build-project ResponseFileWithMany
-    --build-options "@${CMAKE_CURRENT_SOURCE_DIR}/ResponseFile/response-with-many")
-  SET_TESTS_PROPERTIES(ResponseFile.WithMany PROPERTIES
-    PASS_REGULAR_EXPRESSION "RESPONSE_VARIABLE is: 'twentieth'")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ResponseFileWithMany")
-
   ADD_TEST(Example ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Example"

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

Summary of changes:
 Source/cmSystemTools.cxx |   56 --------------------------------------
 Source/cmSystemTools.h   |    7 -----
 Source/cmakemain.cxx     |   19 +++----------
 Source/ctest.cxx         |   18 ++----------
 Tests/CMakeLists.txt     |   67 ----------------------------------------------
 5 files changed, 7 insertions(+), 160 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list