cmake_uninstall.cmake.in
changeset 8874 48d4f2d74d67
child 11605 b914622c734e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/cmake_uninstall.cmake.in	Mon Jun 16 10:58:09 2014 -0300
     1.3 @@ -0,0 +1,18 @@
     1.4 +if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
     1.5 +    message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
     1.6 +endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
     1.7 +
     1.8 +file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
     1.9 +string(REGEX REPLACE "\n" ";" files "${files}")
    1.10 +foreach (file ${files})
    1.11 +    message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
    1.12 +    execute_process(
    1.13 +        COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
    1.14 +        OUTPUT_VARIABLE rm_out
    1.15 +        RESULT_VARIABLE rm_retval
    1.16 +    )
    1.17 +    if(NOT ${rm_retval} EQUAL 0)
    1.18 +        message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
    1.19 +    endif (NOT ${rm_retval} EQUAL 0)
    1.20 +endforeach(file)
    1.21 +