[cmake] cmake_uninstall.cmake.in: Use EXECUTE_PROCESS() instead of EXEC_PROGRAM().

EXECUTE_PROCESS() has been around since at least 3.0, and EXEC_PROGRAM()
is deprecated as of 3.28:

CMake Warning (dev) at cmake/cmake_uninstall.cmake:12 (EXEC_PROGRAM):
  Policy CMP0153 is not set: The exec_program command should not be called.
  Run "cmake --help-policy CMP0153" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Use execute_process() instead.

(copied over from rom-properties)
This commit is contained in:
David Korth 2024-04-26 21:26:51 -04:00
parent a2d0f7b31f
commit 8ef919bbcb

View File

@ -9,10 +9,9 @@ STRING(REGEX REPLACE "\n" ";" files "${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}"
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}")