This repository has been archived by the owner on Mar 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
68 lines (56 loc) · 1.7 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 3.12.4)
if($ENV{TRAVIS_BUILD_NUMBER})
set(VERSION 0.0.$ENV{TRAVIS_BUILD_NUMBER})
else()
set(VERSION 0.0.0)
endif()
project(ip_filter VERSION ${VERSION})
set(CMAKE_CXX_STANDARD 17)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
set(SRC_PATH "src/")
set(TEST_PATH "test/")
include_directories("inc/")
add_library(
ip_filter_obj
${SRC_PATH}/ipv4_address.cpp
${SRC_PATH}/helpers.cpp)
target_link_libraries(ip_filter_obj ${CONAN_LIBS_RANGE-V3})
add_executable(ip_filter ${SRC_PATH}/main.cpp)
target_link_libraries(ip_filter ip_filter_obj)
add_executable(ip_filter_rng ${SRC_PATH}/main_rng.cpp)
target_link_libraries(ip_filter_rng ip_filter_obj)
add_executable(profiling ${SRC_PATH}/profiling.cpp)
target_link_libraries(profiling ip_filter_obj ${CONAN_LIBS_RANGE-V3})
add_executable(test_suite ${TEST_PATH}/test.cpp)
target_link_libraries(
test_suite
PRIVATE
ip_filter_obj
${CONAN_LIBS_GTEST})
enable_testing()
add_test(test_suite bin/test_suite)
if(UNIX)
set(TESTING_BINARY ip_filter)
configure_file(
${CMAKE_SOURCE_DIR}/${TEST_PATH}/hash.sh.in
bin/hash.sh
@ONLY)
set(TESTING_BINARY ip_filter_rng)
configure_file(
${CMAKE_SOURCE_DIR}/${TEST_PATH}/hash.sh.in
bin/hash_rng.sh
@ONLY)
enable_testing()
add_test(
NAME integration_test
COMMAND "bash" "bin/hash.sh")
add_test(
NAME integration_test_rng
COMMAND "bash" "bin/hash_rng.sh")
endif()
install(TARGETS ip_filter RUNTIME DESTINATION bin)
set(CPACK_GENERATOR DEB)
set(CPACK_PACKAGE_CONTACT [email protected])
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.15)")
include(CPack)