diff options
Diffstat (limited to 'cmake/UninstallHelper.cmake')
-rw-r--r-- | cmake/UninstallHelper.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/UninstallHelper.cmake b/cmake/UninstallHelper.cmake new file mode 100644 index 0000000000..9a3d30af59 --- /dev/null +++ b/cmake/UninstallHelper.cmake @@ -0,0 +1,13 @@ +if(NOT EXISTS "${CMAKE_BINARY_DIR}/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: ${CMAKE_BINARY_DIR}/install_manifest.txt") +endif() + +file(STRINGS "${CMAKE_BINARY_DIR}/install_manifest.txt" files) +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + file(REMOVE $ENV{DESTDIR}${file}) + else() + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif() +endforeach() |