[Cmake-commits] CMake branch, master, updated. v3.10.0-rc1-72-g5fd0ce6

Kitware Robot kwrobot at kitware.com
Wed Oct 11 08:25:09 EDT 2017


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, master has been updated
       via  5fd0ce61f71ff84c51e1ad25ebd53fd1e2444d8c (commit)
       via  86edb6660b8b938cf291e69cc73e01fc30c69809 (commit)
       via  7237d9489a5ed6224147c91c83fa828af88b1bf2 (commit)
       via  491d2108983990eeda7d91dbc958a7fa9060659f (commit)
       via  027bcee513788b5ab17c3328a14cb8ac8354ba00 (commit)
       via  5d6ba8f2daab9ebff570f36908d48defdf37d607 (commit)
       via  401737f9ff810fd053e523916ecc968a9a0b8328 (commit)
       via  e95429fd856903d3d0302be39607175457499e9d (commit)
       via  5731f6d5b1986a7ee13e83ff73971a9f44e0229a (commit)
       via  f1a4ecdc0c62b46c90df5e8d20e6f61d06063894 (commit)
       via  c551ff588b48cc4c286922779651890da0f3c22c (commit)
       via  dead049e0b4ff531866ef9bf362f3f5e8fb177aa (commit)
       via  814cddbe18d09862bfab8eb7a98682874b94e9be (commit)
       via  1c19626864d8622ac3a0f00b564ea1d7f0eb3971 (commit)
       via  ff09abb8dbd8f71a445615c08da9d099b8a063db (commit)
      from  48a58e91a6c50539260fb9744b98fb8857a8803c (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5fd0ce61f71ff84c51e1ad25ebd53fd1e2444d8c
commit 5fd0ce61f71ff84c51e1ad25ebd53fd1e2444d8c
Merge: 86edb66 ff09abb
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 11 12:23:01 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Oct 11 08:24:23 2017 -0400

    Merge topic 'linked-tree'
    
    ff09abb8 cmLinkedTree: avoid unnecessary copies during Push of T
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1351


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86edb6660b8b938cf291e69cc73e01fc30c69809
commit 86edb6660b8b938cf291e69cc73e01fc30c69809
Merge: 7237d94 5731f6d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 11 12:22:46 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Oct 11 08:22:58 2017 -0400

    Merge topic 'simplify-env-var-determination'
    
    5731f6d5 cm{Unset,Set}Command: use std::string to determine the env variable name
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1350


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7237d9489a5ed6224147c91c83fa828af88b1bf2
commit 7237d9489a5ed6224147c91c83fa828af88b1bf2
Merge: 027bcee 491d210
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 11 12:21:11 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Oct 11 08:21:14 2017 -0400

    Merge topic 'ExternalProject-CMP0054'
    
    491d2108 ExternalProject: Avoid if() auto-dereferene in quoted arguments
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1369


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=491d2108983990eeda7d91dbc958a7fa9060659f
commit 491d2108983990eeda7d91dbc958a7fa9060659f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Oct 10 07:59:19 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Oct 11 08:19:58 2017 -0400

    ExternalProject: Avoid if() auto-dereferene in quoted arguments
    
    The implementation of this module doesn't expect such dereferences
    to happen, but can when a project sets a variable called `x`.
    Set `CMP0054` explicitly to get its NEW behavior.
    
    Fixes: #17335

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 76f5080..419c9d6 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -854,6 +854,9 @@ The custom step could then be triggered from the main build like so::
 
 #]=======================================================================]
 
+cmake_policy(PUSH)
+cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
+
 # Pre-compute a regex to match documented keywords for each command.
 math(EXPR _ep_documentation_line_count "${CMAKE_CURRENT_LIST_LINE} - 4")
 file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines
@@ -3035,3 +3038,5 @@ function(ExternalProject_Add name)
   #
   _ep_add_test_command(${name})
 endfunction()
+
+cmake_policy(POP)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=027bcee513788b5ab17c3328a14cb8ac8354ba00
commit 027bcee513788b5ab17c3328a14cb8ac8354ba00
Merge: 5d6ba8f dead049
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 11 12:18:35 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Oct 11 08:18:50 2017 -0400

    Merge topic 'UseJava_OUTPUT_DIR'
    
    dead049e UseJava: OUTPUT_DIR must exists in all cases.
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1368


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d6ba8f2daab9ebff570f36908d48defdf37d607
commit 5d6ba8f2daab9ebff570f36908d48defdf37d607
Merge: 401737f e95429f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 11 12:17:35 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Oct 11 08:17:57 2017 -0400

    Merge topic 'autogen-skip-ui'
    
    e95429fd Autogen: Docs: Extend SKIP_AUTOUIC documentation
    814cddbe Autogen: Docs: Add examples for AUTORCC_OPTIONS and AUTOUIC_OPTIONS
    1c196268 Autogen: Allow setting SKIP_AUTOUIC/GEN on .ui files not in the sources
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1366


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=401737f9ff810fd053e523916ecc968a9a0b8328
commit 401737f9ff810fd053e523916ecc968a9a0b8328
Merge: 48a58e9 f1a4ecd
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 11 12:12:53 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Oct 11 08:15:24 2017 -0400

    Merge topic 'update-kwsys'
    
    f1a4ecdc Merge branch 'upstream-KWSys' into update-kwsys
    c551ff58 KWSys 2017-10-10 (239bc737)
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1370


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e95429fd856903d3d0302be39607175457499e9d
commit e95429fd856903d3d0302be39607175457499e9d
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Mon Oct 9 14:51:17 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Oct 10 13:52:49 2017 -0400

    Autogen: Docs: Extend SKIP_AUTOUIC documentation

diff --git a/Help/prop_sf/SKIP_AUTOUIC.rst b/Help/prop_sf/SKIP_AUTOUIC.rst
index 4eda726..8c962db 100644
--- a/Help/prop_sf/SKIP_AUTOUIC.rst
+++ b/Help/prop_sf/SKIP_AUTOUIC.rst
@@ -3,6 +3,9 @@ SKIP_AUTOUIC
 
 Exclude the source file from :prop_tgt:`AUTOUIC` processing (for Qt projects).
 
+:prop_sf:`SKIP_AUTOUIC` can be set on C++ header and source files and on
+``.ui`` files.
+
 For broader exclusion control see :prop_sf:`SKIP_AUTOGEN`.
 
 EXAMPLE
@@ -12,4 +15,6 @@ EXAMPLE
 
   # ...
   set_property(SOURCE file.h PROPERTY SKIP_AUTOUIC ON)
+  set_property(SOURCE file.cpp PROPERTY SKIP_AUTOUIC ON)
+  set_property(SOURCE widget.ui PROPERTY SKIP_AUTOUIC ON)
   # ...

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5731f6d5b1986a7ee13e83ff73971a9f44e0229a
commit 5731f6d5b1986a7ee13e83ff73971a9f44e0229a
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Thu Oct 5 13:12:00 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Oct 10 13:28:39 2017 -0400

    cm{Unset,Set}Command: use std::string to determine the env variable name

diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index b32cda3..985aac8 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -2,8 +2,6 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSetCommand.h"
 
-#include <string.h>
-
 #include "cmAlgorithms.h"
 #include "cmMakefile.h"
 #include "cmState.h"
@@ -22,19 +20,15 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
   }
 
   // watch for ENV signatures
