summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason E. Hale <jhale@freebsd.org>2023-12-19 18:50:05 (GMT)
committerBrad King <brad.king@kitware.com>2023-12-19 20:35:24 (GMT)
commit61436858e431b137252b3d5e63ee579c7c575103 (patch)
tree70920c032aac910757a16f10d8145109e3f20628
parente9a3f3fb029c0e52e30a84c61206fa8c71807b47 (diff)
downloadCMake-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.cmake9
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()