diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindPkgConfig.cmake | 13 | ||||
-rw-r--r-- | Modules/UsePkgConfig.cmake | 7 |
2 files changed, 16 insertions, 4 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index b39048e..04ea622 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -360,10 +360,15 @@ macro(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) message(STATUS "WARNING: you are using the obsolete 'PKGCONFIG' macro") _pkg_check_modules_internal(0 0 _PKGCONFIG_TMP "${_package}") if (_PKGCONFIG_TMP_FOUND) - set(${_include_DIR} ${_PKGCONFIG_TMP_INCLUDEDIR}) - set(${_link_DIR} ${_PKGCONFIG_TMP_LIBDIR}) - set(${_link_FLAGS} ${_PKGCONFIG_TMP_LDFLAGS}) - set(${_cflags} ${_PKGCONFIG_TMP_CFLAGS}) + # To be compatible with obsolete module must return blank-delimited strings. + # Also, lead with a blank (for TRUE/FALSE compatibility, 2.4.4 appears to + # have returned a blank sometimes followed by nl for the situation + # where the pkg-config module has been found [e.g., _PKGCONFIG_TMP_FOUND] + # but does not define the desired quantity. + string(REGEX REPLACE ";" " " ${_include_DIR} " ${_PKGCONFIG_TMP_INCLUDE_DIRS}") + string(REGEX REPLACE ";" " " ${_link_DIR} " ${_PKGCONFIG_TMP_LIBRARY_DIRS}") + string(REGEX REPLACE ";" " " ${_link_FLAGS} " ${_PKGCONFIG_TMP_LDFLAGS}") + string(REGEX REPLACE ";" " " ${_cflags} " ${_PKGCONFIG_TMP_CFLAGS}") set(_return_VALUE 0) else(_PKGCONFIG_TMP_FOUND) set(${_include_DIR}) diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake index a7c7e59..62cc1d5 100644 --- a/Modules/UsePkgConfig.cmake +++ b/Modules/UsePkgConfig.cmake @@ -11,3 +11,10 @@ # INCLUDE(FindPkgConfig) +# Retain backwards compatibility with old PKGCONFIG_EXECUTABLE name. +IF(PKG_CONFIG_EXECUTABLE) + SET(PKGCONFIG_EXECUTABLE ${PKG_CONFIG_EXECUTABLE}) +ELSE(PKG_CONFIG_EXECUTABLE) + SET(PKGCONFIG_EXECUTABLE PKGCONFIG_EXECUTABLE-NOTFOUND) +ENDIF(PKG_CONFIG_EXECUTABLE) + |