-  const char* variable = args[0].c_str(); // VAR is always first
-  if (cmHasLiteralPrefix(variable, "ENV{") && strlen(variable) > 5) {
+  auto const& variable = args[0]; // VAR is always first
+  if (cmHasLiteralPrefix(variable, "ENV{") && variable.size() > 5) {
     // what is the variable name
-    char* varName = new char[strlen(variable)];
-    strncpy(varName, variable + 4, strlen(variable) - 5);
-    varName[strlen(variable) - 5] = '\0';
-    std::string putEnvArg = varName;
-    putEnvArg += "=";
+    auto const& varName = variable.substr(4, variable.size() - 5);
+    std::string putEnvArg = varName + "=";
 
     // what is the current value if any
     std::string currValue;
     const bool currValueSet = cmSystemTools::GetEnv(varName, currValue);
-    delete[] varName;
 
     // will it be set to something, then set it
     if (args.size() > 1 && !args[1].empty()) {
diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx
index 18bbdd7..cfaa1fd 100644
--- a/Source/cmUnsetCommand.cxx
+++ b/Source/cmUnsetCommand.cxx
@@ -2,8 +2,6 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmUnsetCommand.h"
 
-#include <string.h>
-
 #include "cmAlgorithms.h"
 #include "cmMakefile.h"
 #include "cmSystemTools.h"
@@ -19,19 +17,16 @@ bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
     return false;
   }
 
-  const char* variable = args[0].c_str();
+  auto const& variable = args[0];
 
   // unset(ENV{VAR})
-  if (cmHasLiteralPrefix(variable, "ENV{") && strlen(variable) > 5) {
+  if (cmHasLiteralPrefix(variable, "ENV{") && variable.size() > 5) {
     // what is the variable name
-    char* envVarName = new char[strlen(variable)];
-    strncpy(envVarName, variable + 4, strlen(variable) - 5);
-    envVarName[strlen(variable) - 5] = '\0';
+    auto const& envVarName = variable.substr(4, variable.size() - 5);
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
-    cmSystemTools::UnsetEnv(envVarName);
+    cmSystemTools::UnsetEnv(envVarName.c_str());
 #endif
-    delete[] envVarName;
     return true;
   }
   // unset(VAR)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f1a4ecdc0c62b46c90df5e8d20e6f61d06063894
commit f1a4ecdc0c62b46c90df5e8d20e6f61d06063894
Merge: c798dc8 c551ff5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Oct 10 08:43:41 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Oct 10 08:43:41 2017 -0400

    Merge branch 'upstream-KWSys' into update-kwsys
    
    * upstream-KWSys:
      KWSys 2017-10-10 (239bc737)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c551ff588b48cc4c286922779651890da0f3c22c
commit c551ff588b48cc4c286922779651890da0f3c22c
Author:     KWSys Upstream <kwrobot at kitware.com>
AuthorDate: Tue Oct 10 08:43:01 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Oct 10 08:43:35 2017 -0400

    KWSys 2017-10-10 (239bc737)
    
    Code extracted from:
    
        https://gitlab.kitware.com/utils/kwsys.git
    
    at commit 239bc737543886a72c5e9e3445d51e17f7e26abe (master).
    
    Upstream Shortlog
    -----------------
    
    Matthias Maennich (5):
          6599eda6 testRobustEncoding: restore format flags for std::cout before exiting
          862562ce SystemInformation: fix potential off-by-one write
          13e02b76 processUNIX: close intermediate file descriptor in error case
          73c491e8 processUNIX: fix not null terminated buffer during error reporting
          ce55a255 testSystemTools: fix some copy'n'paste issues
    
    Rolf Eike Beer (5):
          6ca15069 SystemTools: make Getcwd() more efficient on Windows
          6d7eb3a1 CommandLineArguments: do not check variable before delete[]
          3b8fefea remove pointer checks before calling free()
          cf8beae3 ProcessUNIX: use strdup() instead of open coding it
          5d2aff9d ProcessWin32: use strdup() instead of open coding it

diff --git a/CommandLineArguments.cxx b/CommandLineArguments.cxx
index 5613bd7..5498377 100644
--- a/CommandLineArguments.cxx
+++ b/CommandLineArguments.cxx
@@ -649,10 +649,7 @@ void CommandLineArguments::PopulateVariable(double* variable,
 void CommandLineArguments::PopulateVariable(char** variable,
                                             const std::string& value)
 {
-  if (*variable) {
-    delete[] * variable;
-    *variable = 0;
-  }
+  delete[] * variable;
   *variable = new char[value.size() + 1];
   strcpy(*variable, value.c_str());
 }
diff --git a/ProcessUNIX.c b/ProcessUNIX.c
index 3b32ca7..1431f30 100644
--- a/ProcessUNIX.c
+++ b/ProcessUNIX.c
@@ -359,9 +359,7 @@ void kwsysProcess_Delete(kwsysProcess* cp)
   kwsysProcess_SetPipeFile(cp, kwsysProcess_Pipe_STDIN, 0);
   kwsysProcess_SetPipeFile(cp, kwsysProcess_Pipe_STDOUT, 0);
   kwsysProcess_SetPipeFile(cp, kwsysProcess_Pipe_STDERR, 0);
-  if (cp->CommandExitCodes) {
-    free(cp->CommandExitCodes);
-  }
+  free(cp->CommandExitCodes);
   free(cp->ProcessResults);
   free(cp);
 }
@@ -498,11 +496,10 @@ int kwsysProcess_SetWorkingDirectory(kwsysProcess* cp, const char* dir)
     cp->WorkingDirectory = 0;
   }
   if (dir) {
-    cp->WorkingDirectory = (char*)malloc(strlen(dir) + 1);
+    cp->WorkingDirectory = strdup(dir);
     if (!cp->WorkingDirectory) {
       return 0;
     }
-    strcpy(cp->WorkingDirectory, dir);
   }
   return 1;
 }
@@ -531,11 +528,10 @@ int kwsysProcess_SetPipeFile(kwsysProcess* cp, int prPipe, const char* file)
     *pfile = 0;
   }
   if (file) {
-    *pfile = (char*)malloc(strlen(file) + 1);
+    *pfile = strdup(file);
     if (!*pfile) {
       return 0;
     }
-    strcpy(*pfile, file);
   }
 
   /* If we are redirecting the pipe, do not share it or use a native
@@ -1514,9 +1510,7 @@ static int kwsysProcessInitialize(kwsysProcess* cp)
   oldForkPIDs = cp->ForkPIDs;
   cp->ForkPIDs = (volatile pid_t*)malloc(sizeof(volatile pid_t) *
                                          (size_t)(cp->NumberOfCommands));
-  if (oldForkPIDs) {
-    kwsysProcessVolatileFree(oldForkPIDs);
-  }
+  kwsysProcessVolatileFree(oldForkPIDs);
   if (!cp->ForkPIDs) {
     return 0;
   }
@@ -1524,9 +1518,7 @@ static int kwsysProcessInitialize(kwsysProcess* cp)
     cp->ForkPIDs[i] = 0; /* can't use memset due to volatile */
   }
 
