summaryrefslogtreecommitdiffstats
path: root/Modules/FindPkgConfig.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-11-29 21:12:40 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-11-29 21:12:40 (GMT)
commit9b42fff02f1b62f2ba060e819863b672736a393b (patch)
treedc583bca80165255df26cd07fe2a27e323b08de0 /Modules/FindPkgConfig.cmake
parentccb77b65c673037780483e23c7bc1b4bf1d17cbc (diff)
downloadCMake-9b42fff02f1b62f2ba060e819863b672736a393b.zip
CMake-9b42fff02f1b62f2ba060e819863b672736a393b.tar.gz
CMake-9b42fff02f1b62f2ba060e819863b672736a393b.tar.bz2
ENH: maintain backwards compatibility in UsePkgConfig
Diffstat (limited to 'Modules/FindPkgConfig.cmake')
-rw-r--r--Modules/FindPkgConfig.cmake13
1 files changed, 9 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})