cmake/cmake_uninstall.cmake.in

23 lines
789 B
CMake
Raw Normal View History

2013-03-16 19:13:01 +02:00
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
endif()
2013-03-16 19:13:01 +02:00
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
2015-04-27 22:25:09 +02:00
string(REPLACE "\n" ";" files "${files}")
2013-03-16 19:13:01 +02:00
foreach(file ${files})
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
if(EXISTS "$ENV{DESTDIR}${file}")
exec_program(
2020-08-30 11:54:41 +02:00
"@CMAKE_COMMAND@" ARGS "-E rm -f \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
2013-03-16 19:13:01 +02:00
if("${rm_retval}" STREQUAL 0)
else()
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
endif()
else()
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
endif()
endforeach()