-  if (cp->CommandExitCodes) {
-    free(cp->CommandExitCodes);
-  }
+  free(cp->CommandExitCodes);
   cp->CommandExitCodes =
     (int*)malloc(sizeof(int) * (size_t)(cp->NumberOfCommands));
   if (!cp->CommandExitCodes) {
@@ -1938,6 +1930,7 @@ static int kwsysProcessSetupOutputPipeFile(int* p, const char* name)
 
   /* Set close-on-exec flag on the pipe's end.  */
   if (fcntl(fout, F_SETFD, FD_CLOEXEC) < 0) {
+    close(fout);
     return 0;
   }
 
@@ -2290,6 +2283,7 @@ static void kwsysProcessChildErrorExit(int errorPipe)
   char buffer[KWSYSPE_PIPE_BUFFER_SIZE];
   kwsysProcess_ssize_t result;
   strncpy(buffer, strerror(errno), KWSYSPE_PIPE_BUFFER_SIZE);
+  buffer[KWSYSPE_PIPE_BUFFER_SIZE - 1] = '\0';
 
   /* Report the error to the parent through the special pipe.  */
   result = write(errorPipe, buffer, strlen(buffer));
diff --git a/ProcessWin32.c b/ProcessWin32.c
index 5183e3d..945fa28 100644
--- a/ProcessWin32.c
+++ b/ProcessWin32.c
@@ -523,9 +523,7 @@ void kwsysProcess_Delete(kwsysProcess* cp)
   kwsysProcess_SetPipeFile(cp, kwsysProcess_Pipe_STDIN, 0);
   kwsysProcess_SetPipeFile(cp, kwsysProcess_Pipe_STDOUT, 0);
   kwsysProcess_SetPipeFile(cp, kwsysProcess_Pipe_STDERR, 0);
-  if (cp->CommandExitCodes) {
-    free(cp->CommandExitCodes);
-  }
+  free(cp->CommandExitCodes);
   free(cp->ProcessResults);
   free(cp);
 }
