-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
CMakeLists.txt
50 lines (38 loc) · 1.1 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
cmake_minimum_required(VERSION 3.12)
project(apfree-wifidog
VERSION 1.0.0
DESCRIPTION "ApFree WiFiDog"
LANGUAGES C)
INCLUDE(GNUInstallDirs)
# Set C standard and module path
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
# Options
option(AW_DEBUG "Build with debug support" OFF)
option(AW_FW3 "Build with iptables support" OFF)
# Find requried headers file
find_package(PkgConfig REQUIRED)
find_path(UCI_INCLUDE_DIRS uci.h)
# Find dependencies using pkg-config
pkg_check_modules(LIBEVENT REQUIRED libevent)
pkg_check_modules(OPENSSL REQUIRED openssl)
pkg_check_modules(JSONC REQUIRED json-c)
pkg_check_modules(MOSQUITTO REQUIRED libmosquitto)
pkg_check_modules(NFQUEUE REQUIRED libnetfilter_queue)
if (NOT AW_FW3)
pkg_check_modules(NFTNL REQUIRED libnftnl)
pkg_check_modules(MNL REQUIRED libmnl)
endif()
# Set installation directory
if(NOT DEFINED LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR lib)
endif()
# Include directories
include_directories(
${JSONC_INCLUDE_DIRS}
${UCI_INCLUDE_DIRS}
${LIBEVENT_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIRS}
)
# Add subdirectories
add_subdirectory(src)