From 61436858e431b137252b3d5e63ee579c7c575103 Mon Sep 17 00:00:00 2001 From: "Jason E. Hale" Date: Tue, 19 Dec 2023 13:50:05 -0500 Subject: 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. --- Modules/UsePkgConfig.cmake | 9 ++++----- 1 file 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() -- cgit v0.12