-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (37 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
cmake_minimum_required(VERSION 3.16)
set(PROJ_NAME httpSvcRestApi)
project(${PROJ_NAME} C CXX)
# civetweb
set(CIVETWEB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../civetweb")
#####################################################
# Sources and headers
#####################################################
# Relative path to the project sources, i.e. right above cmake/..
set (APP_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(APP_SOURCES ${APP_SOURCES}
${APP_SRC_DIR}/main.cpp
${APP_SRC_DIR}/webHandler.cpp
${APP_SRC_DIR}/instrumentCtrl.cpp
)
set(thirdPary_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/")
find_package (Threads REQUIRED)
find_package(OpenSSL REQUIRED)
# find_package(nlohmann_json 3.10.2 REQUIRED)
include_directories(${thirdPary_DIR})
# cJSON
set(CJSON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cJSON")
set(cJSON_INCLUDE_DIR "${CJSON_PATH}")
set(cJSON_LINK_DIRECTORIES "${CJSON_PATH}/build_x86/")
include_directories(${cJSON_INCLUDE_DIR})
link_directories(${cJSON_LINK_DIRECTORIES})
add_executable (${PROJ_NAME} ${APP_SOURCES} )
set_target_properties(${PROJ_NAME}
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
TARGET_LINK_LIBRARIES(${PROJ_NAME} Threads::Threads)
TARGET_LINK_LIBRARIES(${PROJ_NAME} libcivetweb.a -ldl)
# TARGET_LINK_LIBRARIES(${PROJ_NAME} PRIVATE nlohmann_json::nlohmann_json)
TARGET_LINK_LIBRARIES(${PROJ_NAME} libcJSON.a)