mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
Added uninstall target
This commit is contained in:
parent
f3f395e30e
commit
3b459c368c
7 changed files with 56 additions and 10 deletions
|
@ -1,4 +1,7 @@
|
|||
######################################################################## ## CMake Configuration
|
||||
project(Bro)
|
||||
|
||||
########################################################################
|
||||
## CMake Configuration
|
||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
|
||||
# Prohibit in-source builds.
|
||||
|
@ -8,19 +11,27 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
|||
"initialize the build configuration.")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
||||
# uninstall target
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
@ONLY)
|
||||
|
||||
add_custom_target(uninstall COMMAND
|
||||
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
endif ()
|
||||
|
||||
########################################################################
|
||||
## Project/Build Configuration
|
||||
|
||||
project(Bro)
|
||||
|
||||
set(BRO_ROOT_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
if (NOT POLICYDIR)
|
||||
set(POLICYDIR ${BRO_ROOT_DIR}/share/bro)
|
||||
endif ()
|
||||
|
||||
file(STRINGS "${CMAKE_SOURCE_DIR}/VERSION" VERSION LIMIT_COUNT 1)
|
||||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VERSION LIMIT_COUNT 1)
|
||||
|
||||
set(EXTRA_COMPILE_FLAGS "-Wall -Wno-unused")
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 9886b3d16447bd7c8575b8b4a190767183a6d1a7
|
||||
Subproject commit 2a97dd5ff19cc864cebd1b7687945857dadf96b3
|
|
@ -1 +1 @@
|
|||
Subproject commit ac747bc3c3d64fa963e4b2238df7441af4d513b5
|
||||
Subproject commit b23a5d561440514b50efe9c9a005e390dea3d1d5
|
|
@ -1 +1 @@
|
|||
Subproject commit 7ec41e3af3009c468d70b22fda143ba4dc1c151c
|
||||
Subproject commit 9fccc65e065c490c0689393ddf1b4d6b8d1f1831
|
|
@ -1 +1 @@
|
|||
Subproject commit 0a0aa63ff38fbb7b2b85cbdbc922c92c2c94c124
|
||||
Subproject commit 5a2c50336b9e6abecdd3771c6189ab5824bc3c8a
|
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 ()
|
|
@ -1,4 +1,4 @@
|
|||
install(DIRECTORY . DESTINATION ${POLICYDIR} FILES_MATCHING
|
||||
install(DIRECTORY ./ DESTINATION ${POLICYDIR} FILES_MATCHING
|
||||
PATTERN "summaries" EXCLUDE
|
||||
PATTERN "all.bro" EXCLUDE
|
||||
PATTERN "bro.init"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue