Skip to content

Commit 6955222

Browse files
authored
cmake: convert deprecated exec_program() to execute_process() (seladb#1570)
1 parent 84e2581 commit 6955222

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

cmake/PcapPlusPlusUninstall.cmake.in

+4-7
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@ string(REGEX REPLACE "\n" ";" files "${files}")
77
foreach(file ${files})
88
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
99
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
10-
# If the file exists or is symlink
11-
# run remove command through cmake in command mode
12-
# See https://cmake.org/cmake/help/latest/manual/cmake.1.html#run-a-command-line-tool
13-
exec_program(
14-
"@CMAKE_COMMAND@" ARGS "-E rm -rf \"$ENV{DESTDIR}${file}\""
10+
execute_process(
11+
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}"
1512
OUTPUT_VARIABLE rm_out
16-
RETURN_VALUE rm_retval
13+
RESULT_VARIABLE rm_retval
1714
)
1815
if(NOT "${rm_retval}" STREQUAL 0)
19-
message(FATAL_ERROR "Error when removing $ENV{DESTDIR}${file}")
16+
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
2017
endif()
2118
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
2219
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")

0 commit comments

Comments
 (0)