diff options
author | Ken Martin <ken.martin@kitware.com> | 2007-03-07 20:36:09 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2007-03-07 20:36:09 (GMT) |
commit | 100723fbb083ebbb0376e6d9e01856094f49e4e5 (patch) | |
tree | 288e5c208913e38acfe9e7a3dff7ca2f756afecb /Modules/UsePkgConfig.cmake | |
parent | c841258170bd4dade8d2142f63b89703f4618b08 (diff) | |
download | CMake-100723fbb083ebbb0376e6d9e01856094f49e4e5.zip CMake-100723fbb083ebbb0376e6d9e01856094f49e4e5.tar.gz CMake-100723fbb083ebbb0376e6d9e01856094f49e4e5.tar.bz2 |
BUG: untested fix for newlines in the output of pkg config
Diffstat (limited to 'Modules/UsePkgConfig.cmake')
-rw-r--r-- | Modules/UsePkgConfig.cmake | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake index ed47e2d..23519e8 100644 --- a/Modules/UsePkgConfig.cmake +++ b/Modules/UsePkgConfig.cmake @@ -31,13 +31,22 @@ MACRO(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) # and if the package of interest also exists for pkg-config, then get the information IF(NOT _return_VALUE) - EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir OUTPUT_VARIABLE ${_include_DIR} ) - - EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir OUTPUT_VARIABLE ${_link_DIR} ) - - EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs OUTPUT_VARIABLE ${_link_FLAGS} ) - - EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags OUTPUT_VARIABLE ${_cflags} ) + EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir + OUTPUT_VARIABLE ${_include_DIR} ) + string(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}") + + + EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir + OUTPUT_VARIABLE ${_link_DIR} ) + string(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}") + + EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs + OUTPUT_VARIABLE ${_link_FLAGS} ) + string(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}") + + EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags + OUTPUT_VARIABLE ${_cflags} ) + string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}") ENDIF(NOT _return_VALUE) |