[Cmake-commits] CMake branch, master, updated. v3.9.3-1042-ga9870c9

Kitware Robot kwrobot at kitware.com
Mon Oct 2 08:05: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  a9870c92118e242dfbc079aa1cea6a4214378e14 (commit)
       via  275b4a53eef8d10af069fbcb0d1d9bc4d0b5f6d5 (commit)
       via  9288c291cb56f75ad0ed8a86b0882d1998c8b79d (commit)
       via  90bd92ae8876cff7c2d372e752e2297411ce2d1b (commit)
       via  1f560b08d4a0dea44a8fbee4c54425b6c143c404 (commit)
       via  90f1b9ad4ebc882bb3f45834c8a5953ba1cee3c2 (commit)
       via  4532b0357261af903f86bc29429ae3c9413b54ab (commit)
       via  ec30129b41ca705cb1f41df24ad1e886b527385e (commit)
       via  c044b9ae8421cae4ee91399dabee31aa75f80b1c (commit)
       via  aa640cc20f55589796484737a7157469ec30623d (commit)
       via  6bbc1e775d46cbe1ad97ecea0862d030680b332a (commit)
       via  75c98b5ef4eae201f259cf1c599fe49fc407b4d4 (commit)
       via  1d7f099d9cf489872a70b7616ff644cd4a91a7ae (commit)
      from  41bf791a68c000345fef16188b909348f2932bdb (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=a9870c92118e242dfbc079aa1cea6a4214378e14
commit a9870c92118e242dfbc079aa1cea6a4214378e14
Merge: 275b4a5 ec30129
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 2 12:01:43 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 2 08:01:48 2017 -0400

    Merge topic 'DNDGen-stack-var'
    
    ec30129b CPack: put local variable on the stack
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1331


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=275b4a53eef8d10af069fbcb0d1d9bc4d0b5f6d5
commit 275b4a53eef8d10af069fbcb0d1d9bc4d0b5f6d5
Merge: 9288c29 6bbc1e7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 2 12:01:02 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 2 08:01:21 2017 -0400

    Merge topic 'autogen-predefs'
    
    6bbc1e77 Autogen: Add release notes for (CMAKE_)AUTOMOC_COMPILER_PREDEFINES
    75c98b5e Autogen: Doc: Add documentation for (CMAKE_)AUTOMOC_COMPILER_PREDEFINES
    1d7f099d Autogen: Add (CMAKE_)AUTOMOC_COMPILER_PREDEFINES
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1328


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9288c291cb56f75ad0ed8a86b0882d1998c8b79d
commit 9288c291cb56f75ad0ed8a86b0882d1998c8b79d
Merge: 90bd92a c044b9a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 2 11:57:59 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 2 07:58:08 2017 -0400

    Merge topic 'FindBoost-cmake-package'
    
    c044b9ae FindBoost: Improve messages when a Boost CMake package is found
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1330


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=90bd92ae8876cff7c2d372e752e2297411ce2d1b
commit 90bd92ae8876cff7c2d372e752e2297411ce2d1b
Merge: 1f560b0 90f1b9a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 2 11:57:24 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 2 07:57:48 2017 -0400

    Merge topic 'update-kwsys'
    
    90f1b9ad Merge branch 'upstream-KWSys' into update-kwsys
    4532b035 KWSys 2017-09-30 (f108739d)
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1333


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f560b08d4a0dea44a8fbee4c54425b6c143c404
commit 1f560b08d4a0dea44a8fbee4c54425b6c143c404
Merge: 41bf791 aa640cc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 2 11:57:11 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 2 07:57:20 2017 -0400

    Merge topic 'cuda-9-tests'
    
    aa640cc2 Tests: Fix CudaOnly.WithDefs test on CUDA 9
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1329


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=90f1b9ad4ebc882bb3f45834c8a5953ba1cee3c2
commit 90f1b9ad4ebc882bb3f45834c8a5953ba1cee3c2
Merge: 5dd75e3 4532b03
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sat Sep 30 10:07:56 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sat Sep 30 10:07:56 2017 -0400

    Merge branch 'upstream-KWSys' into update-kwsys
    
    * upstream-KWSys:
      KWSys 2017-09-30 (f108739d)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4532b0357261af903f86bc29429ae3c9413b54ab
commit 4532b0357261af903f86bc29429ae3c9413b54ab
Author:     KWSys Upstream <kwrobot at kitware.com>
AuthorDate: Sat Sep 30 10:02:42 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sat Sep 30 10:07:52 2017 -0400

    KWSys 2017-09-30 (f108739d)
    
    Code extracted from:
    
        https://gitlab.kitware.com/utils/kwsys.git
    
    at commit f108739dd90f06787a955212cf475bbbb111252d (master).
    
    Upstream Shortlog
    -----------------
    
    Brad King (1):
          41c93d97 Remove unnecessary testIOS
    
    Rolf Eike Beer (2):
          caaef6bb testSystemTools: avoid strcpy()
          a5046656 SystemTool: remove unused Convert*MacroString()

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b8ce00..21568bb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1028,7 +1028,6 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
         )
     ENDIF()
     SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS}
