mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Added uninstall target
This commit is contained in:
parent
f3f395e30e
commit
3b459c368c
7 changed files with 56 additions and 10 deletions
35
cmake/cmake_uninstall.cmake.in
Normal file
35
cmake/cmake_uninstall.cmake.in
Normal file
|
@ -0,0 +1,35 @@
|
|||
function(uninstall_manifest manifestPath)
|
||||
file(READ "${manifestPath}" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach (file ${files})
|
||||
set(fileName $ENV{DESTDIR}${file})
|
||||
|
||||
if (EXISTS "${fileName}" OR IS_SYMLINK "${fileName}")
|
||||
message(STATUS "Uninstalling: ${fileName}")
|
||||
|
||||
execute_process(
|
||||
COMMAND @CMAKE_COMMAND@ -E remove "${fileName}"
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RESULT_VARIABLE rm_retval
|
||||
)
|
||||
|
||||
if (NOT ${rm_retval} EQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing: ${fileName}")
|
||||
endif ()
|
||||
else ()
|
||||
message(STATUS "Does not exist: ${fileName}")
|
||||
endif ()
|
||||
|
||||
endforeach ()
|
||||
endfunction(uninstall_manifest)
|
||||
|
||||
file(GLOB install_manifests @CMAKE_CURRENT_BINARY_DIR@/install_manifest*.txt)
|
||||
|
||||
if (install_manifests)
|
||||
foreach (manifest ${install_manifests})
|
||||
uninstall_manifest(${manifest})
|
||||
endforeach ()
|
||||
else ()
|
||||
message(FATAL_ERROR "Cannot find any install manifests in: "
|
||||
"\"@CMAKE_CURRENT_BINARY_DIR@/install_manifest*.txt\"")
|
||||
endif ()
|
Loading…
Add table
Add a link
Reference in a new issue