| 1 |
if(WIN32) |
| 2 |
message(STATUS "Uninstalling \"@EXEC_INSTALL_PREFIX@\"") |
| 3 |
exec_program( |
| 4 |
"@CMAKE_COMMAND@" ARGS "-E remove_directory \"@EXEC_INSTALL_PREFIX@\"" |
| 5 |
OUTPUT_VARIABLE rm_out |
| 6 |
RETURN_VALUE rm_retval |
| 7 |
) |
| 8 |
if(NOT "${rm_retval}" STREQUAL 0) |
| 9 |
message(FATAL_ERROR "Problem when removing \"@EXEC_INSTALL_PREFIX@\"") |
| 10 |
endif(NOT "${rm_retval}" STREQUAL 0) |
| 11 |
else(WIN32) |
| 12 |
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") |
| 13 |
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") |
| 14 |
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") |
| 15 |
|
| 16 |
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) |
| 17 |
string(REGEX REPLACE "\n" ";" files "${files}") |
| 18 |
foreach(file ${files}) |
| 19 |
message(STATUS "Uninstalling $ENV{DESTDIR}${file}") |
| 20 |
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") |
| 21 |
exec_program( |
| 22 |
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" |
| 23 |
OUTPUT_VARIABLE rm_out |
| 24 |
RETURN_VALUE rm_retval |
| 25 |
) |
| 26 |
if(NOT "${rm_retval}" STREQUAL 0) |
| 27 |
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") |
| 28 |
endif(NOT "${rm_retval}" STREQUAL 0) |
| 29 |
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") |
| 30 |
message(STATUS "File $ENV{DESTDIR}${file} does not exist.") |
| 31 |
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") |
| 32 |
endforeach(file) |
| 33 |
|
| 34 |
#remove directories |
| 35 |
message(STATUS "Uninstalling \"@SYSCONF_INSTALL_DIR@\"") |
| 36 |
exec_program( |
| 37 |
"@CMAKE_COMMAND@" ARGS "-E remove_directory \"@SYSCONF_INSTALL_DIR@\"" |
| 38 |
OUTPUT_VARIABLE rm_out |
| 39 |
RETURN_VALUE rm_retval |
| 40 |
) |
| 41 |
if(NOT "${rm_retval}" STREQUAL 0) |
| 42 |
message(FATAL_ERROR "Problem when removing \"@SYSCONF_INSTALL_DIR@\"") |
| 43 |
endif(NOT "${rm_retval}" STREQUAL 0) |
| 44 |
message(STATUS "Uninstalling \"@LOCALSTATE_INSTALL_DIR@\"") |
| 45 |
exec_program( |
| 46 |
"@CMAKE_COMMAND@" ARGS "-E remove_directory \"@LOCALSTATE_INSTALL_DIR@\"" |
| 47 |
OUTPUT_VARIABLE rm_out |
| 48 |
RETURN_VALUE rm_retval |
| 49 |
) |
| 50 |
if(NOT "${rm_retval}" STREQUAL 0) |
| 51 |
message(FATAL_ERROR "Problem when removing \"@LOCALSTATE_INSTALL_DIR@\"") |
| 52 |
endif(NOT "${rm_retval}" STREQUAL 0) |
| 53 |
endif(WIN32) |