BUG: untested fix for newlines in the output of pkg config

This commit is contained in:
Ken Martin 2007-03-07 15:36:09 -05:00
parent c841258170
commit 100723fbb0
1 changed files with 13 additions and 4 deletions

View File

@ -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 # and if the package of interest also exists for pkg-config, then get the information
IF(NOT _return_VALUE) IF(NOT _return_VALUE)
EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir OUTPUT_VARIABLE ${_include_DIR} ) 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} ) 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} ) 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} ) EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags
OUTPUT_VARIABLE ${_cflags} )
string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}")
ENDIF(NOT _return_VALUE) ENDIF(NOT _return_VALUE)