From a76eedcd1f22018892f8555a15e7b2e92a497e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 8 Sep 2021 20:46:44 +0200 Subject: 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. --- cmake/FindGCRYPT.cmake | 10 +++++----- cmake/cmake_uninstall.cmake.in | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'cmake') 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() -- cgit v1.2.3