-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathCMakeLists.txt
42 lines (33 loc) · 990 Bytes
/
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
cmake_minimum_required(VERSION 3.0)
project(sysrepo-interfaces-plugins C)
include(CompileOptions.cmake)
set(PLUGIN 0 CACHE BOOL "Build a plugin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
include_directories(
${CMAKE_SOURCE_DIR}/src/
${CMAKE_SOURCE_DIR}/deps/uthash/include/
)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules")
find_package(SYSREPO REQUIRED)
find_package(LIBYANG REQUIRED)
find_package(SRPC REQUIRED)
find_package(NL REQUIRED)
include_directories(
${SYSREPO_INCLUDE_DIRS}
${LIBYANG_INCLUDE_DIRS}
${SRPC_INCLUDE_DIRS}
${NL_INCLUDE_DIRS}
)
option(INTERFACES_PLUGIN "Enable interfaces plugin" OFF)
option(ROUTING_PLUGIN "Enable interfaces plugin" OFF)
if(INTERFACES_PLUGIN)
add_subdirectory(src/interfaces)
endif()
if(ROUTING_PLUGIN)
add_subdirectory(src/routing)
endif()
if(ENABLE_BUILD_TESTS)
find_package(CMOCKA REQUIRED)
include(CTest)
include(tests/Tests.cmake)
endif()