-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
62 lines (51 loc) · 2.2 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
cmake_minimum_required(VERSION 2.8.3)
project(L3ROAMD C)
INCLUDE(FindPkgConfig)
IF(NOT PKG_CONFIG_FOUND)
MESSAGE(FATAL_ERROR "Error: pkg-config not found on this system")
ENDIF(NOT PKG_CONFIG_FOUND)
MESSAGE(STATUS "")
MESSAGE(STATUS "Configuring libnl ...")
PKG_SEARCH_MODULE(LIBNL-TINY libnl-tiny)
IF(LIBNL-TINY_FOUND)
INCLUDE_DIRECTORIES(${LIBNL-TINY_INCLUDE_DIRS})
LINK_DIRECTORIES(${LIBNL-TINY_LIBRARY_DIRS})
SET(LIBNL_LIBRARIES ${LIBNL-TINY_LIBRARIES})
ELSE(LIBNL-TINY_FOUND)
PKG_SEARCH_MODULE(LIBNL libnl>=2.0 libnl-2.0 libnl-2)
IF(LIBNL_FOUND)
INCLUDE_DIRECTORIES(${LIBNL_INCLUDE_DIRS})
LINK_DIRECTORIES(${LIBNL_LIB_DIRS})
LIST(APPEND LIBNL_LIBRARIES
nl-genl
)
ELSE(LIBNL_FOUND)
PKG_SEARCH_MODULE(LIBNL3 libnl-3 libnl-3.0 libnl-3.1)
IF(LIBNL3_FOUND)
INCLUDE_DIRECTORIES(${LIBNL3_INCLUDE_DIRS})
LINK_DIRECTORIES(${LIBNL3_LIB_DIRS})
SET(LIBNL_LIBRARIES ${LIBNL3_LIBRARIES})
#############################################################
MESSAGE(STATUS "")
MESSAGE(STATUS "Configuring libnl-genl ...")
PKG_SEARCH_MODULE(LIBNL_GENL libnl-genl>=2.0 libnl-genl-3 libnl-genl-3.0 libnl-genl-3.1)
IF(LIBNL_GENL_FOUND)
INCLUDE_DIRECTORIES(${LIBNL_GENL_INCLUDE_DIRS})
LINK_DIRECTORIES(${LIBNL_GENL_LIB_DIRS})
ELSEIF(LIBNL_GENL_FOUND)
MESSAGE(FATAL_ERROR "Error: libnl-genl not found")
ENDIF(LIBNL_GENL_FOUND)
ELSE(LIBNL3_FOUND)
MESSAGE(FATAL_ERROR "Error: libnl and libnl-genl not found")
ENDIF(LIBNL3_FOUND)
ENDIF(LIBNL_FOUND)
ENDIF(LIBNL-TINY_FOUND)
pkg_check_modules(_JSON_C json-c)
find_path(JSON_C_INCLUDE_DIR NAMES json-c/json.h HINTS ${_JSON_C_INCLUDE_DIRS})
find_library(JSON_C_LIBRARIES NAMES json-c HINTS ${_JSON_C_LIBRARY_DIRS})
set(JSON_C_CFLAGS_OTHER "${_JSON_C_CFLAGS_OTHER}" CACHE STRING "Additional compiler flags for json-c")
set(JSON_C_LDFLAGS_OTHER "${_JSON_C_LDFLAGS_OTHER}" CACHE STRING "Additional linker flags for json-c")
find_package_handle_standard_args(JSON_C REQUIRED_VARS JSON_C_LIBRARIES JSON_C_INCLUDE_DIR)
mark_as_advanced(JSON_C_INCLUDE_DIR JSON_C_LIBRARIES JSON_C_CFLAGS_OTHER JSON_C_LDFLAGS_OTHER)
set(CMAKE_MODULE_PATH ${L3ROAMD_SOURCE_DIR})
add_subdirectory(src)