summaryrefslogtreecommitdiffstats
path: root/Modules/FindPkgConfig.cmake
diff options
context:
space:
mode:
authorMatthew Hanna <mhanna21@bloomberg.net>2017-01-17 21:15:18 (GMT)
committerMatthew Hanna <mhanna21@bloomberg.net>2017-01-25 03:02:14 (GMT)
commit796dea67a68be432f98e2fef50059c93106557a2 (patch)
treec8f28bb665159abd1a64d5b6dfc5a1b4d158e777 /Modules/FindPkgConfig.cmake
parent6b4b8e6a600e177d6bbe41848e7de58e7392c81a (diff)
downloadCMake-796dea67a68be432f98e2fef50059c93106557a2.zip
CMake-796dea67a68be432f98e2fef50059c93106557a2.tar.gz
CMake-796dea67a68be432f98e2fef50059c93106557a2.tar.bz2
FindPkgConfig: Recheck pkg-config on parameter change.
Currently, once pkg_check_modules succeeds, it will never call _pkg_check_modules_internal again. That means that if the parameters to pkg_check_modules are changed, cmake will be called to reconfigure, but nothing will change. This change is to store the full string of arguments to pkg_check_modules and override the FOUND optimization so that the arguments are reevaluated when modified.
Diffstat (limited to 'Modules/FindPkgConfig.cmake')
-rw-r--r--Modules/FindPkgConfig.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 8b7131b..1958f4b 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -585,10 +585,13 @@ endmacro()
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)
+ if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND OR NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_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})
+ if (${_prefix}_FOUND)
+ _pkgconfig_set(__pkg_config_arguments_${_prefix} "${_module0};${ARGN}")
+ endif()
elseif (${_prefix}_FOUND AND ${_imp_target})
_pkg_create_imp_target("${_prefix}" _no_cmake_path _no_cmake_environment_path)
endif()