From 0ab6971ede29fe469b5ee1aefa8ef79c3ed744fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 14:30:40 +0100 Subject: [PATCH 1/2] use execute_process that is recommanded over exec_command since 3.0 --- Installation/CMakeLists.txt | 6 ++---- Installation/cmake/modules/CGAL_Common.cmake | 3 ++- .../cmake/modules/CGAL_GeneratorSpecificSettings.cmake | 3 ++- cmake_uninstall.cmake.in | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index aa09f590126..1a213f551d5 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -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() diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index ce99da6489e..c576785c7cd 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -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." ) diff --git a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake index e70370b2c31..08f68eeb315 100644 --- a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake +++ b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake @@ -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() diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index d00a5166581..d2baa65da87 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -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}") From f970b9bba488c4cc47532ce1ca651fe8edd77ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 5 Jan 2024 14:08:32 +0100 Subject: [PATCH 2/2] add option to remove extra newline --- Installation/CMakeLists.txt | 1 + Installation/cmake/modules/CGAL_Common.cmake | 1 + Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake | 1 + cmake_uninstall.cmake.in | 1 + 4 files changed, 4 insertions(+) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 1a213f551d5..058e4c70744 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -593,6 +593,7 @@ set(CGAL_INSTALL_LIB_DIR if(CGAL_WIN32_CMAKE_ON_CYGWIN) execute_process(COMMAND cygpath -w ${CMAKE_INSTALL_PREFIX} + OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX2) file(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX2} CMAKE_INSTALL_PREFIX) endif() diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index c576785c7cd..df6446c92ae 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -21,6 +21,7 @@ if( NOT CGAL_COMMON_FILE_INCLUDED ) find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin ) if(CMAKE_UNAME) execute_process(COMMAND uname -s + OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2) if ( CMAKE_SYSTEM_NAME2 MATCHES "CYGWIN" ) message( STATUS "This is the Windows CMake running within the cygwin platform." ) diff --git a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake index 08f68eeb315..7d35835f7db 100644 --- a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake +++ b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake @@ -40,6 +40,7 @@ if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED ) # From james Bigler, in the cmake users list. IF (APPLE) execute_process(COMMAND uname -v + OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE DARWIN_VERSION) string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION}) message(STATUS "Running in macOS DARWIN_VERSION=${DARWIN_VERSION}") diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index d2baa65da87..62bd37f80fd 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -14,6 +14,7 @@ foreach(file ${files}) if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") execute_process( COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" + OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE rm_out RESULT_VARIABLE rm_retval )