Skip to content

Commit

Permalink
build: Update uninstall.cmake.in
Browse files Browse the repository at this point in the history
The 'exec_program' command is deprecated in a newer CMake, resulting
in the below warning for each uninstalled file.

CMake Warning (dev) at uninstall.cmake:17 (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.
This warning is for project developers.  Use -Wno-dev to suppress it.
  • Loading branch information
mcrha committed Nov 6, 2024
1 parent 9813c14 commit 22773d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions uninstall.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ 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}")
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}")
Expand Down

0 comments on commit 22773d8

Please sign in to comment.