Skip to content

Commit

Permalink
use execute_process that is recommanded over exec_command since 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Jan 4, 2024
1 parent cef517a commit 0ab6971
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 2 additions & 4 deletions Installation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,8 @@ set(CGAL_INSTALL_LIB_DIR
)

if(CGAL_WIN32_CMAKE_ON_CYGWIN)
exec_program(
cygpath ARGS
-w "${CMAKE_INSTALL_PREFIX}"
OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX2)
execute_process(COMMAND cygpath -w ${CMAKE_INSTALL_PREFIX}
OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX2)
file(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX2} CMAKE_INSTALL_PREFIX)
endif()

Expand Down
3 changes: 2 additions & 1 deletion Installation/cmake/modules/CGAL_Common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ if( NOT CGAL_COMMON_FILE_INCLUDED )
if ( WIN32 )
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
if(CMAKE_UNAME)
exec_program(uname ARGS -s OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2)
execute_process(COMMAND uname -s
OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2)
if ( CMAKE_SYSTEM_NAME2 MATCHES "CYGWIN" )
message( STATUS "This is the Windows CMake running within the cygwin platform." )
set( CGAL_WIN32_CMAKE_ON_CYGWIN TRUE CACHE INTERNAL "This is the cygwin platform." )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED )

# From james Bigler, in the cmake users list.
IF (APPLE)
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
execute_process(COMMAND uname -v
OUTPUT_VARIABLE DARWIN_VERSION)
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
message(STATUS "Running in macOS DARWIN_VERSION=${DARWIN_VERSION}")
endif()
Expand Down
6 changes: 3 additions & 3 deletions cmake_uninstall.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,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 0ab6971

Please sign in to comment.