@@ -713,11 +711,10 @@ int kwsysProcess_SetPipeFile(kwsysProcess* cp, int pipe, const char* file)
     *pfile = 0;
   }
   if (file) {
-    *pfile = (char*)malloc(strlen(file) + 1);
+    *pfile = strdup(file);
     if (!*pfile) {
       return 0;
     }
-    strcpy(*pfile, file);
   }
 
   /* If we are redirecting the pipe, do not share it or use a native
@@ -1607,9 +1604,7 @@ int kwsysProcessInitialize(kwsysProcess* cp)
   }
   ZeroMemory(cp->ProcessInformation,
              sizeof(PROCESS_INFORMATION) * cp->NumberOfCommands);
-  if (cp->CommandExitCodes) {
-    free(cp->CommandExitCodes);
-  }
+  free(cp->CommandExitCodes);
   cp->CommandExitCodes = (DWORD*)malloc(sizeof(DWORD) * cp->NumberOfCommands);
   if (!cp->CommandExitCodes) {
     return 0;
@@ -2362,9 +2357,7 @@ static int kwsysProcess_List__New_NT4(kwsysProcess_List* self)
 static void kwsysProcess_List__Delete_NT4(kwsysProcess_List* self)
 {
   /* Free the process information buffer.  */
-  if (self->Buffer) {
-    free(self->Buffer);
-  }
+  free(self->Buffer);
 }
 
 static int kwsysProcess_List__Update_NT4(kwsysProcess_List* self)
diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 86fdccd..366fe30 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -1346,7 +1346,7 @@ std::string SymbolProperties::GetBinary() const
     std::string binary;
     char buf[1024] = { '\0' };
     ssize_t ll = 0;
