mirror of
https://github.com/FEX-Emu/FEX.git
synced 2024-12-04 04:22:25 +00:00
26ba8079a3
Following guidance from cmake's FAQ: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake Due to some of the special handling that we do with installs, we need to do additional uninstall handling that the install manifest doesn't cover. Specifically we need to add additional uninstall targets for: - FEXInterpreter - binfmt_misc - guest_thunks (Doing its own uninstall target, so passthrough) While it isn't generally advised to install and uninstall through source systems, this is something that users want to do all the time. This has been asked for a couple of times now. Fixes #1592
22 lines
852 B
CMake
22 lines
852 B
CMake
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
|
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
|
|
endif()
|
|
|
|
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
|
string(REGEX REPLACE "\n" ";" files "${files}")
|
|
foreach(file ${files})
|
|
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
|
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
|
exec_program(
|
|
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
|
OUTPUT_VARIABLE rm_out
|
|
RETURN_VALUE rm_retval
|
|
)
|
|
if(NOT "${rm_retval}" STREQUAL 0)
|
|
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
|
endif()
|
|
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
|
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
|
endif()
|
|
endforeach()
|