-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
64 lines (45 loc) · 1.48 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
cmake_minimum_required(VERSION 3.12)
project(avuna-dnsd C)
set(CMAKE_VERBOSE_MAKEFILE on)
set(CMAKE_C_STANDARD 11)
option(MYSQL "Builds MySQL support" ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-discarded-qualifiers")
if (MYSQL)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSUPPORTS_MYSQL")
endif()
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -fno-omit-frame-pointer")
file(GLOB dnsd_src
"src/*.h"
"src/*.c"
)
file(GLOB lib_src
"lib/src/*.h"
"lib/src/*.c"
)
add_executable(avuna-dnsd ${dnsd_src})
target_link_libraries(avuna-dnsd -lavuna-util -lpthread avuna-dns)
target_include_directories(avuna-dnsd PRIVATE lib/include/)
if (MYSQL)
target_link_libraries(avuna-dnsd -lmysqlclient)
endif()
add_library(avuna-dns SHARED ${lib_src})
target_link_libraries(avuna-dns -lavuna-util)
target_include_directories(avuna-dns PUBLIC lib/include/)
install(TARGETS avuna-dns
LIBRARY DESTINATION lib)
install(TARGETS avuna-dnsd
RUNTIME DESTINATION bin)
file(GLOB export_headers
"lib/include/avuna/*.h"
)
install(FILES ${export_headers} DESTINATION "include/avuna/")
set(CPACK_DEBIAN_PACKAGE_NAME avunadnsd)
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_PACKAGE_VERSION 3.0.0)
if (MYSQL)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libmysqlclient20 (>= 5.7.25), avunautils (>= 1.0.0)")
endif()
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Max Bruce")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Adaptable authoritative nameserver")
set(CPACK_GENERATOR DEB)
include(CPack)