-    if ((ll = readlink("/proc/self/exe", buf, 1024)) > 0) {
+    if ((ll = readlink("/proc/self/exe", buf, 1024)) > 0 && ll < 1024) {
       buf[ll] = '\0';
       binary = buf;
     } else {
diff --git a/SystemTools.cxx b/SystemTools.cxx
index ecfa331..a24a326 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -20,6 +20,7 @@
 #include KWSYS_HEADER(SystemTools.hxx)
 #include KWSYS_HEADER(Directory.hxx)
 #include KWSYS_HEADER(FStream.hxx)
+#include KWSYS_HEADER(Encoding.h)
 #include KWSYS_HEADER(Encoding.hxx)
 
 #include <fstream>
@@ -227,13 +228,17 @@ inline const char* Getcwd(char* buf, unsigned int len)
 {
   std::vector<wchar_t> w_buf(len);
   if (_wgetcwd(&w_buf[0], len)) {
-    // make sure the drive letter is capital
-    if (wcslen(&w_buf[0]) > 1 && w_buf[1] == L':') {
-      w_buf[0] = towupper(w_buf[0]);
+    size_t nlen = kwsysEncoding_wcstombs(buf, &w_buf[0], len);
+    if (nlen == static_cast<size_t>(-1)) {
+      return 0;
+    }
+    if (nlen < len) {
+      // make sure the drive letter is capital
+      if (nlen > 1 && buf[1] == ':') {
+        buf[0] = toupper(buf[0]);
+      }
+      return buf;
     }
-    std::string tmp = KWSYS_NAMESPACE::Encoding::ToNarrow(&w_buf[0]);
-    strcpy(buf, tmp.c_str());
-    return buf;
   }
   return 0;
 }
diff --git a/testEncoding.cxx b/testEncoding.cxx
index 2c5ef46..2742fe4 100644
--- a/testEncoding.cxx
+++ b/testEncoding.cxx
@@ -75,6 +75,10 @@ static int testRobustEncoding()
   // test that the conversion functions handle invalid
   // unicode correctly/gracefully
 
+  // we manipulate the format flags of stdout, remember
+  // the original state here to restore before return
+  std::ios::fmtflags const& flags = std::cout.flags();
+
   int ret = 0;
   char cstr[] = { (char)-1, 0 };
   // this conversion could fail
@@ -120,6 +124,7 @@ static int testRobustEncoding()
     ret++;
   }
 
+  std::cout.flags(flags);
   return ret;
 }
 
diff --git a/testProcess.c b/testProcess.c
index 092dd03..cd817d9 100644
--- a/testProcess.c
+++ b/testProcess.c
@@ -687,9 +687,7 @@ int main(int argc, const char* argv[])
     fflush(stdout);
     fflush(stderr);
 #if defined(_WIN32)
-    if (argv0) {
-      free(argv0);
-    }
+    free(argv0);
 #endif
     return r;
   } else if (argc > 2 && strcmp(argv[1], "0") == 0) {
diff --git a/testSystemTools.cxx b/testSystemTools.cxx
index 768eb4d..3b694c9 100644
--- a/testSystemTools.cxx
+++ b/testSystemTools.cxx
@@ -254,22 +254,22 @@ static bool CheckFileOperations()
   }
   // should work, was created as new file before
   if (!kwsys::SystemTools::FileExists(testNewFile)) {
-    std::cerr << "Problem with FileExists for: " << testNewDir << std::endl;
+    std::cerr << "Problem with FileExists for: " << testNewFile << std::endl;
     res = false;
   }
   if (!kwsys::SystemTools::FileExists(testNewFile.c_str())) {
-    std::cerr << "Problem with FileExists as C string for: " << testNewDir
+    std::cerr << "Problem with FileExists as C string for: " << testNewFile
               << std::endl;
     res = false;
   }
   if (!kwsys::SystemTools::FileExists(testNewFile, true)) {
-    std::cerr << "Problem with FileExists as file for: " << testNewDir
+    std::cerr << "Problem with FileExists as file for: " << testNewFile
               << std::endl;
     res = false;
   }
   if (!kwsys::SystemTools::FileExists(testNewFile.c_str(), true)) {
     std::cerr << "Problem with FileExists as C string and file for: "
-              << testNewDir << std::endl;
+              << testNewFile << std::endl;
     res = false;
   }
 
@@ -285,7 +285,7 @@ static bool CheckFileOperations()
   }
   // should work, was created as new file before
   if (!kwsys::SystemTools::PathExists(testNewFile)) {
-    std::cerr << "Problem with PathExists for: " << testNewDir << std::endl;
+    std::cerr << "Problem with PathExists for: " << testNewFile << std::endl;
     res = false;
   }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dead049e0b4ff531866ef9bf362f3f5e8fb177aa
commit dead049e0b4ff531866ef9bf362f3f5e8fb177aa
Author:     Marc Chevrier <marc.chevrier at sap.com>
AuthorDate: Tue Oct 10 09:38:43 2017 +0200
Commit:     Marc Chevrier <marc.chevrier at sap.com>
CommitDate: Tue Oct 10 10:00:23 2017 +0200

    UseJava: OUTPUT_DIR must exists in all cases.
    
    Fixes: #17316

diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 1182875..b925ee2 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -516,6 +516,8 @@ function(add_jar _TARGET_NAME)
     endforeach()
 
     set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${_add_jar_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
+    # ensure output directory exists
+    file (MAKE_DIRECTORY "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
 
     set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar")
     if (_add_jar_OUTPUT_NAME AND _add_jar_VERSION)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index ce53454..c25fc44 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -3261,6 +3261,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
           --build-options ${build_options}
           --test-command ${JAVA_RUNTIME} -classpath hello2.jar HelloWorld)
         list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceList")
+        add_test(Java.JarSourceListAndOutput ${CMAKE_CTEST_COMMAND}
+          --build-and-test
+          "${CMake_SOURCE_DIR}/Tests/Java"
+          "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput"
+          ${build_generator_args}
+          --build-project hello
+          --build-target hello3
+          --build-two-config
+          --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput/hello3"
+          --build-options ${build_options}
+          --test-command ${JAVA_RUNTIME} -classpath hello3.jar HelloWorld)
+        list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput")
 
         # For next test, java tool must have same architecture as toolchain
         math(EXPR _object_mode "${CMAKE_SIZEOF_VOID_P} * 8")
diff --git a/Tests/Java/CMakeLists.txt b/Tests/Java/CMakeLists.txt
index e1bcf3c..0b8269b 100644
--- a/Tests/Java/CMakeLists.txt
+++ b/Tests/Java/CMakeLists.txt
@@ -11,3 +11,6 @@ add_jar(hello A.java HelloWorld.java)
 # use listing file to specify sources
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/java_fileslist "A.java\nHelloWorld.java\n")
 add_jar(hello2 @${CMAKE_CURRENT_BINARY_DIR}/java_fileslist)
