From 7f7f1eecfd6834b8a499f0fde49469a10a1b2905 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 17 Sep 2015 21:08:05 -0400 Subject: FindPkgConfig: use execute_process to strip trailing whitespace --- Modules/FindPkgConfig.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index ae6903e..0f2e22d 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -70,14 +70,14 @@ macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp) execute_process( COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist} OUTPUT_VARIABLE _pkgconfig_invoke_result - RESULT_VARIABLE _pkgconfig_failed) + RESULT_VARIABLE _pkgconfig_failed + OUTPUT_STRIP_TRAILING_WHITESPACE) if (_pkgconfig_failed) set(_pkgconfig_${_varname} "") _pkgconfig_unset(${_prefix}_${_varname}) else() string(REGEX REPLACE "[\r\n]" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") - string(REGEX REPLACE " +$" "" _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") if (NOT ${_regexp} STREQUAL "") string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") -- cgit v0.12