From 960c39f4504c7e8ee4d40b073e2c66fc779a2f6d Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Thu, 6 Jun 2024 12:30:11 -0700 Subject: [PATCH] Stop using deprecated exec_program command in cmake, references #1102 --- cmake/cmake_uninstall.cmake.in | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in index 7c63427113..7492214156 100644 --- a/cmake/cmake_uninstall.cmake.in +++ b/cmake/cmake_uninstall.cmake.in @@ -30,19 +30,23 @@ foreach(file ${files}) message(STATUS "\tTrying to execute remove command anyway.") endif() - exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$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 "Problem when removing \"$ENV{DESTDIR}${file}\"") endif() + endforeach() message(STATUS "Deleting ${GEOS_INCLUDE_DIR} directory") -exec_program("@CMAKE_COMMAND@" - ARGS "-E remove_directory \"${GEOS_INCLUDE_DIR}\"" +execute_process( + COMMAND "@CMAKE_COMMAND@" -E remove_directory \"${GEOS_INCLUDE_DIR}\" OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval) + RESULT_VARIABLE rm_retval) + if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing \"${GEOS_INCLUDE_DIR}\"") endif()