[Cmake-commits] CMake branch, master, updated. v3.10.0-608-gbd10c3c

Kitware Robot kwrobot at kitware.com
Tue Dec 12 08:05:07 EST 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  bd10c3cf82f6e9d58b121498eaa2b9d8cc19dd2f (commit)
       via  77aab3e5155995fc224a1f81d241448de093cfe4 (commit)
       via  57199deafaca949e0588556ebf78bb9437e31365 (commit)
       via  1f5b2a8de93dc828d0cdc650478999133273c2c7 (commit)
       via  e2303b257c0453033571ec20a767e9ab22308e8b (commit)
       via  e4707048c01b28858237a21e614da56a696e9771 (commit)
       via  ba6caafa42afb7fa2c7d8d0d49c73d79efee1e9c (commit)
       via  adf491379549fbee522793ffda9a5d153cc9c3bb (commit)
       via  548e8f6ffedb57fcdee56633ba454ae0ddf38983 (commit)
       via  de0035fdcccb4c8acc92bf1db0a76b3c1f18003f (commit)
       via  687a26b7023748cc98317eae53ee2ac3cc520bda (commit)
       via  e770b1b86e7157db4191096f226a8b0175819cff (commit)
      from  62d8bff146b28c10c11ad7ef8114f8d06f2fcad8 (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=bd10c3cf82f6e9d58b121498eaa2b9d8cc19dd2f
commit bd10c3cf82f6e9d58b121498eaa2b9d8cc19dd2f
Merge: 77aab3e e2303b2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 12 08:04:19 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Dec 12 08:04:19 2017 -0500

    Merge branch 'release-3.10'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77aab3e5155995fc224a1f81d241448de093cfe4
commit 77aab3e5155995fc224a1f81d241448de093cfe4
Merge: 57199de adf4913
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 12 13:03:52 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Dec 12 08:03:57 2017 -0500

    Merge topic 'FindPkgConfig_doc_cleanup'
    
    adf49137 FindPkgConfig: Cleanup docs
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1584


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57199deafaca949e0588556ebf78bb9437e31365
commit 57199deafaca949e0588556ebf78bb9437e31365
Merge: 1f5b2a8 e470704
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 12 13:02:50 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Dec 12 08:02:55 2017 -0500

    Merge topic 'fix-iar-binutils-for-cxx'
    
    e4707048 IAR: FindBinUtils should work for CXX as well as C
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1572


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f5b2a8de93dc828d0cdc650478999133273c2c7
commit 1f5b2a8de93dc828d0cdc650478999133273c2c7
Merge: 62d8bff ba6caaf
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 12 13:02:25 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Dec 12 08:02:33 2017 -0500

    Merge topic 'fix-ctest-chrono'
    
    ba6caafa CTest: Use integer-representable value for "infinite" timeout
    548e8f6f CTest: Simplify std::chrono::duration<double> conversion to double
    de0035fd cmCTestBuildAndTestHandler: Convert timeout to std::chrono::duration
    687a26b7 CTest: Fix regression in build-and-test timeout forwarding
    e770b1b8 CTest: Fix regression in build-and-test timeout compuatation
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Acked-by: dublet <github at dublet.org>
    Merge-request: !1574


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ba6caafa42afb7fa2c7d8d0d49c73d79efee1e9c
commit ba6caafa42afb7fa2c7d8d0d49c73d79efee1e9c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Dec 11 10:40:29 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Dec 11 10:41:48 2017 -0500

    CTest: Use integer-representable value for "infinite" timeout
    
    Refactoring in commit 66419bc046 (CTest: convert timeouts to
    std::chrono::duration, 2017-11-20) changed out "infinite" timeout to a
    value not representable by a 64-bit integer.  This causes undefined
    behavior when e.g. KWSys Process converts the duration to a `long` to
    interact with system APIs.  Use the old `1.0e7` maximum value.

diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index c76eb4e..dcb17d0 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -1,9 +1,5 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifdef _WIN32
-/* windows.h defines min() and max() macros that interfere. */
-#define NOMINMAX
-#endif
 #include "cmCTestRunTest.h"
 
 #include "cmCTest.h"
@@ -678,7 +674,7 @@ bool cmCTestRunTest::ForkProcess(std::chrono::duration<double> testTimeOut,
   // determine how much time we have
   std::chrono::duration<double> timeout =
     this->CTest->GetRemainingTimeAllowed();
-  if (timeout != std::chrono::duration<double>::max()) {
+  if (timeout != cmCTest::MaxDuration()) {
     timeout -= std::chrono::minutes(2);
   }
   if (this->CTest->GetTimeOut() > std::chrono::duration<double>::zero() &&
@@ -702,7 +698,7 @@ bool cmCTestRunTest::ForkProcess(std::chrono::duration<double> testTimeOut,
     this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index
       << ": "
       << "Test timeout computed to be: "
-      << (timeout == std::chrono::duration<double>::max()
+      << (timeout == cmCTest::MaxDuration()
             ? std::string("infinite")
             : std::to_string(
                 std::chrono::duration_cast<std::chrono::seconds>(timeout)
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 922f5c7..716ea10 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -1,12 +1,5 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-
-#ifdef _WIN32
-/* windows.h defines min() and max() macros, unless told to otherwise. This
- * interferes with std::min() and std::max() at the very least. */
-#define NOMINMAX
-#endif
-
 #include "cmCTestScriptHandler.h"
 
 #include "cmsys/Directory.hxx"
@@ -970,13 +963,13 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce(
 std::chrono::duration<double> cmCTestScriptHandler::GetRemainingTimeAllowed()
 {
   if (!this->Makefile) {
-    return std::chrono::duration<double>::max();
+    return cmCTest::MaxDuration();
   }
 
   const char* timelimitS = this->Makefile->GetDefinition("CTEST_TIME_LIMIT");
 
   if (!timelimitS) {
-    return std::chrono::duration<double>::max();
+    return cmCTest::MaxDuration();
   }
 
   auto timelimit = std::chrono::duration<double>(atof(timelimitS));
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 902f1ae..e48f64a 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1,11 +1,5 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifdef _WIN32
-/* windows.h defines min() and max() macros by default. This interferes with
- * C++ functions names.
- */
-#define NOMINMAX
-#endif
 #include "cmCTest.h"
 
 #include "cm_curl.h"
@@ -1089,7 +1083,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
 
   // determine how much time we have
   std::chrono::duration<double> timeout = this->GetRemainingTimeAllowed();
-  if (timeout != std::chrono::duration<double>::max()) {
+  if (timeout != cmCTest::MaxDuration()) {
     timeout -= std::chrono::minutes(2);
   }
   if (this->TimeOut > std::chrono::duration<double>::zero() &&
@@ -1107,7 +1101,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
   }
   cmCTestLog(
     this, HANDLER_VERBOSE_OUTPUT, "Test timeout computed to be: "
-      << (timeout == std::chrono::duration<double>::max()
+      << (timeout == cmCTest::MaxDuration()
             ? std::string("infinite")
             : std::to_string(
                 std::chrono::duration_cast<std::chrono::seconds>(timeout)
@@ -1130,7 +1124,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
         // invocations. Since --build-generator is required this is a
         // good place to check for it, and to add the arguments in
         if (strcmp(i, "--build-generator") == 0 &&
-            timeout != std::chrono::duration<double>::max() &&
+            timeout != cmCTest::MaxDuration() &&
             timeout > std::chrono::duration<double>::zero()) {
           args.push_back("--test-timeout");
           std::ostringstream msg;
@@ -2805,7 +2799,7 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg,
 std::chrono::duration<double> cmCTest::GetRemainingTimeAllowed()
 {
   if (!this->GetHandler("script")) {
-    return std::chrono::duration<double>::max();
+    return cmCTest::MaxDuration();
   }
 
   cmCTestScriptHandler* ch =
@@ -2814,6 +2808,11 @@ std::chrono::duration<double> cmCTest::GetRemainingTimeAllowed()
   return ch->GetRemainingTimeAllowed();
 }
 
+std::chrono::duration<double> cmCTest::MaxDuration()
+{
+  return std::chrono::duration<double>(1.0e7);
+}
+
 void cmCTest::OutputTestErrors(std::vector<char> const& process_output)
 {
   std::string test_outputs("\n*** Test Failed:\n");
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index ba94866..418d576 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -208,6 +208,8 @@ public:
    */
   std::chrono::duration<double> GetRemainingTimeAllowed();
 
+  static std::chrono::duration<double> MaxDuration();
+
   /**
    * Open file in the output directory and set the stream
    */

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=adf491379549fbee522793ffda9a5d153cc9c3bb
commit adf491379549fbee522793ffda9a5d153cc9c3bb
Author:     Craig Scott <craig.scott at crascit.com>
AuthorDate: Sun Dec 10 22:50:39 2017 +1100
Commit:     Craig Scott <craig.scott at crascit.com>
CommitDate: Sun Dec 10 22:50:39 2017 +1100

    FindPkgConfig: Cleanup docs
    
    - Moved block of misplaced comments to correct section
    - Improved grammar, readability and consistency
    - Updated to conform to style guidelines

diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 76afa8a..aad3b74 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -1,19 +1,22 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindPkgConfig
-# -------------
-#
-# A `pkg-config` module for CMake.
-#
-# Finds the ``pkg-config`` executable and add the
-# :command:`pkg_check_modules` and :command:`pkg_search_module`
-# commands.
-#
-# In order to find the ``pkg-config`` executable, it uses the
-# :variable:`PKG_CONFIG_EXECUTABLE` variable or the ``PKG_CONFIG``
-# environment variable first.
+#[========================================[.rst:
+FindPkgConfig
+-------------
+
+A ``pkg-config`` module for CMake.
+
+Finds the ``pkg-config`` executable and adds the :command:`pkg_get_variable`,
+:command:`pkg_check_modules` and :command:`pkg_search_module` commands. The
+following variables will also be set::
+
+  PKG_CONFIG_FOUND          ... if pkg-config executable was found
+  PKG_CONFIG_EXECUTABLE     ... pathname of the pkg-config program
+  PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
+                                (since CMake 2.8.8)
+
+#]========================================]
 
 ### Common stuff ####
 set(PKG_CONFIG_VERSION 1)
@@ -82,12 +85,13 @@ endmacro()
 #[========================================[.rst:
 .. command:: pkg_get_variable
 
-  Retrieves the value of a variable from a package::
+  Retrieves the value of a pkg-config variable ``varName`` and stores it in the
+  result variable ``resultVar`` in the calling scope. ::
 
-    pkg_get_variable(<RESULT> <MODULE> <VARIABLE>)
+    pkg_get_variable(<resultVar> <moduleName> <varName>)
 
-  If multiple values are returned variable will contain a
-  :ref:`;-list <CMake Language Lists>`.
+  If ``pkg-config`` returns multiple values for the specified variable,
+  ``resultVar`` will contain a :ref:`;-list <CMake Language Lists>`.
 
   For example:
 
@@ -472,117 +476,106 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
   endif()
 endmacro()
 
-###
-### User visible macros start here
-###
 
 #[========================================[.rst:
 .. command:: pkg_check_modules
 
- Checks for all the given modules. ::
+  Checks for all the given modules, setting a variety of result variables in
+  the calling scope. ::
 
-    pkg_check_modules(<PREFIX> [REQUIRED] [QUIET]
-                      [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
+    pkg_check_modules(<prefix>
+                      [REQUIRED] [QUIET]
+                      [NO_CMAKE_PATH]
+                      [NO_CMAKE_ENVIRONMENT_PATH]
                       [IMPORTED_TARGET]
-                      <MODULE> [<MODULE>]*)
-
-
- When the ``REQUIRED`` argument was set, macros will fail with an error
- when module(s) could not be found.
-
- When the ``QUIET`` argument is set, no status messages will be printed.
-
- By default, if :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or
- later, or if :variable:`PKG_CONFIG_USE_CMAKE_PREFIX_PATH` is set, the
- :variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_FRAMEWORK_PATH`, and
- :variable:`CMAKE_APPBUNDLE_PATH` cache and environment variables will
- be added to ``pkg-config`` search path.
- The ``NO_CMAKE_PATH`` and ``NO_CMAKE_ENVIRONMENT_PATH`` arguments
- disable this behavior for the cache variables and the environment
- variables, respectively.
- The ``IMPORTED_TARGET`` argument will create an imported target named
- PkgConfig::<PREFIX>> that can be passed directly as an argument to
- :command:`target_link_libraries`.
-
- It sets the following variables: ::
-
-    PKG_CONFIG_FOUND          ... if pkg-config executable was found
-    PKG_CONFIG_EXECUTABLE     ... pathname of the pkg-config program
-    PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
-                                  (since CMake 2.8.8)
-
- For the following variables two sets of values exist; first one is the
- common one and has the given PREFIX.  The second set contains flags
- which are given out when ``pkg-config`` was called with the ``--static``
- option. ::
-
-    <XPREFIX>_FOUND          ... set to 1 if module(s) exist
-    <XPREFIX>_LIBRARIES      ... only the libraries (w/o the '-l')
-    <XPREFIX>_LIBRARY_DIRS   ... the paths of the libraries (w/o the '-L')
-    <XPREFIX>_LDFLAGS        ... all required linker flags
-    <XPREFIX>_LDFLAGS_OTHER  ... all other linker flags
-    <XPREFIX>_INCLUDE_DIRS   ... the '-I' preprocessor flags (w/o the '-I')
-    <XPREFIX>_CFLAGS         ... all required cflags
-    <XPREFIX>_CFLAGS_OTHER   ... the other compiler flags
+                      <moduleSpec> [<moduleSpec>...])
+
+  When the ``REQUIRED`` argument is given, the command will fail with an error
+  if module(s) could not be found.
+
+  When the ``QUIET`` argument is given, no status messages will be printed.
+
+  By default, if :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or
+  later, or if :variable:`PKG_CONFIG_USE_CMAKE_PREFIX_PATH` is set to a
+  boolean ``True`` value, then the :variable:`CMAKE_PREFIX_PATH`,
+  :variable:`CMAKE_FRAMEWORK_PATH`, and :variable:`CMAKE_APPBUNDLE_PATH` cache
+  and environment variables will be added to the ``pkg-config`` search path.
+  The ``NO_CMAKE_PATH`` and ``NO_CMAKE_ENVIRONMENT_PATH`` arguments
+  disable this behavior for the cache variables and environment variables
+  respectively.
+
+  The ``IMPORTED_TARGET`` argument will create an imported target named
+  ``PkgConfig::<prefix>`` that can be passed directly as an argument to
+  :command:`target_link_libraries`.
+
+  Each ``<moduleSpec>`` must be in one of the following formats::
+
+    {moduleName}            ... matches any version
+    {moduleName}>={version} ... at least version <version> is required
+    {moduleName}={version}  ... exactly version <version> is required
+    {moduleName}<={version} ... modules must not be newer than <version>
+
+  The following variables may be set upon return.  Two sets of values exist,
+  one for the common case (``<XXX> = <prefix>``) and another for the
+  information ``pkg-config`` provides when it is called with the ``--static``
+  option (``<XXX> = <prefix>_STATIC``)::
+
+    <XXX>_FOUND          ... set to 1 if module(s) exist
+    <XXX>_LIBRARIES      ... only the libraries (without the '-l')
+    <XXX>_LIBRARY_DIRS   ... the paths of the libraries (without the '-L')
+    <XXX>_LDFLAGS        ... all required linker flags
+    <XXX>_LDFLAGS_OTHER  ... all other linker flags
+    <XXX>_INCLUDE_DIRS   ... the '-I' preprocessor flags (without the '-I')
+    <XXX>_CFLAGS         ... all required cflags
+    <XXX>_CFLAGS_OTHER   ... the other compiler flags
+
+  All but ``<XXX>_FOUND`` may be a :ref:`;-list <CMake Language Lists>` if the
+  associated variable returned from ``pkg-config`` has multiple values.
+
+  There are some special variables whose prefix depends on the number of
+  ``<moduleSpec>`` given.  When there is only one ``<moduleSpec>``,
+  ``<YYY>`` will simply be ``<prefix>``, but if two or more ``<moduleSpec>``
+  items are given, ``<YYY>`` will be ``<prefix>_<moduleName>``::
+
+    <YYY>_VERSION    ... version of the module
+    <YYY>_PREFIX     ... prefix directory of the module
+    <YYY>_INCLUDEDIR ... include directory of the module
+    <YYY>_LIBDIR     ... lib directory of the module
+
+  Examples
 
- ::
-
-    <XPREFIX> = <PREFIX>        for common case
-    <XPREFIX> = <PREFIX>_STATIC for static linking
-
- Every variable containing multiple values will be a
- :ref:`;-list <CMake Language Lists>`.
-
- There are some special variables whose prefix depends on the count of
- given modules.  When there is only one module, <PREFIX> stays
- unchanged.  When there are multiple modules, the prefix will be
- changed to <PREFIX>_<MODNAME>: ::
-
-    <XPREFIX>_VERSION    ... version of the module
-    <XPREFIX>_PREFIX     ... prefix-directory of the module
-    <XPREFIX>_INCLUDEDIR ... include-dir of the module
-    <XPREFIX>_LIBDIR     ... lib-dir of the module
-
- ::
-
-    <XPREFIX> = <PREFIX>  when |MODULES| == 1, else
-    <XPREFIX> = <PREFIX>_<MODNAME>
-
- A <MODULE> parameter can have the following formats: ::
-
-    {MODNAME}            ... matches any version
-    {MODNAME}>={VERSION} ... at least version <VERSION> is required
-    {MODNAME}={VERSION}  ... exactly version <VERSION> is required
-    {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
-
- Examples
+  .. code-block:: cmake
 
- .. code-block:: cmake
+    pkg_check_modules (GLIB2 glib-2.0)
 
-    pkg_check_modules (GLIB2   glib-2.0)
+  Looks for any version of glib2.  If found, the output variable
+  ``GLIB2_VERSION`` will hold the actual version found.
 
- .. code-block:: cmake
+  .. code-block:: cmake
 
-    pkg_check_modules (GLIB2   glib-2.0>=2.10)
+    pkg_check_modules (GLIB2 glib-2.0>=2.10)
 
- Requires at least version 2.10 of glib2 and defines e.g.
- ``GLIB2_VERSION=2.10.3``
+  Looks for at least version 2.10 of glib2.  If found, the output variable
+  ``GLIB2_VERSION`` will hold the actual version found.
 
- .. code-block:: cmake
+  .. code-block:: cmake
 
-    pkg_check_modules (FOO     glib-2.0>=2.10 gtk+-2.0)
+    pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0)
 
- Requires both glib2 and gtk2, and defines e.g.
- ``FOO_glib-2.0_VERSION=2.10.3`` and ``FOO_gtk+-2.0_VERSION=2.8.20``
+  Looks for both glib2-2.0 (at least version 2.10) and any version of
+  gtk2+-2.0.  Only if both are found will ``FOO`` be considered found.
+  The ``FOO_glib-2.0_VERSION`` and ``FOO_gtk+-2.0_VERSION`` variables will be
+  set to their respective found module versions.
 
- .. code-block:: cmake
+  .. code-block:: cmake
 
     pkg_check_modules (XRENDER REQUIRED xrender)
 
- Defines for example::
+  Requires any version of ``xrender``.  Example output variables set by a
+  successful call::
 
-   XRENDER_LIBRARIES=Xrender;X11``
-   XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
+    XRENDER_LIBRARIES=Xrender;X11
+    XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
 #]========================================]
 macro(pkg_check_modules _prefix _module0)
   _pkgconfig_parse_options(_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target "${_module0}" ${ARGN})
@@ -605,19 +598,22 @@ endmacro()
 #[========================================[.rst:
 .. command:: pkg_search_module
 
- Same as :command:`pkg_check_modules`, but instead it checks for given
- modules and uses the first working one. ::
+  The behavior of this command is the same as :command:`pkg_check_modules`,
+  except that rather than checking for all the specified modules, it searches
+  for just the first successful match. ::
 
-    pkg_search_module(<PREFIX> [REQUIRED] [QUIET]
-                      [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
+    pkg_search_module(<prefix>
+                      [REQUIRED] [QUIET]
+                      [NO_CMAKE_PATH]
+                      [NO_CMAKE_ENVIRONMENT_PATH]
                       [IMPORTED_TARGET]
-                      <MODULE> [<MODULE>]*)
+                      <moduleSpec> [<moduleSpec>...])
 
- Examples
+  Examples
 
- .. code-block:: cmake
+  .. code-block:: cmake
 
-    pkg_search_module (BAR     libxml-2.0 libxml2 libxml>=2)
+    pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2)
 #]========================================]
 macro(pkg_search_module _prefix _module0)
   _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target "${_module0}" ${ARGN})
@@ -654,21 +650,26 @@ endmacro()
 
 
 #[========================================[.rst:
-.. variable:: PKG_CONFIG_EXECUTABLE
+Variables Affecting Behavior
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
- Path to the pkg-config executable.
+.. variable:: PKG_CONFIG_EXECUTABLE
 
+  This can be set to the path of the pkg-config executable.  If not provided,
+  it will be set by the module as a result of calling :command:`find_program`
+  internally.  The ``PKG_CONFIG`` environment variable can be used as a hint.
 
 .. variable:: PKG_CONFIG_USE_CMAKE_PREFIX_PATH
 
- Whether :command:`pkg_check_modules` and :command:`pkg_search_module`
- should add the paths in :variable:`CMAKE_PREFIX_PATH`,
- :variable:`CMAKE_FRAMEWORK_PATH`, and :variable:`CMAKE_APPBUNDLE_PATH`
- cache and environment variables to ``pkg-config`` search path.
+  Specifies whether :command:`pkg_check_modules` and
+  :command:`pkg_search_module` should add the paths in the
+  :variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_FRAMEWORK_PATH` and
+  :variable:`CMAKE_APPBUNDLE_PATH` cache and environment variables to the
+  ``pkg-config`` search path.
 
- If this variable is not set, this behavior is enabled by default if
- :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or later, disabled
- otherwise.
+  If this variable is not set, this behavior is enabled by default if
+  :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or later, disabled
+  otherwise.
 #]========================================]
 
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=548e8f6ffedb57fcdee56633ba454ae0ddf38983
commit 548e8f6ffedb57fcdee56633ba454ae0ddf38983
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 8 08:22:15 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 8 11:09:49 2017 -0500

    CTest: Simplify std::chrono::duration<double> conversion to double
    
    The ratio of ticks to seconds for this type is 1, so we can just use its
    `count()` directly.  This also avoids converting through the integer
    representation of `std::chrono::milliseconds`, which has a much smaller
    allowed range.
    
    Drop our `cmsysProcess_SetTimeout` wrapper as it is now very thin.

diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 39b90d8..2a9fd72 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -11,7 +11,6 @@
 #include "cmParseGTMCoverage.h"
 #include "cmParseJacocoCoverage.h"
 #include "cmParsePHPCoverage.h"
-#include "cmProcess.h"
 #include "cmSystemTools.h"
 #include "cmWorkingDirectory.h"
 #include "cmXMLWriter.h"
@@ -81,7 +80,7 @@ public:
 
     cmsysProcess_SetOption(this->Process, cmsysProcess_Option_HideWindow, 1);
     if (this->TimeOut >= std::chrono::duration<double>::zero()) {
-      cmsysProcess_SetTimeout(this->Process, this->TimeOut);
+      cmsysProcess_SetTimeout(this->Process, this->TimeOut.count());
     }
     cmsysProcess_Execute(this->Process);
     this->PipeState = cmsysProcess_GetState(this->Process);
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index a075649..c76eb4e 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -265,11 +265,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
 
   passed = this->TestResult.Status == cmCTestTestHandler::COMPLETED;
   char buf[1024];
-  sprintf(buf, "%6.2f sec",
-          double(std::chrono::duration_cast<std::chrono::milliseconds>(
-                   this->TestProcess->GetTotalTime())
-                   .count()) /
-            1000.0);
+  sprintf(buf, "%6.2f sec", this->TestProcess->GetTotalTime().count());
   cmCTestLog(this->CTest, HANDLER_OUTPUT, buf << "\n");
 
   if (outputTestErrorsToConsole) {
@@ -394,11 +390,7 @@ void cmCTestRunTest::ComputeWeightedCost()
 {
   double prev = static_cast<double>(this->TestProperties->PreviousRuns);
   double avgcost = static_cast<double>(this->TestProperties->Cost);
-  double current =
-    double(std::chrono::duration_cast<std::chrono::milliseconds>(
-             this->TestResult.ExecutionTime)
-             .count()) /
-    1000.0;
+  double current = this->TestResult.ExecutionTime.count();
 
   if (this->TestResult.Status == cmCTestTestHandler::COMPLETED) {
     this->TestProperties->Cost =
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 1e15cc5..e5a0503 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -540,10 +540,8 @@ int cmCTestTestHandler::ProcessHandler()
       this->PrintLabelOrSubprojectSummary(false);
     }
     char realBuf[1024];
-    auto durationInMs = std::chrono::duration_cast<std::chrono::milliseconds>(
-                          clock_finish - clock_start)
-                          .count();
-    sprintf(realBuf, "%6.2f sec", static_cast<double>(durationInMs) / 1000.0);
+    std::chrono::duration<double> durationInSecs = clock_finish - clock_start;
+    sprintf(realBuf, "%6.2f sec", durationInSecs.count());
     cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
                        "\nTotal Test time (real) = " << realBuf << "\n",
                        this->Quiet);
@@ -654,10 +652,7 @@ void cmCTestTestHandler::PrintLabelOrSubprojectSummary(bool doSubProject)
       // only use labels found in labels
       if (labels.find(l) != labels.end()) {
         labelTimes[l] +=
-          double(std::chrono::duration_cast<std::chrono::milliseconds>(
-                   result.ExecutionTime)
-                   .count()) /
-          1000.0 * result.Properties->Processors;
+          result.ExecutionTime.count() * result.Properties->Processors;
         ++labelCounts[l];
       }
     }
@@ -1327,11 +1322,7 @@ void cmCTestTestHandler::GenerateDartOutput(cmXMLWriter& xml)
       xml.StartElement("NamedMeasurement");
       xml.Attribute("type", "numeric/double");
       xml.Attribute("name", "Execution Time");
-      xml.Element("Value",
-                  double(std::chrono::duration_cast<std::chrono::milliseconds>(
-                           result.ExecutionTime)
-                           .count()) /
-                    1000.0);
+      xml.Element("Value", result.ExecutionTime.count());
       xml.EndElement(); // NamedMeasurement
       if (!result.Reason.empty()) {
         const char* reasonType = "Pass Reason";
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 69ffb33..0db66c3 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -5,16 +5,6 @@
 #include "cmProcessOutput.h"
 #include <iostream>
 
-void cmsysProcess_SetTimeout(cmsysProcess* process,
-                             std::chrono::duration<double> timeout)
-{
-  cmsysProcess_SetTimeout(
-    process,
-    double(
-      std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count()) /
-      1000.0);
-};
-
 cmProcess::cmProcess()
 {
   this->Process = nullptr;
@@ -59,7 +49,7 @@ bool cmProcess::StartProcess()
     cmsysProcess_SetWorkingDirectory(this->Process,
                                      this->WorkingDirectory.c_str());
   }
-  cmsysProcess_SetTimeout(this->Process, this->Timeout);
+  cmsysProcess_SetTimeout(this->Process, this->Timeout.count());
   cmsysProcess_SetOption(this->Process, cmsysProcess_Option_MergeOutput, 1);
   cmsysProcess_Execute(this->Process);
   return (cmsysProcess_GetState(this->Process) ==
@@ -115,10 +105,7 @@ int cmProcess::GetNextOutputLine(std::string& line,
 {
   cmProcessOutput processOutput(cmProcessOutput::UTF8);
   std::string strdata;
-  double waitTimeout =
-    double(
-      std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count()) /
-    1000.0;
+  double waitTimeout = timeout.count();
   for (;;) {
     // Look for lines already buffered.
     if (this->Output.GetLine(line)) {
@@ -240,7 +227,7 @@ int cmProcess::ReportStatus()
 void cmProcess::ChangeTimeout(std::chrono::duration<double> t)
 {
   this->Timeout = t;
-  cmsysProcess_SetTimeout(this->Process, this->Timeout);
+  cmsysProcess_SetTimeout(this->Process, this->Timeout.count());
 }
 
 void cmProcess::ResetStartTime()
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index cbb611d..f3b0bd7 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -10,13 +10,6 @@
 #include <string>
 #include <vector>
 
-/*
- * A wrapper function for cmsysProcess_SetTimeout that takes an
- * std::chrono::duration. For convenience only.
- */
-void cmsysProcess_SetTimeout(cmsysProcess* process,
-                             std::chrono::duration<double> timeout);
-
 /** \class cmProcess
  * \brief run a process with c++
  *
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index ed45644..902f1ae 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -50,7 +50,6 @@
 #include "cmGeneratedFileStream.h"
 #include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
-#include "cmProcess.h"
 #include "cmProcessOutput.h"
 #include "cmState.h"
 #include "cmStateSnapshot.h"
@@ -998,7 +997,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
   cmsysProcess_SetCommand(cp, &*argv.begin());
   cmsysProcess_SetWorkingDirectory(cp, dir);
   cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
-  cmsysProcess_SetTimeout(cp, timeout);
+  cmsysProcess_SetTimeout(cp, timeout.count());
   cmsysProcess_Execute(cp);
 
   // Initialize tick's
@@ -1186,7 +1185,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
     cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
   }
 
-  cmsysProcess_SetTimeout(cp, timeout);
+  cmsysProcess_SetTimeout(cp, timeout.count());
   cmsysProcess_Execute(cp);
 
   char* data;
@@ -2610,7 +2609,7 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args,
   if (cmSystemTools::GetRunCommandHideConsole()) {
     cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
   }
-  cmsysProcess_SetTimeout(cp, timeout);
+  cmsysProcess_SetTimeout(cp, timeout.count());
   cmsysProcess_Execute(cp);
 
   std::vector<char> tempOutput;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de0035fdcccb4c8acc92bf1db0a76b3c1f18003f
commit de0035fdcccb4c8acc92bf1db0a76b3c1f18003f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 8 08:07:26 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 8 08:31:00 2017 -0500

    cmCTestBuildAndTestHandler: Convert timeout to std::chrono::duration

diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 672087d..85d98d0 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -11,6 +11,7 @@
 
 #include "cmsys/Process.h"
 #include <chrono>
+#include <ratio>
 #include <stdlib.h>
 
 cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler()
@@ -18,7 +19,7 @@ cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler()
   this->BuildTwoConfig = false;
   this->BuildNoClean = false;
   this->BuildNoCMake = false;
-  this->Timeout = 0;
+  this->Timeout = std::chrono::duration<double>::zero();
 }
 
 void cmCTestBuildAndTestHandler::Initialize()
@@ -224,10 +225,9 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
   }
   for (std::string const& tar : this->BuildTargets) {
     std::chrono::duration<double> remainingTime = std::chrono::seconds(0);
-    if (this->Timeout > 0) {
-      remainingTime = std::chrono::duration<double>(this->Timeout) -
-        std::chrono::duration_cast<std::chrono::seconds>(
-                        std::chrono::steady_clock::now() - clock_start);
+    if (this->Timeout > std::chrono::duration<double>::zero()) {
+      remainingTime =
+        this->Timeout - (std::chrono::steady_clock::now() - clock_start);
       if (remainingTime <= std::chrono::seconds(0)) {
         if (outstring) {
           *outstring = "--build-and-test timeout exceeded. ";
@@ -324,10 +324,9 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
 
   // how much time is remaining
   std::chrono::duration<double> remainingTime = std::chrono::seconds(0);
-  if (this->Timeout > 0) {
-    remainingTime = std::chrono::duration<double>(this->Timeout) -
-      std::chrono::duration_cast<std::chrono::seconds>(
-                      std::chrono::steady_clock::now() - clock_start);
+  if (this->Timeout > std::chrono::duration<double>::zero()) {
+    remainingTime =
+      this->Timeout - (std::chrono::steady_clock::now() - clock_start);
     if (remainingTime <= std::chrono::seconds(0)) {
       if (outstring) {
         *outstring = "--build-and-test timeout exceeded. ";
@@ -396,7 +395,7 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
   }
   if (currentArg.find("--test-timeout", 0) == 0 && idx < allArgs.size() - 1) {
     idx++;
-    this->Timeout = atof(allArgs[idx].c_str());
+    this->Timeout = std::chrono::duration<double>(atof(allArgs[idx].c_str()));
   }
   if (currentArg == "--build-generator" && idx < allArgs.size() - 1) {
     idx++;
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h
index f19cb67..f8a9ed7 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.h
+++ b/Source/CTest/cmCTestBuildAndTestHandler.h
@@ -7,6 +7,7 @@
 
 #include "cmCTestGenericHandler.h"
 
+#include <chrono>
 #include <sstream>
 #include <stddef.h>
 #include <string>
@@ -67,7 +68,7 @@ protected:
   std::vector<std::string> TestCommandArgs;
   std::vector<std::string> BuildTargets;
   bool BuildNoCMake;
-  double Timeout;
+  std::chrono::duration<double> Timeout;
 };
 
 #endif

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=687a26b7023748cc98317eae53ee2ac3cc520bda
commit 687a26b7023748cc98317eae53ee2ac3cc520bda
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 8 07:33:39 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 8 07:33:39 2017 -0500

    CTest: Fix regression in build-and-test timeout forwarding
    
    Refactoring in commit 66419bc046 (CTest: convert timeouts to
    std::chrono::duration, 2017-11-20) changed out "infinite" timeout
    to a value not representable by a 64-bit integer.  Update the
    `--build-and-test` forwarding of `--test-timeout` to not forward
    an "infinite" timeout.

diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 2cd60e5..ed45644 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1131,6 +1131,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
         // invocations. Since --build-generator is required this is a
         // good place to check for it, and to add the arguments in
         if (strcmp(i, "--build-generator") == 0 &&
+            timeout != std::chrono::duration<double>::max() &&
             timeout > std::chrono::duration<double>::zero()) {
           args.push_back("--test-timeout");
           std::ostringstream msg;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e770b1b86e7157db4191096f226a8b0175819cff
commit e770b1b86e7157db4191096f226a8b0175819cff
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 8 07:04:36 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 8 07:14:05 2017 -0500

    CTest: Fix regression in build-and-test timeout compuatation
    
    Refactoring in commit 66419bc046 (CTest: convert timeouts to
    std::chrono::duration, 2017-11-20) accidentally changed the logic used
    to compute the timeout for a test when it starts.  It incorrectly limits
    the maximum possible timeout to 2 minutes rather than 2 minutes less
    than the total allowed test time remaining.  Update the new logic to
    restore the original behavior.
    
    Avoid subtracting 2 minutes from our "infinite" timeout value to avoid
    creating very large timeouts that are not "infinite" and may exceed
    integer type ranges.

diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index a4ca301..2cd60e5 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1089,9 +1089,10 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
   bool modifyEnv = (environment && !environment->empty());
 
   // determine how much time we have
-  std::chrono::duration<double> timeout =
-    std::min<std::chrono::duration<double>>(this->GetRemainingTimeAllowed(),
-                                            std::chrono::minutes(2));
+  std::chrono::duration<double> timeout = this->GetRemainingTimeAllowed();
+  if (timeout != std::chrono::duration<double>::max()) {
+    timeout -= std::chrono::minutes(2);
+  }
   if (this->TimeOut > std::chrono::duration<double>::zero() &&
       this->TimeOut < timeout) {
     timeout = this->TimeOut;

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

Summary of changes:
 Modules/Compiler/IAR-FindBinUtils.cmake     |    4 +-
 Modules/FindPkgConfig.cmake                 |  251 ++++++++++++++-------------
 Source/CTest/cmCTestBuildAndTestHandler.cxx |   19 +-
 Source/CTest/cmCTestBuildAndTestHandler.h   |    3 +-
 Source/CTest/cmCTestCoverageHandler.cxx     |    3 +-
 Source/CTest/cmCTestRunTest.cxx             |   20 +--
 Source/CTest/cmCTestScriptHandler.cxx       |   11 +-
 Source/CTest/cmCTestTestHandler.cxx         |   17 +-
 Source/CTest/cmProcess.cxx                  |   19 +-
 Source/CTest/cmProcess.h                    |    7 -
 Source/cmCTest.cxx                          |   30 ++--
 Source/cmCTest.h                            |    2 +
 12 files changed, 170 insertions(+), 216 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list