-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (40 loc) · 1.67 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
cmake_minimum_required(VERSION 3.22)
project(netconf_server C)
set(CMAKE_C_STANDARD 99)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wmissing-declarations")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--export-dynamic")
if (CMAKE_BUILD_TYPE STREQUAL Debug)
add_definitions(-DDEBUG_MODE)
endif ()
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/modules")
include_directories(include)
add_executable(netconf_server
src/message.h
src/netconf_server.c
src/log.h src/log.c
src/config.h src/config.c
src/method.h src/method.c
src/rpc_error.h src/rpc_error.c
src/connection.h src/connection.c
src/thread_pool.h src/thread_pool.c
include/netconf_server/module.h src/module.c
include/netconf_server/datastore.h src/datastore.c)
target_link_libraries(netconf_server ${CMAKE_DL_LIBS})
find_package(LIBROXML REQUIRED)
include_directories(${LIBROXML_INCLUDE_DIR})
target_link_libraries(netconf_server ${LIBROXML_LIBRARIES})
set(CMAKE_INSTALL_PREFIX /)
install(FILES config/netconf_server.xml DESTINATION etc/config)
install(TARGETS netconf_server RUNTIME DESTINATION usr/bin)
set(PLUGIN_INCLUDE_FILES
include/netconf_server/module.h
include/netconf_server/datastore.h)
install(FILES ${PLUGIN_INCLUDE_FILES} DESTINATION usr/include/netconf_server)
option(BUILD_EXAMPLE_PLUGINS "build example plugins" ON)
if (BUILD_EXAMPLE_PLUGINS)
add_subdirectory(plugin)
endif ()