+
+# use listing file to specify sources and specify output directory (issue #17316)
+add_jar(hello3 @${CMAKE_CURRENT_BINARY_DIR}/java_fileslist OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/hello3")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=814cddbe18d09862bfab8eb7a98682874b94e9be
commit 814cddbe18d09862bfab8eb7a98682874b94e9be
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Mon Oct 9 14:31:00 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Mon Oct 9 14:36:48 2017 +0200

    Autogen: Docs: Add examples for AUTORCC_OPTIONS and AUTOUIC_OPTIONS

diff --git a/Help/prop_sf/AUTORCC_OPTIONS.rst b/Help/prop_sf/AUTORCC_OPTIONS.rst
index d9dc4d3..2bec033 100644
--- a/Help/prop_sf/AUTORCC_OPTIONS.rst
+++ b/Help/prop_sf/AUTORCC_OPTIONS.rst
@@ -9,5 +9,14 @@ optional ``OPTIONS`` argument of the :module:`qt4_add_resources() <FindQt4>` mac
 
 By default it is empty.
 
-The options set on the ``.qrc`` source file may override :prop_tgt:`AUTORCC_OPTIONS` set
-on the target.
+The options set on the ``.qrc`` source file may override
+:prop_tgt:`AUTORCC_OPTIONS` set on the target.
+
+EXAMPLE
+^^^^^^^
+
+.. code-block:: cmake
+
+  # ...
+  set_property(SOURCE resources.qrc PROPERTY AUTORCC_OPTIONS "--compress;9")
+  # ...
diff --git a/Help/prop_sf/AUTOUIC_OPTIONS.rst b/Help/prop_sf/AUTOUIC_OPTIONS.rst
index bb48da9..e2f47ec 100644
--- a/Help/prop_sf/AUTOUIC_OPTIONS.rst
+++ b/Help/prop_sf/AUTOUIC_OPTIONS.rst
@@ -4,11 +4,20 @@ AUTOUIC_OPTIONS
 Additional options for ``uic`` when using :prop_tgt:`AUTOUIC`
 
 This property holds additional command line options
-which will be used when ``uic`` is executed during the build via :prop_tgt:`AUTOUIC`,
-i.e. it is equivalent to the optional ``OPTIONS`` argument of the
-:module:`qt4_wrap_ui() <FindQt4>` macro.
+which will be used when ``uic`` is executed during the build via
+:prop_tgt:`AUTOUIC`, i.e. it is equivalent to the optional ``OPTIONS``
+argument of the :module:`qt4_wrap_ui() <FindQt4>` macro.
 
 By default it is empty.
 
-The options set on the ``.ui`` source file may override :prop_tgt:`AUTOUIC_OPTIONS` set
-on the target.
+The options set on the ``.ui`` source file may override
+:prop_tgt:`AUTOUIC_OPTIONS` set on the target.
+
+EXAMPLE
+^^^^^^^
+
+.. code-block:: cmake
+
+  # ...
+  set_property(SOURCE widget.ui PROPERTY AUTOUIC_OPTIONS "--no-protection")
+  # ...
diff --git a/Help/prop_tgt/AUTORCC_OPTIONS.rst b/Help/prop_tgt/AUTORCC_OPTIONS.rst
index 8a0f632..d6ade5a 100644
--- a/Help/prop_tgt/AUTORCC_OPTIONS.rst
+++ b/Help/prop_tgt/AUTORCC_OPTIONS.rst
@@ -19,3 +19,12 @@ set on the ``.qrc`` source file.
 
 See the :manual:`cmake-qt(7)` manual for more information on using CMake
 with Qt.
+
+EXAMPLE
+^^^^^^^
+
+.. code-block:: cmake
+
+  # ...
+  set_property(TARGET tgt PROPERTY AUTORCC_OPTIONS "--compress;9")
+  # ...
diff --git a/Help/prop_tgt/AUTOUIC_OPTIONS.rst b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
index 9fb042e..3f613b9 100644
--- a/Help/prop_tgt/AUTOUIC_OPTIONS.rst
+++ b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
@@ -23,3 +23,12 @@ expressions.
 
 See the :manual:`cmake-qt(7)` manual for more information on using CMake
 with Qt.
+
+EXAMPLE
+^^^^^^^
+
+.. code-block:: cmake
+
+  # ...
+  set_property(TARGET tgt PROPERTY AUTOUIC_OPTIONS "--no-protection")
+  # ...
diff --git a/Help/variable/CMAKE_AUTORCC_OPTIONS.rst b/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
index 298cb6b..815d39d 100644
--- a/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
+++ b/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
@@ -1,7 +1,16 @@
 CMAKE_AUTORCC_OPTIONS
 ---------------------
 
-Whether to handle ``rcc`` automatically for Qt targets.
+Additional options for ``rcc`` when using :variable:`CMAKE_AUTORCC`.
 
 This variable is used to initialize the :prop_tgt:`AUTORCC_OPTIONS` property on
 all the targets.  See that target property for additional information.
+
+EXAMPLE
+^^^^^^^
+
+.. code-block:: cmake
+
+  # ...
+  set(CMAKE_AUTORCC_OPTIONS "--compress;9")
+  # ...
diff --git a/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst b/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
index 3c9b8c4..28fa92f 100644
--- a/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
+++ b/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
@@ -1,7 +1,16 @@
 CMAKE_AUTOUIC_OPTIONS
 ---------------------
 
-Whether to handle ``uic`` automatically for Qt targets.
+Additional options for ``uic`` when using :variable:`CMAKE_AUTOUIC`.
 
 This variable is used to initialize the :prop_tgt:`AUTOUIC_OPTIONS` property on
 all the targets.  See that target property for additional information.
+
+EXAMPLE
+^^^^^^^
+
+.. code-block:: cmake
+
+  # ...
+  set_property(CMAKE_AUTOUIC_OPTIONS "--no-protection")
+  # ...

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c19626864d8622ac3a0f00b564ea1d7f0eb3971
commit 1c19626864d8622ac3a0f00b564ea1d7f0eb3971
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Mon Oct 9 14:03:18 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Mon Oct 9 14:35:17 2017 +0200

    Autogen: Allow setting SKIP_AUTOUIC/GEN on .ui files not in the sources
    
    SKIP_AUTOUIC and SKIP_AUTOGEN were ignored when set on a `.ui` file that
    was not in the sources of the target.

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 217865b..e7080cd 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -452,8 +452,6 @@ static void SetupAutoTargetUic(cmQtAutoGenDigest const& digest,
   cmGeneratorTarget const* target = digest.Target;
   cmMakefile* makefile = target->Target->GetMakefile();
 
-  AddDefinitionEscaped(makefile, "_uic_skip", setup.UicSkip);
-
   // Uic search paths
   {
     std::vector<std::string> uicSearchPaths;
@@ -489,21 +487,25 @@ static void SetupAutoTargetUic(cmQtAutoGenDigest const& digest,
       }
     }
   }
-  // Uic files options
+  // .ui files skip and options
   {
     std::vector<std::string> uiFileFiles;
     std::vector<std::vector<std::string>> uiFileOptions;
     {
       std::string const uiExt = "ui";
-      const std::vector<cmSourceFile*>& srcFiles = makefile->GetSourceFiles();
-      for (cmSourceFile* sf : srcFiles) {
+      for (cmSourceFile* sf : makefile->GetSourceFiles()) {
         // sf->GetExtension() is only valid after sf->GetFullPath() ...
         std::string const& fPath = sf->GetFullPath();
         if (sf->GetExtension() == uiExt) {
+          std::string const absFile = cmSystemTools::GetRealPath(fPath);
+          // Check if the file should be skipped
+          if (sf->GetPropertyAsBool("SKIP_AUTOUIC") ||
+              sf->GetPropertyAsBool("SKIP_AUTOGEN")) {
+            setup.UicSkip.insert(absFile);
+          }
           // Check if the files has uic options
           std::string const uicOpts = GetSafeProperty(sf, "AUTOUIC_OPTIONS");
           if (!uicOpts.empty()) {
-            std::string const absFile = cmSystemTools::GetRealPath(fPath);
             // Check if file isn't skipped
             if (setup.UicSkip.count(absFile) == 0) {
               uiFileFiles.push_back(absFile);
@@ -519,6 +521,8 @@ static void SetupAutoTargetUic(cmQtAutoGenDigest const& digest,
     AddDefinitionEscaped(makefile, "_qt_uic_options_options", uiFileOptions);
   }
 
+  AddDefinitionEscaped(makefile, "_uic_skip", setup.UicSkip);
+
   // Uic executable
   {
     std::string err;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff09abb8dbd8f71a445615c08da9d099b8a063db
commit ff09abb8dbd8f71a445615c08da9d099b8a063db
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Wed Oct 4 19:34:36 2017 +0200
Commit:     Matthias Maennich <matthias at maennich.net>
CommitDate: Mon Oct 9 10:23:14 2017 +0200

    cmLinkedTree: avoid unnecessary copies during Push of T

diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h
index 8865e23..975f052 100644
--- a/Source/cmLinkedTree.h
+++ b/Source/cmLinkedTree.h
@@ -137,7 +137,7 @@ public:
 
   iterator Push(iterator it) { return Push_impl(it, T()); }
 
-  iterator Push(iterator it, T t) { return Push_impl(it, t); }
+  iterator Push(iterator it, T t) { return Push_impl(it, std::move(t)); }
 
   bool IsLast(iterator it) { return it.Position == this->Data.size(); }
 
@@ -177,12 +177,12 @@ private:
 
   T* GetPointer(PositionType pos) { return &this->Data[pos]; }
 
-  iterator Push_impl(iterator it, T t)
+  iterator Push_impl(iterator it, T&& t)
   {
     assert(this->UpPositions.size() == this->Data.size());
     assert(it.Position <= this->UpPositions.size());
     this->UpPositions.push_back(it.Position);
-    this->Data.push_back(t);
+    this->Data.push_back(std::move(t));
     return iterator(this, this->UpPositions.size());
   }
 

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

Summary of changes:
 Help/prop_sf/AUTORCC_OPTIONS.rst        |   13 +++++++++++--
 Help/prop_sf/AUTOUIC_OPTIONS.rst        |   19 ++++++++++++++-----
 Help/prop_sf/SKIP_AUTOUIC.rst           |    5 +++++
 Help/prop_tgt/AUTORCC_OPTIONS.rst       |    9 +++++++++
 Help/prop_tgt/AUTOUIC_OPTIONS.rst       |    9 +++++++++
 Help/variable/CMAKE_AUTORCC_OPTIONS.rst |   11 ++++++++++-
 Help/variable/CMAKE_AUTOUIC_OPTIONS.rst |   11 ++++++++++-
 Modules/ExternalProject.cmake           |    5 +++++
 Modules/UseJava.cmake                   |    2 ++
 Source/cmLinkedTree.h                   |    6 +++---
 Source/cmQtAutoGeneratorInitializer.cxx |   16 ++++++++++------
 Source/cmSetCommand.cxx                 |   14 ++++----------
 Source/cmUnsetCommand.cxx               |   13 ++++---------
 Source/kwsys/CommandLineArguments.cxx   |    5 +----
 Source/kwsys/ProcessUNIX.c              |   20 +++++++-------------
 Source/kwsys/ProcessWin32.c             |   15 ++++-----------
 Source/kwsys/SystemInformation.cxx      |    2 +-
 Source/kwsys/SystemTools.cxx            |   17 +++++++++++------
 Source/kwsys/testEncoding.cxx           |    5 +++++
 Source/kwsys/testProcess.c              |    4 +---
 Source/kwsys/testSystemTools.cxx        |   10 +++++-----
 Tests/CMakeLists.txt                    |   12 ++++++++++++
 Tests/Java/CMakeLists.txt               |    3 +++
 23 files changed, 146 insertions(+), 80 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list