summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-09-18 23:53:41 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-09-19 11:30:55 +0200
commit7829bfe4e6ae433120b2f4bc95d8ab5018f67e90 (patch)
treefd67303fa8364c9fd3a37884a3d54e6b3b7169da /CMakeLists.txt
parent4fa1694b0514042404ef7efa801addc2f624cf37 (diff)
CI extended and fixups
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 7 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a61af0a8..8952708b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,11 @@ option(ENABLE_ZLIB "Enable zlib support for nDPId (experimental)." OFF)
option(BUILD_EXAMPLES "Build C examples." ON)
option(BUILD_NDPI "Clone and build nDPI from github." OFF)
option(NDPI_NO_PKGCONFIG "Do not use pkgconfig to search for libnDPI." OFF)
+if(NOT STATIC_LIBNDPI_INSTALLDIR STREQUAL "" OR BUILD_NDPI OR NDPI_NO_PKGCONFIG)
+ option(NDPI_WITH_GCRYPT "Link static libndpi library against libgcrypt." ON)
+ option(NDPI_WITH_PCRE "Link static libndpi library against libpcre." OFF)
+ option(NDPI_WITH_MAXMINDDB "Link static libndpi library against libmaxminddb." OFF)
+endif()
set(STATIC_LIBNDPI_INSTALLDIR "" CACHE STRING "Path to a installation directory of libnDPI e.g. /opt/libnDPI/usr")
set(CROSS_COMPILE_TRIPLET "" CACHE STRING "Host triplet used to enable cross compiling.")
@@ -55,7 +60,7 @@ if(NOT CROSS_COMPILE_TRIPLET STREQUAL "")
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
endif()
-if(BUILD_NDPI)
+if(BUILD_NDPI AND NDPI_WITH_GCRYPT)
enable_testing()
add_test(NAME run_tests
COMMAND "${CMAKE_SOURCE_DIR}/test/run_tests.sh"
@@ -140,10 +145,6 @@ if(STATIC_LIBNDPI_INSTALLDIR STREQUAL "" AND BUILD_NDPI)
endif()
if(NOT STATIC_LIBNDPI_INSTALLDIR STREQUAL "" OR BUILD_NDPI OR NDPI_NO_PKGCONFIG)
- option(NDPI_WITH_GCRYPT "Link static libndpi library against libgcrypt." ON)
- option(NDPI_WITH_PCRE "Link static libndpi library against libpcre." OFF)
- option(NDPI_WITH_MAXMINDDB "Link static libndpi library against libmaxminddb." OFF)
-
if(NDPI_WITH_GCRYPT)
find_package(GCRYPT "1.4.2" REQUIRED)
endif()
@@ -221,7 +222,7 @@ if(BUILD_EXAMPLES)
"${CMAKE_SOURCE_DIR}/dependencies/uthash/src")
add_executable(nDPIsrvd-captured examples/c-captured/c-captured.c utils.c)
- if(STATIC_LIBNDPI_INSTALLDIR STREQUAL "" AND BUILD_NDPI)
+ if(BUILD_NDPI)
add_dependencies(nDPIsrvd-captured libnDPI)
endif()
target_compile_definitions(nDPIsrvd-captured PRIVATE ${NDPID_DEFS})