From 6955222dc099fb867925931bb044ff8caae9c64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Date: Thu, 19 Sep 2024 08:55:41 +0100 Subject: [PATCH] cmake: convert deprecated exec_program() to execute_process() (#1570) --- cmake/PcapPlusPlusUninstall.cmake.in | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cmake/PcapPlusPlusUninstall.cmake.in b/cmake/PcapPlusPlusUninstall.cmake.in index 9a3121336c..bd98d771f1 100644 --- a/cmake/PcapPlusPlusUninstall.cmake.in +++ b/cmake/PcapPlusPlusUninstall.cmake.in @@ -7,16 +7,13 @@ string(REGEX REPLACE "\n" ";" files "${files}") foreach(file ${files}) message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - # If the file exists or is symlink - # run remove command through cmake in command mode - # See https://cmake.org/cmake/help/latest/manual/cmake.1.html#run-a-command-line-tool - exec_program( - "@CMAKE_COMMAND@" ARGS "-E rm -rf \"$ENV{DESTDIR}${file}\"" + execute_process( + COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval + RESULT_VARIABLE rm_retval ) if(NOT "${rm_retval}" STREQUAL 0) - message(FATAL_ERROR "Error when removing $ENV{DESTDIR}${file}") + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") endif() else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") message(STATUS "File $ENV{DESTDIR}${file} does not exist.")