diff options
author | Jason E. Hale <jhale@freebsd.org> | 2023-12-19 18:50:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-12-19 20:35:24 (GMT) |
commit | 61436858e431b137252b3d5e63ee579c7c575103 (patch) | |
tree | 70920c032aac910757a16f10d8145109e3f20628 | |
parent | e9a3f3fb029c0e52e30a84c61206fa8c71807b47 (diff) | |
download | CMake-61436858e431b137252b3d5e63ee579c7c575103.zip CMake-61436858e431b137252b3d5e63ee579c7c575103.tar.gz CMake-61436858e431b137252b3d5e63ee579c7c575103.tar.bz2 |
UsePkgConfig: Restore removal of trailing whitespace from pkg-config output
Since commit f73a5bfaa9 (UsePkgConfig: Replace exec_program() with
execute_process(), 2023-07-24, v3.28.0-rc1~321^2~6), trailing whitespace
was introduced into libraries linked, which violates CMP0004.
-rw-r--r-- | Modules/UsePkgConfig.cmake | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake index b020259..fdf632a 100644 --- a/Modules/UsePkgConfig.cmake +++ b/Modules/UsePkgConfig.cmake @@ -41,20 +41,19 @@ macro(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) if(NOT _return_VALUE) execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --variable=includedir - OUTPUT_VARIABLE ${_include_DIR} ) + OUTPUT_VARIABLE ${_include_DIR} OUTPUT_STRIP_TRAILING_WHITESPACE ) string(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}") - execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --variable=libdir - OUTPUT_VARIABLE ${_link_DIR} ) + OUTPUT_VARIABLE ${_link_DIR} OUTPUT_STRIP_TRAILING_WHITESPACE ) string(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}") execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --libs - OUTPUT_VARIABLE ${_link_FLAGS} ) + OUTPUT_VARIABLE ${_link_FLAGS} OUTPUT_STRIP_TRAILING_WHITESPACE ) string(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}") execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --cflags - OUTPUT_VARIABLE ${_cflags} ) + OUTPUT_VARIABLE ${_cflags} OUTPUT_STRIP_TRAILING_WHITESPACE ) string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}") else() |