mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +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}")
|
||||
|
||||
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(
|
||||
"@CMAKE_COMMAND@"
|
||||
ARGS
|
||||
"-E remove \"$ENV{DESTDIR}${file}\""
|
||||
"-E remove \"${filepath}\""
|
||||
OUTPUT_VARIABLE
|
||||
rm_out
|
||||
RETURN_VALUE
|
||||
@@ -39,9 +40,9 @@ foreach(file ${files})
|
||||
)
|
||||
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
message(FATAL_ERROR "Problem when removing ${filepath}")
|
||||
endif()
|
||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
else(IS_SYMLINK "${filepath}" OR EXISTS "${filepath}")
|
||||
message(STATUS "File ${filepath} does not exist.")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
Reference in New Issue
Block a user