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  42a20ef79b86090b65de9836158db2a59c837e69 (commit)
       via  35b580d6033395b491c73005d785aa2c456f734e (commit)
       via  0301a76bb464fc3231193c4f1c957327e8258d44 (commit)
       via  28cb86d7962b2a9b8e49dc62bccf6187761524d9 (commit)
      from  3bc1feae5fe044d796e4bcd932b7228c40fde230 (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=42a20ef79b86090b65de9836158db2a59c837e69
commit 42a20ef79b86090b65de9836158db2a59c837e69
Merge: 35b580d 28cb86d
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Sep 17 15:08:27 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Tue Sep 17 11:08:43 2019 -0400

    Merge topic 'allow-pkg-config-missing-libraries'
    
    28cb86d796 FindPkgConfig: Allow libraries that can't be found with their 
full path
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Acked-by: Rolf Eike Beer <e...@sf-mail.de>
    Merge-request: !3781


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=35b580d6033395b491c73005d785aa2c456f734e
commit 35b580d6033395b491c73005d785aa2c456f734e
Merge: 3bc1fea 0301a76
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Sep 17 15:06:52 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Tue Sep 17 11:07:08 2019 -0400

    Merge topic 'remove-failing-modules-test'
    
    0301a76bb4 FindEnvMod: Remove unreliable test case
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3823


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0301a76bb464fc3231193c4f1c957327e8258d44
commit 0301a76bb464fc3231193c4f1c957327e8258d44
Author:     Chuck Atkins <chuck.atk...@kitware.com>
AuthorDate: Mon Sep 16 12:46:33 2019 -0400
Commit:     Chuck Atkins <chuck.atk...@kitware.com>
CommitDate: Mon Sep 16 13:10:40 2019 -0400

    FindEnvMod: Remove unreliable test case
    
    There's no way to know that loading an arbitrary module doesn't pull in
    extra dependent modules so the test case asserting that exactly one module
    was loaded isn't valid.

diff --git a/Tests/FindEnvModules/EnvModules.cmake 
b/Tests/FindEnvModules/EnvModules.cmake
index 0c81bf2..21b0042 100644
--- a/Tests/FindEnvModules/EnvModules.cmake
+++ b/Tests/FindEnvModules/EnvModules.cmake
@@ -18,18 +18,16 @@ if(avail_mods)
 
   message("module list")
   env_module_list(loaded_mods)
+  set(mod0_found FALSE)
   foreach(mod IN LISTS loaded_mods)
     message("  ${mod}")
+    if(NOT mod0_found AND mod MATCHES "^${mod0}")
+      set(mod0_found ${mod})
+    endif()
   endforeach()
 
-  list(LENGTH loaded_mods num_loaded_mods)
-  message("Number of modules loaded: ${num_loaded_mods}")
-  if(NOT num_loaded_mods EQUAL 1)
-    message(FATAL_ERROR "Exactly 1 module should be loaded.  Found 
${num_loaded_mods}")
-  endif()
-
-  list(GET loaded_mods 0 mod0_actual)
-  if(NOT (mod0_actual MATCHES "^${mod0}"))
-    message(FATAL_ERROR "Loaded module does not match ${mod0}.  Actual: 
${mod0_actual}")
+  if(NOT mod0_found)
+    message(FATAL_ERROR "Requested module ${mod0} not found in loaded modules")
   endif()
+  message("module ${mod0} found loaded as ${mod0_found}")
 endif()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28cb86d7962b2a9b8e49dc62bccf6187761524d9
commit 28cb86d7962b2a9b8e49dc62bccf6187761524d9
Author:     Chuck Atkins <chuck.atk...@kitware.com>
AuthorDate: Wed Sep 4 12:36:34 2019 -0400
Commit:     Chuck Atkins <chuck.atk...@kitware.com>
CommitDate: Mon Sep 16 13:02:08 2019 -0400

    FindPkgConfig: Allow libraries that can't be found with their full path
    
    pkg-config's .pc files can sometimes provide libraries that are visible to
    the linker but not present in CMake's known search paths.  In the case
    where CMake can find some, but not all of the library dependencies
    provided in a .pc file, this allows them to be passed through as "-lfoo"
    when the full path can't be found.
    
    This also removes the test failure cases that occured because of this
    scenario and adjsuts the remaining tests to account for not-found
    libraries

diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 4c9af91..5162a44 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -214,7 +214,11 @@ function(_pkg_find_libs _prefix _no_cmake_path 
_no_cmake_environment_path)
                  NAMES ${_pkg_search}
                  ${_find_opts})
     mark_as_advanced(pkgcfg_lib_${_prefix}_${_pkg_search})
-    list(APPEND _libs "${pkgcfg_lib_${_prefix}_${_pkg_search}}")
+    if(pkgcfg_lib_${_prefix}_${_pkg_search})
+      list(APPEND _libs "${pkgcfg_lib_${_prefix}_${_pkg_search}}")
+    else()
+      list(APPEND _libs ${_pkg_search})
+    endif()
   endforeach()
 
   set(${_prefix}_LINK_LIBRARIES "${_libs}" PARENT_SCOPE)
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake 
b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake
index e82b05f..62bb5de 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake
@@ -39,7 +39,7 @@ foreach(i 1 2)
 "Name: CMakeInternalFakePackage${i}
 Description: Dummy package (${i}) for FindPkgConfig IMPORTED_TARGET test
 Version: 1.2.3
-Libs: -l${pname}
+Libs: -l${pname} -l${pname}-doesnotexist
 ")
 endforeach()
 
@@ -47,27 +47,6 @@ endforeach()
 # the import target find_library() calls handle the NO...PATH options correctly
 set(ENV{PKG_CONFIG_PATH} ${fakePkgDir}/lib/pkgconfig)
 
-# Confirm correct behavior of NO_CMAKE_PATH, ensuring we only find the library
-# for the imported target if we have both set CMAKE_PREFIX_PATH and have not
-# given the NO_CMAKE_PATH option
-unset(CMAKE_PREFIX_PATH)
-unset(ENV{CMAKE_PREFIX_PATH})
-pkg_check_modules(FakePackage1 QUIET IMPORTED_TARGET cmakeinternalfakepackage1)
-if (TARGET PkgConfig::FakePackage1)
-  message(FATAL_ERROR "Have import target for fake package 1 with no path 
prefix")
-endif()
-
-set(CMAKE_PREFIX_PATH ${fakePkgDir})
-pkg_check_modules(FakePackage1 QUIET IMPORTED_TARGET NO_CMAKE_PATH 
cmakeinternalfakepackage1)
-if (TARGET PkgConfig::FakePackage1)
-  message(FATAL_ERROR "Have import target for fake package 1 with ignored 
cmake path")
-endif()
-
-pkg_check_modules(FakePackage1 REQUIRED QUIET IMPORTED_TARGET 
cmakeinternalfakepackage1)
-if (NOT TARGET PkgConfig::FakePackage1)
-  message(FATAL_ERROR "No import target for fake package 1 with prefix path")
-endif()
-
 # find targets in subdir and check their visibility
 add_subdirectory(target_subdir)
 if (TARGET PkgConfig::FakePackage1_dir)
@@ -82,31 +61,35 @@ endif()
 # combination
 unset(CMAKE_PREFIX_PATH)
 unset(ENV{CMAKE_PREFIX_PATH})
-pkg_check_modules(FakePackage2 QUIET IMPORTED_TARGET cmakeinternalfakepackage2)
-if (TARGET PkgConfig::FakePackage2)
-  message(FATAL_ERROR "Have import target for fake package 2 with no path 
prefix")
-endif()
-
 set(ENV{CMAKE_PREFIX_PATH} ${fakePkgDir})
-pkg_check_modules(FakePackage2 QUIET IMPORTED_TARGET NO_CMAKE_ENVIRONMENT_PATH 
cmakeinternalfakepackage2)
-if (TARGET PkgConfig::FakePackage2)
-  message(FATAL_ERROR "Have import target for fake package 2 with ignored 
cmake path")
-endif()
 
 pkg_check_modules(FakePackage2 REQUIRED QUIET IMPORTED_TARGET 
cmakeinternalfakepackage2)
 if (NOT TARGET PkgConfig::FakePackage2)
   message(FATAL_ERROR "No import target for fake package 2 with prefix path")
 endif()
 
+# check that 2 library entries exist
+list(LENGTH FakePackage2_LINK_LIBRARIES fp2_nlibs)
+if (NOT fp2_nlibs EQUAL 2)
+  message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has ${fp2_nlibs} entries 
but should have exactly 2")
+endif()
+
 # check that the full library path is also returned
-if (NOT FakePackage2_LINK_LIBRARIES STREQUAL 
"${fakePkgDir}/lib/libcmakeinternalfakepackage2.a")
+list(GET FakePackage2_LINK_LIBRARIES 0 fp2_lib0)
+if (NOT fp2_lib0 STREQUAL "${fakePkgDir}/lib/libcmakeinternalfakepackage2.a")
+  message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has bad content on first 
run: ${FakePackage2_LINK_LIBRARIES}")
+endif()
+
+# check that the library that couldn't be found still shows up
+list(GET FakePackage2_LINK_LIBRARIES 1 fp2_lib1)
+if (NOT fp2_lib1 STREQUAL "cmakeinternalfakepackage2-doesnotexist")
   message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has bad content on first 
run: ${FakePackage2_LINK_LIBRARIES}")
 endif()
 
 # the information in *_LINK_LIBRARIES is not cached, so ensure is also is 
present on second run
 unset(FakePackage2_LINK_LIBRARIES)
 pkg_check_modules(FakePackage2 REQUIRED QUIET IMPORTED_TARGET 
cmakeinternalfakepackage2)
-if (NOT FakePackage2_LINK_LIBRARIES STREQUAL 
"${fakePkgDir}/lib/libcmakeinternalfakepackage2.a")
+if (NOT FakePackage2_LINK_LIBRARIES STREQUAL 
"${fakePkgDir}/lib/libcmakeinternalfakepackage2.a;cmakeinternalfakepackage2-doesnotexist")
   message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has bad content on second 
run: ${FakePackage2_LINK_LIBRARIES}")
 endif()
 

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

Summary of changes:
 Modules/FindPkgConfig.cmake                        |  6 ++-
 Tests/FindEnvModules/EnvModules.cmake              | 16 ++++---
 .../FindPkgConfig_IMPORTED_TARGET.cmake            | 49 +++++++---------------
 3 files changed, 28 insertions(+), 43 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to