-      testIOS
       testSystemTools
       testCommandLineArguments
       testCommandLineArguments1
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 0a22d63..ecfa331 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -2371,104 +2371,6 @@ long int SystemTools::CreationTime(const std::string& filename)
   return ct;
 }
 
-bool SystemTools::ConvertDateMacroString(const char* str, time_t* tmt)
-{
-  if (!str || !tmt || strlen(str) > 11) {
-    return false;
-  }
-
-  struct tm tmt2;
-
-  // __DATE__
-  // The compilation date of the current source file. The date is a string
-  // literal of the form Mmm dd yyyy. The month name Mmm is the same as for
-  // dates generated by the library function asctime declared in TIME.H.
-
-  // index:   012345678901
-  // format:  Mmm dd yyyy
-  // example: Dec 19 2003
-
-  static char month_names[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
-
-  char buffer[12];
-  strcpy(buffer, str);
-
-  buffer[3] = 0;
-  char* ptr = strstr(month_names, buffer);
-  if (!ptr) {
-    return false;
-  }
-
-  int month = static_cast<int>((ptr - month_names) / 3);
-  int day = atoi(buffer + 4);
-  int year = atoi(buffer + 7);
-
-  tmt2.tm_isdst = -1;
-  tmt2.tm_hour = 0;
-  tmt2.tm_min = 0;
-  tmt2.tm_sec = 0;
-  tmt2.tm_wday = 0;
-  tmt2.tm_yday = 0;
-  tmt2.tm_mday = day;
-  tmt2.tm_mon = month;
-  tmt2.tm_year = year - 1900;
-
-  *tmt = mktime(&tmt2);
-  return true;
-}
-
-bool SystemTools::ConvertTimeStampMacroString(const char* str, time_t* tmt)
-{
-  if (!str || !tmt || strlen(str) > 26) {
-    return false;
-  }
-
-  struct tm tmt2;
-
-  // __TIMESTAMP__
-  // The date and time of the last modification of the current source file,
-  // expressed as a string literal in the form Ddd Mmm Date hh:mm:ss yyyy,
-  /// where Ddd is the abbreviated day of the week and Date is an integer
-  // from 1 to 31.
-
-  // index:   0123456789
-  //                    0123456789
-  //                              0123456789
-  // format:  Ddd Mmm Date hh:mm:ss yyyy
-  // example: Fri Dec 19 14:34:58 2003
-
-  static char month_names[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
-
-  char buffer[27];
-  strcpy(buffer, str);
-
-  buffer[7] = 0;
-  char* ptr = strstr(month_names, buffer + 4);
-  if (!ptr) {
-    return false;
-  }
-
-  int month = static_cast<int>((ptr - month_names) / 3);
-  int day = atoi(buffer + 8);
-  int hour = atoi(buffer + 11);
-  int min = atoi(buffer + 14);
-  int sec = atoi(buffer + 17);
-  int year = atoi(buffer + 20);
-
-  tmt2.tm_isdst = -1;
-  tmt2.tm_hour = hour;
-  tmt2.tm_min = min;
-  tmt2.tm_sec = sec;
-  tmt2.tm_wday = 0;
-  tmt2.tm_yday = 0;
-  tmt2.tm_mday = day;
-  tmt2.tm_mon = month;
-  tmt2.tm_year = year - 1900;
-
-  *tmt = mktime(&tmt2);
-  return true;
-}
-
 std::string SystemTools::GetLastSystemError()
 {
   int e = errno;
diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in
index 41a60d3..35bc1b1 100644
--- a/SystemTools.hxx.in
+++ b/SystemTools.hxx.in
@@ -206,13 +206,6 @@ public:
   static int Strucmp(const char* s1, const char* s2);
 
   /**
-   * Convert a string in __DATE__ or __TIMESTAMP__ format into a time_t.
-   * Return false on error, true on success
-   */
-  static bool ConvertDateMacroString(const char* str, time_t* tmt);
-  static bool ConvertTimeStampMacroString(const char* str, time_t* tmt);
-
-  /**
    * Split a string on its newlines into multiple lines
    * Return false only if the last line stored had no newline
    */
diff --git a/testIOS.cxx b/testIOS.cxx
deleted file mode 100644
index 3e4c325..0000000
--- a/testIOS.cxx
+++ /dev/null
@@ -1,139 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file Copyright.txt or https://cmake.org/licensing#kwsys for details.  */
-#include "kwsysPrivate.h"
-#include KWSYS_HEADER(Configure.hxx)
-
-#include <fstream>
-#include <iostream>
-#include <sstream>
-#include <string.h> /* strlen */
-#include <vector>
-
-// Work-around CMake dependency scanning limitation.  This must
-// duplicate the above list of headers.
-#if 0
-#include "Configure.hxx.in"
-#endif
-
-int testIOS(int, char* [])
-{
-  std::ostringstream ostr;
-  const char hello[] = "hello";
-  ostr << hello;
-  if (ostr.str() != hello) {
-    std::cerr << "failed to write hello to ostr" << std::endl;
-    return 1;
-  }
-  const char world[] = "world";
-  std::ostringstream ostr2;
-  ostr2.write(hello, strlen(hello)); /* I could do sizeof */
-  ostr2.put('\0');
-  ostr2.write(world, strlen(world));
-  if (ostr2.str().size() != strlen(hello) + 1 + strlen(world)) {
-    std::cerr << "failed to write hello to ostr2" << std::endl;
-    return 1;
-  }
-  static const unsigned char array[] = {
-    0xff, 0x4f, 0xff, 0x51, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
-    0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x01, 0x01, 0xff, 0x52, 0x00,
-    0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x04, 0x04, 0x00, 0x01, 0xff,
-    0x5c, 0x00, 0x13, 0x40, 0x40, 0x48, 0x48, 0x50, 0x48, 0x48, 0x50, 0x48,
-    0x48, 0x50, 0x48, 0x48, 0x50, 0x48, 0x48, 0x50, 0xff, 0x64, 0x00, 0x2c,
-    0x00, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79,
-    0x20, 0x49, 0x54, 0x4b, 0x2f, 0x47, 0x44, 0x43, 0x4d, 0x2f, 0x4f, 0x70,
-    0x65, 0x6e, 0x4a, 0x50, 0x45, 0x47, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69,
-    0x6f, 0x6e, 0x20, 0x31, 0x2e, 0x30, 0xff, 0x90, 0x00, 0x0a, 0x00, 0x00,
-    0x00, 0x00, 0x06, 0x2c, 0x00, 0x01, 0xff, 0x93, 0xcf, 0xb0, 0x18, 0x08,
-    0x7f, 0xc6, 0x99, 0xbf, 0xff, 0xc0, 0xf8, 0xc1, 0xc1, 0xf3, 0x05, 0x81,
-    0xf2, 0x83, 0x0a, 0xa5, 0xff, 0x10, 0x90, 0xbf, 0x2f, 0xff, 0x04, 0xa8,
-    0x7f, 0xc0, 0xf8, 0xc4, 0xc1, 0xf3, 0x09, 0x81, 0xf3, 0x0c, 0x19, 0x34
-  };
-  const size_t narray = sizeof(array); // 180
-  std::stringstream strstr;
-  strstr.write((char*)array, narray);
-  // strstr.seekp( narray / 2 ); // set position of put pointer in mid string
-  if (strstr.str().size() != narray) {
-    std::cerr << "failed to write array to strstr" << std::endl;
-    return 1;
-  }
-
-  std::istringstream istr(" 10 20 str ");
-  std::string s;
-  int x;
-  if (istr >> x) {
-    if (x != 10) {
-      std::cerr << "x != 10" << std::endl;
-      return 1;
-    }
-  } else {
-    std::cerr << "Failed to read 10 from istr" << std::endl;
-    return 1;
-  }
-  if (istr >> x) {
-    if (x != 20) {
-      std::cerr << "x != 20" << std::endl;
-      return 1;
-    }
-  } else {
-    std::cerr << "Failed to read 20 from istr" << std::endl;
-    return 1;
-  }
-  if (istr >> s) {
-    if (s != "str") {
-      std::cerr << "s != \"str\"" << std::endl;
-      return 1;
-    }
-  } else {
-    std::cerr << "Failed to read str from istr" << std::endl;
-    return 1;
-  }
-  if (istr >> s) {
-    std::cerr << "Able to read past end of stream" << std::endl;
-    return 1;
-  } else {
-    // Clear the failure.
-    istr.clear(istr.rdstate() & ~std::ios::eofbit);
-    istr.clear(istr.rdstate() & ~std::ios::failbit);
-  }
-  istr.str("30");
-  if (istr >> x) {
-    if (x != 30) {
-      std::cerr << "x != 30" << std::endl;
-      return 1;
-    }
-  } else {
-    std::cerr << "Failed to read 30 from istr" << std::endl;
-    return 1;
-  }
-
-  std::stringstream sstr;
-  sstr << "40 str2";
-  if (sstr >> x) {
-    if (x != 40) {
-      std::cerr << "x != 40" << std::endl;
-      return 1;
-    }
-  } else {
-    std::cerr << "Failed to read 40 from sstr" << std::endl;
-    return 1;
-  }
-  if (sstr >> s) {
-    if (s != "str2") {
-      std::cerr << "s != \"str2\"" << std::endl;
-      return 1;
-    }
-  } else {
-    std::cerr << "Failed to read str2 from sstr" << std::endl;
-    return 1;
-  }
-
-  // Just try to compile this.
-  if (x == 12345) {
-    std::ifstream fin("/does_not_exist", std::ios::in | std::ios::binary);
-  }
-
-  std::cout << "IOS tests passed" << std::endl;
-  return 0;
-}
diff --git a/testSystemTools.cxx b/testSystemTools.cxx
index 1871f5d..768eb4d 100644
--- a/testSystemTools.cxx
+++ b/testSystemTools.cxx
@@ -22,6 +22,7 @@
 
 #include <iostream>
 #include <sstream>
+#include <stdlib.h> /* free */
 #include <string.h> /* strcmp */
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #include <io.h> /* _umask (MSVC) / umask (Borland) */
@@ -535,15 +536,14 @@ static bool CheckStringOperations()
   }
   delete[] cres;
 
-  char* cres2 = new char[strlen("Mary Had A Little Lamb.") + 1];
-  strcpy(cres2, "Mary Had A Little Lamb.");
+  char* cres2 = strdup("Mary Had A Little Lamb.");
   kwsys::SystemTools::ReplaceChars(cres2, "aeiou", 'X');
   if (strcmp(cres2, "MXry HXd A LXttlX LXmb.")) {
     std::cerr << "Problem with ReplaceChars "
               << "\"Mary Had A Little Lamb.\"" << std::endl;
     res = false;
   }
-  delete[] cres2;
+  free(cres2);
 
   if (!kwsys::SystemTools::StringStartsWith("Mary Had A Little Lamb.",
                                             "Mary ")) {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ec30129b41ca705cb1f41df24ad1e886b527385e
commit ec30129b41ca705cb1f41df24ad1e886b527385e
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Fri Sep 29 20:46:35 2017 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Fri Sep 29 21:11:53 2017 +0200

    CPack: put local variable on the stack

diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 45c7fc6..5a173fc 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -561,8 +561,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
           cmCPackLogger(cmCPackLog::LOG_ERROR, languages[i]
                           << " is not a recognized language" << std::endl);
         }
-        char* iso_language_cstr = static_cast<char*>(malloc(65));
-        CFStringGetCString(iso_language, iso_language_cstr, 64,
+        char iso_language_cstr[65];
+        CFStringGetCString(iso_language, iso_language_cstr,
+                           sizeof(iso_language_cstr) - 1,
                            kCFStringEncodingMacRoman);
         LangCode lang = 0;
         RegionCode region = 0;
@@ -575,11 +576,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
           cmCPackLogger(cmCPackLog::LOG_ERROR,
                         "No language/region code available for "
                           << iso_language_cstr << std::endl);
-          free(iso_language_cstr);
           return 0;
         }
 #ifdef HAVE_CoreServices
-        free(iso_language_cstr);
         header_data.push_back(region);
         header_data.push_back(i);
         header_data.push_back(0);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c044b9ae8421cae4ee91399dabee31aa75f80b1c
commit c044b9ae8421cae4ee91399dabee31aa75f80b1c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 29 10:05:50 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 29 10:10:01 2017 -0400

    FindBoost: Improve messages when a Boost CMake package is found
    
    Add a test for this case to verify the messages.  This test will also be
    valuable to cover this code path in which we've had several regressions
    recently.

diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 6d1514d..88d14ab 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -245,10 +245,9 @@ if (NOT Boost_NO_BOOST_CMAKE)
   # If we found boost-cmake, then we're done.  Print out what we found.
   # Otherwise let the rest of the module try to find it.
   if (Boost_FOUND)
-    message("Boost ${Boost_FIND_VERSION} found.")
+    message(STATUS "Boost ${Boost_FIND_VERSION} found.")
     if (Boost_FIND_COMPONENTS)
-      message("Found Boost components:")
-      message("   ${Boost_FIND_COMPONENTS}")
+      message(STATUS "Found Boost components:\n   ${Boost_FIND_COMPONENTS}")
     endif()
     # Restore project's policies
     cmake_policy(POP)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 5622f8e..57cc144 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -141,6 +141,7 @@ add_RunCMake_test(DisallowedCommands)
 add_RunCMake_test(ExternalData)
 add_RunCMake_test(FeatureSummary)
 add_RunCMake_test(FPHSA)
+add_RunCMake_test(FindBoost)
 if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom")
   add_RunCMake_test(GenerateExportHeader)
 endif()
diff --git a/Tests/RunCMake/FindBoost/CMakeLists.txt b/Tests/RunCMake/FindBoost/CMakeLists.txt
new file mode 100644
index 0000000..d3137f6
--- /dev/null
+++ b/Tests/RunCMake/FindBoost/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.9)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt b/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt
new file mode 100644
index 0000000..664e4a5
--- /dev/null
+++ b/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt
@@ -0,0 +1,3 @@
+-- Boost 1\.12345 found\.
+-- Found Boost components:
+   date_time
diff --git a/Tests/RunCMake/FindBoost/CMakePackage.cmake b/Tests/RunCMake/FindBoost/CMakePackage.cmake
new file mode 100644
index 0000000..06aeccb
--- /dev/null
+++ b/Tests/RunCMake/FindBoost/CMakePackage.cmake
@@ -0,0 +1,2 @@
+set(Boost_DIR ${CMAKE_CURRENT_SOURCE_DIR}/CMakePackage)
+find_package(Boost 1.12345 COMPONENTS date_time)
diff --git a/Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake b/Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/RunCMake/FindBoost/CMakePackage/BoostConfigVersion.cmake b/Tests/RunCMake/FindBoost/CMakePackage/BoostConfigVersion.cmake
new file mode 100644
index 0000000..8176ced
--- /dev/null
+++ b/Tests/RunCMake/FindBoost/CMakePackage/BoostConfigVersion.cmake
@@ -0,0 +1,7 @@
+set(PACKAGE_VERSION 1.12345)
+if(PACKAGE_FIND_VERSION_MAJOR EQUAL 1)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+  if(PACKAGE_FIND_VERSION_MINOR EQUAL 12345)
+    set(PACKAGE_VERSION_EXACT 1)
+  endif()
+endif()
diff --git a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
new file mode 100644
index 0000000..a153ae1
--- /dev/null
+++ b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(CMakePackage)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa640cc20f55589796484737a7157469ec30623d
commit aa640cc20f55589796484737a7157469ec30623d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 29 09:53:56 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 29 09:55:11 2017 -0400

    Tests: Fix CudaOnly.WithDefs test on CUDA 9
    
    CUDA 9 dropped support for `compute_20`, so use a different alternative.

diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt
index 0bc4e5c..9b82366 100644
--- a/Tests/CudaOnly/WithDefs/CMakeLists.txt
+++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt
@@ -4,7 +4,11 @@ project (CudaOnlyWithDefs CUDA)
 
 #verify that we can pass explicit cuda arch flags
 string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-set(debug_compile_flags --generate-code arch=compute_20,code=sm_20)
+if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 9)
+  set(debug_compile_flags --generate-code arch=compute_32,code=sm_32)
+else()
+  set(debug_compile_flags --generate-code arch=compute_20,code=sm_20)
+endif()
 if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC")
   list(APPEND debug_compile_flags -Xcompiler=-WX)
 else()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6bbc1e775d46cbe1ad97ecea0862d030680b332a
