anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / networking / ids / zeek / broker / 0001-Fix-include-path-in-exported-CMake-targets.patch
blob07b95960ef857be1d82143080cccbdaab0dc9f6c
1 From 889ee4dd9e778511e2fb850e6467f55a331cded9 Mon Sep 17 00:00:00 2001
2 From: Tobias Mayer <tobim@fastmail.fm>
3 Date: Sun, 13 Nov 2022 19:06:00 +0100
4 Subject: [PATCH] Fix include path in exported CMake targets
6 ---
7 CMakeLists.txt | 23 ++++++++++++++---------
8 1 file changed, 14 insertions(+), 9 deletions(-)
10 diff --git a/CMakeLists.txt b/CMakeLists.txt
11 index e22b77aa..77a15314 100644
12 --- a/CMakeLists.txt
13 +++ b/CMakeLists.txt
14 @@ -209,7 +209,6 @@ if (CAF_ROOT)
15 else()
16 find_package(CAF REQUIRED COMPONENTS openssl test io core net)
17 endif()
18 - list(APPEND LINK_LIBS CAF::core CAF::io CAF::net)
19 set(BROKER_USE_EXTERNAL_CAF ON)
20 else ()
21 message(STATUS "Using bundled CAF")
22 @@ -243,22 +242,18 @@ endif ()
24 # Make sure there are no old header versions on disk.
25 install(
26 - CODE "MESSAGE(STATUS \"Removing: ${CMAKE_INSTALL_PREFIX}/include/broker\")"
27 - CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}/include/broker\")")
28 + CODE "MESSAGE(STATUS \"Removing: ${CMAKE_FULL_INSTALL_INCLUDEDIR}/broker\")"
29 + CODE "file(REMOVE_RECURSE \"${CMAKE_FULL_INSTALL_INCLUDEDIR}/broker\")")
31 # Install all headers except the files from broker/internal.
32 install(DIRECTORY include/broker
33 - DESTINATION include
34 + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
35 FILES_MATCHING PATTERN "*.hh"
36 PATTERN "include/broker/internal" EXCLUDE)
38 -include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
40 -include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
42 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.hh.in
43 ${CMAKE_CURRENT_BINARY_DIR}/include/broker/config.hh)
44 -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/broker/config.hh DESTINATION include/broker)
45 +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/broker/config.hh DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/broker")
47 if (NOT BROKER_EXTERNAL_SQLITE_TARGET)
48 include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty)
49 @@ -360,6 +355,11 @@ if (ENABLE_SHARED)
50 OUTPUT_NAME broker)
51 target_link_libraries(broker PUBLIC ${LINK_LIBS})
52 target_link_libraries(broker PRIVATE CAF::core CAF::io CAF::net)
53 + target_include_directories(
54 + broker PUBLIC
55 + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
56 + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
57 + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
58 install(TARGETS broker
59 EXPORT BrokerTargets
60 DESTINATION ${CMAKE_INSTALL_LIBDIR})
61 @@ -373,6 +373,11 @@ if (ENABLE_STATIC)
62 endif()
63 target_link_libraries(broker_static PUBLIC ${LINK_LIBS})
64 target_link_libraries(broker_static PRIVATE CAF::core CAF::io CAF::net)
65 + target_include_directories(
66 + broker_static PUBLIC
67 + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
68 + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
69 + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
70 install(TARGETS broker_static
71 EXPORT BrokerTargets
72 DESTINATION ${CMAKE_INSTALL_LIBDIR})
73 --
74 2.38.1