From: Shravan Rangarajuvenkata (shrarang) Date: Sun, 1 Aug 2021 20:03:56 +0000 (+0000) Subject: Merge pull request #2036 in SNORT/snort3 from ~SHRARANG/snort3:reorg_dynamic_libs... X-Git-Tag: 3.1.10.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4e50d7d9029fe0d4ea04561563976fa75655625;p=thirdparty%2Fsnort3.git Merge pull request #2036 in SNORT/snort3 from ~SHRARANG/snort3:reorg_dynamic_libs to master Squashed commit of the following: commit 7880c187fb22613cf9d8e3910146b58a3cbbbc30 Author: Shravan Rangaraju Date: Fri Feb 28 15:49:30 2020 -0500 build: install DAQ modules and Snort plugins in separate folders --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 542395af8..4c349f5a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,8 @@ include (${CMAKE_MODULE_PATH}/sanity_checks.cmake) set (INSTALL_SUFFIX "${CMAKE_PROJECT_NAME}") set (INCLUDE_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/${INSTALL_SUFFIX}") -set (PLUGIN_INSTALL_PATH "${CMAKE_INSTALL_LIBDIR}/${INSTALL_SUFFIX}") +set (LIB_INSTALL_PATH "${CMAKE_INSTALL_LIBDIR}/${INSTALL_SUFFIX}") +set (PLUGIN_INSTALL_PATH "${LIB_INSTALL_PATH}/plugins") configure_file ( "${PROJECT_SOURCE_DIR}/config.cmake.h.in" diff --git a/cmake/macros.cmake b/cmake/macros.cmake index df6030e71..2d601d36f 100644 --- a/cmake/macros.cmake +++ b/cmake/macros.cmake @@ -28,6 +28,32 @@ macro (add_dynamic_module libname install_path) ) endmacro (add_dynamic_module) +macro (add_dynamic_daq_module libname ) + set (sources ${ARGN}) + + add_library ( ${libname} MODULE ${sources} ) + set_target_properties ( + ${libname} + PROPERTIES + COMPILE_FLAGS "-DBUILDING_SO" + PREFIX "" + ) + + if (APPLE) + set_target_properties ( + ${libname} + PROPERTIES + LINK_FLAGS "-undefined dynamic_lookup" + ) + endif() + + install ( + TARGETS ${libname} + LIBRARY + DESTINATION "${LIB_INSTALL_PATH}/daq" + ) +endmacro (add_dynamic_daq_module) + function (add_cpputest testname) if ( ENABLE_UNIT_TESTS ) diff --git a/daqs/CMakeLists.txt b/daqs/CMakeLists.txt index 98e67be22..e63c64cba 100644 --- a/daqs/CMakeLists.txt +++ b/daqs/CMakeLists.txt @@ -1,5 +1,5 @@ macro ( add_daq_module libname ) - add_dynamic_module ( ${libname} daqs ${ARGN} ) + add_dynamic_daq_module ( ${libname} ${ARGN} ) endmacro ( add_daq_module ) set ( DAQS_HEADERS daq_user.h ) @@ -16,5 +16,5 @@ add_daq_module ( daq_file daq_file.c ) add_daq_module ( daq_hext daq_hext.c ) install (FILES ${DAQS_HEADERS} - DESTINATION "${INCLUDE_INSTALL_PATH}/daqs" + DESTINATION "${INCLUDE_INSTALL_PATH}/daq" )