Skip to content

Commit 2987159

Browse files
author
Addisu Z. Taddese
authored
Replace the deprecated exec_program call with execute_process (#143)
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
1 parent 2c9212b commit 2987159

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ if(UNIX AND NOT WIN32)
7474
set (CMAKE_INSTALL_PREFIX "/usr" CACHE STRING "Install Prefix")
7575
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
7676
if(CMAKE_UNAME)
77-
exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR)
77+
execute_process(COMMAND uname -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR OUTPUT_STRIP_TRAILING_WHITESPACE)
7878
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL
7979
"processor type (i386 and x86_64)")
8080
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")

cmake/cmake_uninstall.cmake.in

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
2-
message(FATAL_ERROR "Cannot find install manifest: "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt"")
2+
message(FATAL_ERROR "Cannot find install manifest: '@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt'")
33
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
44

55
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
66
string(REGEX REPLACE "\n" ";" files "${files}")
77
foreach(file ${files})
8-
message(STATUS "Uninstalling "$ENV{DESTDIR}${file}"")
8+
message(STATUS "Uninstalling '$ENV{DESTDIR}${file}'")
99
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
10-
exec_program(
11-
"@CMAKE_COMMAND@" ARGS "-E remove "$ENV{DESTDIR}${file}""
10+
execute_process(COMMAND
11+
@CMAKE_COMMAND@ -E remove $ENV{DESTDIR}${file}
1212
OUTPUT_VARIABLE rm_out
13-
RETURN_VALUE rm_retval
13+
RESULT_VARIABLE rm_retval
1414
)
15-
if(NOT "${rm_retval}" STREQUAL 0)
16-
message(FATAL_ERROR "Problem when removing "$ENV{DESTDIR}${file}"")
17-
endif(NOT "${rm_retval}" STREQUAL 0)
15+
if(rm_retfal AND NOT rm_retval STREQUAL 0)
16+
message(FATAL_ERROR "Problem when removing '$ENV{DESTDIR}${file}'")
17+
endif()
1818
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
19-
message(STATUS "File "$ENV{DESTDIR}${file}" does not exist.")
20-
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
19+
message(STATUS "File '$ENV{DESTDIR}${file}' does not exist.")
20+
endif()
2121
endforeach(file)

0 commit comments

Comments
 (0)