From: Gregory Economou Date: Tue, 16 Apr 2024 12:04:20 +0000 (+0300) Subject: cmake adds newlines to variables set from command output, trashing the X-Git-Tag: vectorscan/5.4.12^2~68^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81722040f8ecc576cf8e6af922e6f033b9d45657;p=thirdparty%2Fvectorscan.git cmake adds newlines to variables set from command output, trashing the usefulness of the flexible method of setting the rpath var. back to the clunky manual setting. --- diff --git a/cmake/osdetection.cmake b/cmake/osdetection.cmake index c163a7ff..23f6a5d5 100644 --- a/cmake/osdetection.cmake +++ b/cmake/osdetection.cmake @@ -5,7 +5,11 @@ endif(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(FREEBSD true) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - execute_process(COMMAND "sh" "-c" "realpath `dirname \\`${CMAKE_C_COMPILER} --print-file-name=libgcc_s.so\\``" OUTPUT_VARIABLE CMAKE_BUILD_RPATH) + if(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc12") + set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc12") + elseif(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc13") + set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc13") + endif() endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")