commit 6bbc1e775d46cbe1ad97ecea0862d030680b332a
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Fri Sep 29 15:32:10 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Fri Sep 29 15:32:10 2017 +0200

    Autogen: Add release notes for (CMAKE_)AUTOMOC_COMPILER_PREDEFINES

diff --git a/Help/release/dev/autogen-predefs.rst b/Help/release/dev/autogen-predefs.rst
new file mode 100644
index 0000000..c390e2a
--- /dev/null
+++ b/Help/release/dev/autogen-predefs.rst
@@ -0,0 +1,11 @@
+autogen-predefs
+---------------
+
+* When using :prop_tgt:`AUTOMOC`, the new variable
+  :variable:`CMAKE_AUTOMOC_COMPILER_PREDEFINES` allows to default
+  enable or disable the generation of the compiler pre definitions file
+  ``moc_predefs.h``.
+
+* When using :prop_tgt:`AUTOMOC`, the new boolean target property
+  :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES` allows to enable or disable the
+  generation of the compiler pre definitions file ``moc_predefs.h``.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=75c98b5ef4eae201f259cf1c599fe49fc407b4d4
commit 75c98b5ef4eae201f259cf1c599fe49fc407b4d4
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Fri Sep 29 12:10:53 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Fri Sep 29 15:00:47 2017 +0200

    Autogen: Doc: Add documentation for (CMAKE_)AUTOMOC_COMPILER_PREDEFINES
    
    Also adds the documentation for CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND.
    
    Closes #17275

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 0adfff6..dd59a00 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -122,6 +122,7 @@ Properties on Targets
    /prop_tgt/ARCHIVE_OUTPUT_NAME
    /prop_tgt/AUTOGEN_BUILD_DIR
    /prop_tgt/AUTOGEN_TARGET_DEPENDS
+   /prop_tgt/AUTOMOC_COMPILER_PREDEFINES
    /prop_tgt/AUTOMOC_DEPEND_FILTERS
    /prop_tgt/AUTOMOC_MACRO_NAMES
    /prop_tgt/AUTOMOC_MOC_OPTIONS
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index cba81e5..66d3049 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -270,6 +270,7 @@ Variables that Control the Build
    /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY
    /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG
    /variable/CMAKE_AUTOMOC
+   /variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES
    /variable/CMAKE_AUTOMOC_DEPEND_FILTERS
    /variable/CMAKE_AUTOMOC_MACRO_NAMES
    /variable/CMAKE_AUTOMOC_MOC_OPTIONS
@@ -398,6 +399,7 @@ Variables for Languages
    /variable/CMAKE_LANG_COMPILER_LOADED
    /variable/CMAKE_LANG_COMPILER_TARGET
    /variable/CMAKE_LANG_COMPILER_VERSION
+   /variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND
    /variable/CMAKE_LANG_COMPILE_OBJECT
    /variable/CMAKE_LANG_CREATE_SHARED_LIBRARY
    /variable/CMAKE_LANG_CREATE_SHARED_MODULE
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index 641ac09..9e5261f 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -76,6 +76,9 @@ Additional macro names to search for can be added to :prop_tgt:`AUTOMOC_MACRO_NA
 Additional ``moc`` dependency file names can be extracted from source code
 by using :prop_tgt:`AUTOMOC_DEPEND_FILTERS`.
 
