summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-09-08 20:46:44 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-09-08 20:46:44 +0200
commita76eedcd1f22018892f8555a15e7b2e92a497e46 (patch)
treeec0127ffe4025db37ed331304f4752d39522f02d /cmake
parent7742b48098e04e4c4328e773c27ffdcb1580fc5b (diff)
downloadweechat-a76eedcd1f22018892f8555a15e7b2e92a497e46.zip
core: replace deprecated cmake command "exec_program" by "execute_process"
This fixes a compilation issue on Debian Sid with the latest version of debianutils (5.4-3), where the "which" command is now deprecated.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindGCRYPT.cmake10
-rw-r--r--cmake/cmake_uninstall.cmake.in4
2 files changed, 6 insertions, 8 deletions
diff --git a/cmake/FindGCRYPT.cmake b/cmake/FindGCRYPT.cmake
index ae3e00dc4..39772692f 100644
--- a/cmake/FindGCRYPT.cmake
+++ b/cmake/FindGCRYPT.cmake
@@ -34,12 +34,12 @@ set(GCRYPT_CFLAGS)
if(LIBGCRYPT_CONFIG_EXECUTABLE)
- exec_program(${LIBGCRYPT_CONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GCRYPT_LDFLAGS)
- exec_program(${LIBGCRYPT_CONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GCRYPT_CFLAGS)
+ execute_process(COMMAND ${LIBGCRYPT_CONFIG_EXECUTABLE} --libs RESULT_VARIABLE _return_VALUE OUTPUT_VARIABLE GCRYPT_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
+ execute_process(COMMAND ${LIBGCRYPT_CONFIG_EXECUTABLE} --cflags RESULT_VARIABLE _return_VALUE OUTPUT_VARIABLE GCRYPT_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
- if(${GCRYPT_CFLAGS} MATCHES "\n")
- set(GCRYPT_CFLAGS " ")
- endif()
+ if(NOT DEFINED ${GCRYPT_CFLAGS})
+ set(GCRYPT_CFLAGS " ")
+ endif()
endif()
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in
index b4789d2c5..6c3d844be 100644
--- a/cmake/cmake_uninstall.cmake.in
+++ b/cmake/cmake_uninstall.cmake.in
@@ -28,9 +28,7 @@ list(REVERSE files)
foreach(file ${files})
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
if(EXISTS "$ENV{DESTDIR}${file}")
- exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
- OUTPUT_VARIABLE rm_out
- RETURN_VARIABLE rm_retval)
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" OUTPUT_VARIABLE rm_out RESULT_VARIABLE rm_retval)
if("${rm_retval}" GREATER 0)
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
endif()