Fixed bug 3867 - Can't find install_manifest.txt when running 'uninstall' target
authorSam Lantinga <slouken@libsdl.org>
Thu, 12 Oct 2017 08:44:45 -0700
changeset 11605b914622c734e
parent 11604 634c34c79fbc
child 11606 a54e7ade4382
Fixed bug 3867 - Can't find install_manifest.txt when running 'uninstall' target

Steve Robinson

When I try to build the 'uninstall' target in CMake when SDL2 is added to a subdirectory of my project, I get this error:

1>CMake Error at cmake_uninstall.cmake:2 (message):
1> Cannot find install manifest:
1> "D:/Code/sdl2-tutorial/_build/3rdparty/SDL2/SDL2-2.0.6/install_manifest.txt"

The install_manifest.txt is actually in the top-level binary directory, not the project-specific binary directory.

To fix it, change all instances of:
CMAKE_CURRENT_BINARY_DIR

To:
CMAKE_BINARY_DIR

In:
cmake_uninstall.cmake.in
cmake_uninstall.cmake.in
     1.1 --- a/cmake_uninstall.cmake.in	Thu Oct 12 08:41:11 2017 -0700
     1.2 +++ b/cmake_uninstall.cmake.in	Thu Oct 12 08:44:45 2017 -0700
     1.3 @@ -1,8 +1,8 @@
     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 +if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
     1.8 +    message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"")
     1.9 +endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
    1.10  
    1.11 -file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
    1.12 +file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
    1.13  string(REGEX REPLACE "\n" ";" files "${files}")
    1.14  foreach (file ${files})
    1.15      message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")