Add external dependency include paths to zeek-config --include_dir

Addresses https://github.com/zeek/zeek/issues/1180

This helps ensure successful compilation of a plugin that includes a
Zeek header which includes an external dependency header even if the
plugin itself doesn't necessarily depend on that external library.
This commit is contained in:
Jon Siwek 2020-09-24 13:05:57 -07:00
parent 837999d1a7
commit f96e10da75
3 changed files with 39 additions and 1 deletions

View file

@ -472,6 +472,34 @@ else ()
set(ZEEK_CONFIG_BROKER_ROOT_DIR ${ZEEK_ROOT_DIR})
endif ()
if ( PCAP_INCLUDE_DIR )
set(ZEEK_CONFIG_PCAP_INCLUDE_DIR ${PCAP_INCLUDE_DIR})
endif ()
if ( BIND_INCLUDE_DIR )
set(ZEEK_CONFIG_BIND_INCLUDE_DIR ${BIND_INCLUDE_DIR})
endif ()
if ( ZLIB_INCLUDE_DIR )
set(ZEEK_CONFIG_ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIR})
endif ()
if ( JEMALLOC_INCLUDE_DIR )
set(ZEEK_CONFIG_JEMALLOC_INCLUDE_DIR ${JEMALLOC_INCLUDE_DIR})
endif ()
if ( OPENSSL_INCLUDE_DIR )
set(ZEEK_CONFIG_OPENSSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR})
endif ()
if ( LibMMDB_INCLUDE_DIR )
set(ZEEK_CONFIG_LibMMDB_INCLUDE_DIR ${LibMMDB_INCLUDE_DIR})
endif ()
if ( LibKrb5_INCLUDE_DIR )
set(ZEEK_CONFIG_LibKrb5_INCLUDE_DIR ${LibKrb5_INCLUDE_DIR})
endif ()
if ( GooglePerftools_INCLUDE_DIR )
set(ZEEK_CONFIG_GooglePerftools_INCLUDE_DIR ${GooglePerftools_INCLUDE_DIR})
endif ()
if ( FTS_INCLUDE_DIR )
set(ZEEK_CONFIG_FTS_INCLUDE_DIR ${FTS_INCLUDE_DIR})
endif ()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zeek-config.in
${CMAKE_CURRENT_BINARY_DIR}/zeek-config @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/zeek-config DESTINATION bin)

2
cmake

@ -1 +1 @@
Subproject commit 153496bbe4c87d5577aafb947447e5f32383c7eb
Subproject commit d28e94d1ea1fba823e97dabf21d8ac02d60491b8

View file

@ -17,6 +17,16 @@ binpac_root=@ZEEK_CONFIG_BINPAC_ROOT_DIR@
caf_root=@ZEEK_CONFIG_CAF_ROOT_DIR@
broker_root=@ZEEK_CONFIG_BROKER_ROOT_DIR@
include_dir=${include_dir}:@ZEEK_CONFIG_PCAP_INCLUDE_DIR@
include_dir=${include_dir}:@ZEEK_CONFIG_BIND_INCLUDE_DIR@
include_dir=${include_dir}:@ZEEK_CONFIG_ZLIB_INCLUDE_DIR@
include_dir=${include_dir}:@ZEEK_CONFIG_JEMALLOC_INCLUDE_DIR@
include_dir=${include_dir}:@ZEEK_CONFIG_OPENSSL_INCLUDE_DIR@
include_dir=${include_dir}:@ZEEK_CONFIG_LibMMDB_INCLUDE_DIR@
include_dir=${include_dir}:@ZEEK_CONFIG_LibKrb5_INCLUDE_DIR@
include_dir=${include_dir}:@ZEEK_CONFIG_GooglePerftools_INCLUDE_DIR@
include_dir=${include_dir}:@ZEEK_CONFIG_FTS_INCLUDE_DIR@
usage="\
Usage: zeek-config [--version] [--build_type] [--prefix] [--script_dir] [--site_dir] [--plugin_dir] [--config_dir] [--python_dir] [--include_dir] [--cmake_dir] [--zeekpath] [--zeek_dist] [--binpac_root] [--caf_root] [--broker_root]"