mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
cmake_uninstall - simplify by using common variable
This commit is contained in:
@@ -25,13 +25,14 @@ file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
|||||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||||
|
|
||||||
foreach(file ${files})
|
foreach(file ${files})
|
||||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
set(filepath "$ENV{DESTDIR}${file}")
|
||||||
|
message(STATUS "Uninstalling ${filepath}")
|
||||||
|
|
||||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
if(IS_SYMLINK "${filepath}" OR EXISTS "${filepath}")
|
||||||
exec_program(
|
exec_program(
|
||||||
"@CMAKE_COMMAND@"
|
"@CMAKE_COMMAND@"
|
||||||
ARGS
|
ARGS
|
||||||
"-E remove \"$ENV{DESTDIR}${file}\""
|
"-E remove \"${filepath}\""
|
||||||
OUTPUT_VARIABLE
|
OUTPUT_VARIABLE
|
||||||
rm_out
|
rm_out
|
||||||
RETURN_VALUE
|
RETURN_VALUE
|
||||||
@@ -39,9 +40,9 @@ foreach(file ${files})
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(NOT "${rm_retval}" STREQUAL 0)
|
if(NOT "${rm_retval}" STREQUAL 0)
|
||||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
message(FATAL_ERROR "Problem when removing ${filepath}")
|
||||||
endif()
|
endif()
|
||||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
else(IS_SYMLINK "${filepath}" OR EXISTS "${filepath}")
|
||||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
message(STATUS "File ${filepath} does not exist.")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|||||||
Reference in New Issue
Block a user