diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-11-29 16:12:40 -0500 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-11-29 16:12:40 -0500 |
commit | 9b42fff02f1b62f2ba060e819863b672736a393b (patch) | |
tree | dc583bca80165255df26cd07fe2a27e323b08de0 /Modules/FindPkgConfig.cmake | |
parent | ccb77b65c673037780483e23c7bc1b4bf1d17cbc (diff) | |
download | cmake-9b42fff02f1b62f2ba060e819863b672736a393b.tar.gz |
ENH: maintain backwards compatibility in UsePkgConfig
Diffstat (limited to 'Modules/FindPkgConfig.cmake')
-rw-r--r-- | Modules/FindPkgConfig.cmake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index b39048e050..04ea622e23 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}) |