aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 8239925a111ccbaf478459e85d685d9048f5d4b8 (plain)
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
cmake_minimum_required(VERSION 3.13)
project (UMOSAPI)

find_package(libmongocxx REQUIRED)
find_package(libbsoncxx REQUIRED)
include_directories(${LIBMONGOCXX_INCLUDE_DIR})
include_directories(${LIBBSONCXX_INCLUDE_DIR})

find_package(Pistache REQUIRED)
include_directories(${Pistache_INCLUDE_DIR})

find_package(nlohmann_json REQUIRED)
include_directories(${JSON_INCLUDE_DIR})

#find_package(Boost)

find_package(Threads)

find_path(JSONC_INCLUDE_DIRS json.h
                           HINTS
                           /usr/include/json-c/
                           /usr/local/include/json-c/
)
find_library(JSONC_LIBRARIES json-c
                          HINTS
                          /usr/lib/
                          /usr/local/lib
)

find_package_handle_standard_args(jsonc DEFAULT_MSG JSONC_INCLUDE_DIRS JSONC_LIBRARIES)

if (NOT JSONC_FOUND)
message(FATAL_ERROR "json-c lib not found! Please check if headers files are in
/usr/include/json-c/
or
/usr/local/include/json-c/
Also please check that libs files ares in
/usr/lib/
or
/usr/local/lib")
endif(NOT JSONC_FOUND)


#add_executable(umosapi test.cpp)

add_executable(umosapi umosapi.cpp shared.h)

set_property(TARGET umosapi PROPERTY CXX_STANDARD 17)

target_include_directories(umosapi PUBLIC ${LIBMONGOCXX_INCLUDE_DIRS})
target_link_libraries(umosapi PUBLIC ${LIBBSONCXX_LIBRARIES})
target_link_libraries(umosapi PUBLIC ${LIBMONGOCXX_LIBRARIES})

target_link_libraries(umosapi PUBLIC ${Pistache_LIBRARIES}/libpistache.so)
target_include_directories(umosapi PUBLIC ${Pistache_INCLUDE_DIRS})

target_link_libraries(umosapi PUBLIC ${CMAKE_THREAD_LIBS_INIT})

target_include_directories(umosapi PUBLIC ${JSONC_INCLUDE_DIRS})
target_link_libraries(umosapi PUBLIC ${JSONC_LIBRARIES})