+Compiler pre definitions for ``moc`` are written to a ``moc_predefs.h`` file
+which is controlled by :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES`.
+
 Source C++ files can be excluded from :prop_tgt:`AUTOMOC` processing by
 enabling :prop_sf:`SKIP_AUTOMOC` or the broader :prop_sf:`SKIP_AUTOGEN`.
 
diff --git a/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst b/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst
new file mode 100644
index 0000000..57a647f
--- /dev/null
+++ b/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst
@@ -0,0 +1,24 @@
+AUTOMOC_COMPILER_PREDEFINES
+---------------------------
+
+Boolean value used by :prop_tgt:`AUTOMOC` to determine if the
+compiler pre definitions file ``moc_predefs.h`` should be generated.
+
+CMake generates a ``moc_predefs.h`` file with compiler pre definitions
+from the output of the command defined in
+:variable:`CMAKE_CXX_COMPILER_PREDEFINES_COMMAND <CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND>`
+when
+
+- :prop_tgt:`AUTOMOC` is enabled,
+- :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES` is enabled,
+- :variable:`CMAKE_CXX_COMPILER_PREDEFINES_COMMAND <CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND>` isn't empty and
+- the Qt version is greater or equal 5.8.
+
+The ``moc_predefs.h`` file, which is generated in :prop_tgt:`AUTOGEN_BUILD_DIR`,
+is passed to ``moc`` as the argument to the ``--include`` option.
+
+By default :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES` is initialized from
+:variable:`CMAKE_AUTOMOC_COMPILER_PREDEFINES`, which is ON by default.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst b/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst
new file mode 100644
index 0000000..7e1c53d
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst
@@ -0,0 +1,8 @@
+CMAKE_AUTOMOC_COMPILER_PREDEFINES
+---------------------------------
+
+This variable is used to initialize the :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES`
+property on all the targets. See that target property for additional
+information.
+
+By default it is ON.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst b/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst
new file mode 100644
index 0000000..e050f43
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst
@@ -0,0 +1,8 @@
+CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND
+----------------------------------------
+
+Command that outputs the compiler pre definitions.
+
+See :prop_tgt:`AUTOMOC` which uses
+:variable:`CMAKE_CXX_COMPILER_PREDEFINES_COMMAND <CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND>`
+to generate the :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES`.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1d7f099d9cf489872a70b7616ff644cd4a91a7ae
commit 1d7f099d9cf489872a70b7616ff644cd4a91a7ae
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Fri Sep 29 10:31:22 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Fri Sep 29 15:00:47 2017 +0200

    Autogen: Add (CMAKE_)AUTOMOC_COMPILER_PREDEFINES

diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 3951b2c..324a279 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -23,6 +23,7 @@ set(CMAKE_DL_LIBS "dl")
 
 set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
 set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
+set(CMAKE_AUTOMOC_COMPILER_PREDEFINES ON)
 set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_NAMESPACE")
 
 # basically all general purpose OSs support shared libs
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index c6f0a51..217865b 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -363,11 +363,14 @@ static void SetupAutoTargetMoc(cmQtAutoGenDigest const& digest,
   AddDefinitionEscaped(makefile, "_moc_depend_filters",
                        GetSafeProperty(target, "AUTOMOC_DEPEND_FILTERS"));
 
-  if (QtVersionGreaterOrEqual(digest.QtVersionMajor, digest.QtVersionMinor, 5,
-                              8)) {
-    AddDefinitionEscaped(
-      makefile, "_moc_predefs_cmd",
-      makefile->GetSafeDefinition("CMAKE_CXX_COMPILER_PREDEFINES_COMMAND"));
+  // Compiler predefines
+  if (target->GetPropertyAsBool("AUTOMOC_COMPILER_PREDEFINES")) {
+    if (QtVersionGreaterOrEqual(digest.QtVersionMajor, digest.QtVersionMinor,
+                                5, 8)) {
+      AddDefinitionEscaped(
+        makefile, "_moc_predefs_cmd",
+        makefile->GetSafeDefinition("CMAKE_CXX_COMPILER_PREDEFINES_COMMAND"));
+    }
   }
   // Moc includes and compile definitions
   {
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 49b0664..7a3cc76 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -244,6 +244,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
     this->SetPropertyDefault("AUTOMOC", nullptr);
     this->SetPropertyDefault("AUTOUIC", nullptr);
     this->SetPropertyDefault("AUTORCC", nullptr);
+    this->SetPropertyDefault("AUTOMOC_COMPILER_PREDEFINES", nullptr);
     this->SetPropertyDefault("AUTOMOC_DEPEND_FILTERS", nullptr);
     this->SetPropertyDefault("AUTOMOC_MACRO_NAMES", nullptr);
     this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", nullptr);

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

Summary of changes:
 Help/manual/cmake-properties.7.rst                 |    1 +
 Help/manual/cmake-variables.7.rst                  |    2 +
 Help/prop_tgt/AUTOMOC.rst                          |    3 +
 Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst      |   24 ++++
 Help/release/dev/autogen-predefs.rst               |   11 ++
 .../variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst |    8 ++
 .../CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst     |    8 ++
 Modules/CMakeGenericSystem.cmake                   |    1 +
 Modules/FindBoost.cmake                            |    5 +-
 Source/CPack/cmCPackDragNDropGenerator.cxx         |    7 +-
 Source/cmQtAutoGeneratorInitializer.cxx            |   13 +-
 Source/cmTarget.cxx                                |    1 +
 Source/kwsys/CMakeLists.txt                        |    1 -
 Source/kwsys/SystemTools.cxx                       |   98 --------------
 Source/kwsys/SystemTools.hxx.in                    |    7 -
 Source/kwsys/testIOS.cxx                           |  139 --------------------
 Source/kwsys/testSystemTools.cxx                   |    6 +-
 Tests/CudaOnly/WithDefs/CMakeLists.txt             |    6 +-
 Tests/RunCMake/CMakeLists.txt                      |    1 +
 .../{include_guard => FindBoost}/CMakeLists.txt    |    0
 Tests/RunCMake/FindBoost/CMakePackage-stdout.txt   |    3 +
 Tests/RunCMake/FindBoost/CMakePackage.cmake        |    2 +
 .../FindBoost/CMakePackage/BoostConfig.cmake       |    0
 .../CMakePackage/BoostConfigVersion.cmake          |    7 +
 Tests/RunCMake/FindBoost/RunCMakeTest.cmake        |    3 +
 25 files changed, 96 insertions(+), 261 deletions(-)
 create mode 100644 Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst
 create mode 100644 Help/release/dev/autogen-predefs.rst
 create mode 100644 Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst
 create mode 100644 Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst
 delete mode 100644 Source/kwsys/testIOS.cxx
 copy Tests/RunCMake/{include_guard => FindBoost}/CMakeLists.txt (100%)
 create mode 100644 Tests/RunCMake/FindBoost/CMakePackage-stdout.txt
 create mode 100644 Tests/RunCMake/FindBoost/CMakePackage.cmake
 copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake (100%)
 create mode 100644 Tests/RunCMake/FindBoost/CMakePackage/BoostConfigVersion.cmake
 create mode 100644 Tests/RunCMake/FindBoost/RunCMakeTest.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list