Skip to content

Commit bb986ee

Browse files
committed
Merge pull request #7963 from sloriot/CGAL-cmake_remove_exec_command
Use execute_process that is recommanded over exec_command since 3.0
2 parents d9e5a1f + f970b9b commit bb986ee

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

Installation/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,9 @@ set(CGAL_INSTALL_LIB_DIR
592592
)
593593

594594
if(CGAL_WIN32_CMAKE_ON_CYGWIN)
595-
exec_program(
596-
cygpath ARGS
597-
-w "${CMAKE_INSTALL_PREFIX}"
598-
OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX2)
595+
execute_process(COMMAND cygpath -w ${CMAKE_INSTALL_PREFIX}
596+
OUTPUT_STRIP_TRAILING_WHITESPACE
597+
OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX2)
599598
file(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX2} CMAKE_INSTALL_PREFIX)
600599
endif()
601600

Installation/cmake/modules/CGAL_Common.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ if( NOT CGAL_COMMON_FILE_INCLUDED )
2020
if ( WIN32 )
2121
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
2222
if(CMAKE_UNAME)
23-
exec_program(uname ARGS -s OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2)
23+
execute_process(COMMAND uname -s
24+
OUTPUT_STRIP_TRAILING_WHITESPACE
25+
OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2)
2426
if ( CMAKE_SYSTEM_NAME2 MATCHES "CYGWIN" )
2527
message( STATUS "This is the Windows CMake running within the cygwin platform." )
2628
set( CGAL_WIN32_CMAKE_ON_CYGWIN TRUE CACHE INTERNAL "This is the cygwin platform." )

Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED )
3939

4040
# From james Bigler, in the cmake users list.
4141
IF (APPLE)
42-
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
42+
execute_process(COMMAND uname -v
43+
OUTPUT_STRIP_TRAILING_WHITESPACE
44+
OUTPUT_VARIABLE DARWIN_VERSION)
4345
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
4446
message(STATUS "Running in macOS DARWIN_VERSION=${DARWIN_VERSION}")
4547
endif()

cmake_uninstall.cmake.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ string(REGEX REPLACE "\n" ";" files "${files}")
1212
foreach(file ${files})
1313
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
1414
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
15-
exec_program(
16-
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
15+
execute_process(
16+
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}"
17+
OUTPUT_STRIP_TRAILING_WHITESPACE
1718
OUTPUT_VARIABLE rm_out
18-
RETURN_VALUE rm_retval
19+
RESULT_VARIABLE rm_retval
1920
)
2021
if(NOT "${rm_retval}" STREQUAL 0)
2122
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")

0 commit comments

Comments
 (0)