]> git.mxchange.org Git - flightgear.git/blob - CMakeModules/cmake_uninstall.cmake.in
Fixing launcher save/restore of settings.
[flightgear.git] / CMakeModules / cmake_uninstall.cmake.in
1 IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
2     MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
3 ENDIF()
4
5 FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
6 STRING(REGEX REPLACE "\n" ";" files "${files}")
7
8 FOREACH(file ${files})
9     MESSAGE(STATUS "Uninstalling \"${file}\"")
10     IF(EXISTS "${file}")
11         EXEC_PROGRAM(
12             "@CMAKE_COMMAND@" ARGS "-E remove \"${file}\""
13             OUTPUT_VARIABLE rm_out
14             RETURN_VALUE rm_retval
15             )
16         IF(NOT "${rm_retval}" STREQUAL 0)
17             MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"")
18         ENDIF()
19     ELSE()
20         MESSAGE(STATUS "File \"${file}\" does not exist.")
21     ENDIF()
22 ENDFOREACH()