summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-20 13:55:59 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-06-20 13:55:59 (GMT)
commit95c5e00186cb4e6b267925c9bb95763810dbb3f5 (patch)
treec18e4e7323264871af9b23ae37a2b841cc57260e /Modules
parent711caeb3bda3c6423464c98b314a31f5721d175b (diff)
parent8345c6463d813fb39ee6a6dee5259ee18525c62c (diff)
downloadCMake-95c5e00186cb4e6b267925c9bb95763810dbb3f5.zip
CMake-95c5e00186cb4e6b267925c9bb95763810dbb3f5.tar.gz
CMake-95c5e00186cb4e6b267925c9bb95763810dbb3f5.tar.bz2
Merge topic 'pkgconfig-targets'
8345c646 FindPkgConfig: define the imported targets also when the data comes from cache
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPkgConfig.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 33290c4..d16460b 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -595,12 +595,14 @@ endmacro()
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})
# check cached value
if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
- _pkgconfig_parse_options (_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target "${_module0}" ${ARGN})
_pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} "${_prefix}" ${_pkg_modules})
_pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
+ elseif (${_prefix}_FOUND AND ${_imp_target})
+ _pkg_create_imp_target("${_prefix}" _no_cmake_path _no_cmake_environment_path)
endif()
endmacro()
@@ -623,10 +625,10 @@ endmacro()
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})
# check cached value
if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
set(_pkg_modules_found 0)
- _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target "${_module0}" ${ARGN})
if (NOT ${_pkg_is_silent})
message(STATUS "Checking for one of the modules '${_pkg_modules_alt}'")
@@ -650,6 +652,8 @@ macro(pkg_search_module _prefix _module0)
endif()
_pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
+ elseif (${_prefix}_FOUND AND ${_imp_target})
+ _pkg_create_imp_target("${_prefix}" _no_cmake_path _no_cmake_environment_path)
endif()
endmacro()