replace deprecated exec_program with execute_process and fix syntax error

https://cmake.org/cmake/help/v3.1/command/exec_program.html
This commit is contained in:
Eisuke Kawashima 2022-07-06 09:14:48 +09:00
parent 2f34bda337
commit 08ecaf41cc
No known key found for this signature in database
GPG Key ID: 17966AFD52EC0C3D
2 changed files with 5 additions and 5 deletions

View File

@ -296,7 +296,7 @@ if(NOT MSVC)
set(HAVE_GCC_VISIBILITY ${HAVE_GCC_VISIBILITY} CACHE BOOL "GCC support for hidden visibility")
set(_GCC_COMPILED_WITH_BAD_ALLOCATOR FALSE)
if(GCC_IS_NEWER_THAN_4_1)
exec_program(${CMAKE_C_COMPILER} ARGS -v OUTPUT_VARIABLE _gcc_alloc_info)
execute_process(COMMAND ${CMAKE_C_COMPILER} -v OUTPUT_VARIABLE _gcc_alloc_info)
string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)" _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_alloc_info}")
endif()
if(HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_2 AND ENABLE_SYMBOL_VISIBILITY

View File

@ -1,5 +1,5 @@
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
MESSAGE(FATAL_ERROR "Cannot find install manifest: "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt"")
MESSAGE(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
@ -7,10 +7,10 @@ STRING(REGEX REPLACE "\n" ";" files "${files}")
FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling $ENV{DESTDIR}${file}")
IF(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}")