-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
51 lines (38 loc) · 1.39 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
cmake_minimum_required(VERSION 2.8)
PROJECT(sysrepo)
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-unused-variable -Wno-unused-function)
INCLUDE_DIRECTORIES(include)
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/modules")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
OPTION(TOOL_UMAAPID "build umaapid tool" OFF)
SET(CORE_INCLUDES
include/sysrepo/sysrepo.h
src/internal.h
)
SET(SOURCES
src/test/umaapi.c
src/test/ubus.c
src/test/ubus.h
)
SET(LIBRARY_SOURCES
src/libsysrepo.c
)
ADD_LIBRARY(libsysrepo SHARED ${LIBRARY_SOURCES} ${CORE_INCLUDES})
FIND_PACKAGE(LIBROXML REQUIRED)
INCLUDE_DIRECTORIES(${LIBROXML_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(libsysrepo ${LIBROXML_LIBRARIES})
SET_TARGET_PROPERTIES(libsysrepo PROPERTIES OUTPUT_NAME libsysrepo PREFIX "")
INSTALL(TARGETS libsysrepo LIBRARY DESTINATION usr/lib)
IF (TOOL_UMAAPID)
ADD_EXECUTABLE(umaapid ${SOURCES})
INSTALL(TARGETS umaapid RUNTIME DESTINATION bin)
# of course we need to link with libsysrepo
TARGET_LINK_LIBRARIES(umaapid libsysrepo)
FIND_PACKAGE(LIBUBOX REQUIRED)
INCLUDE_DIRECTORIES(${LIBUBOX_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(umaapid ${LIBUBOX_LIBRARIES})
FIND_PACKAGE(LIBUBUS REQUIRED)
INCLUDE_DIRECTORIES(${LIBUBUS_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(umaapid ${LIBUBUS_LIBRARIES})
ENDIF ()