-
Notifications
You must be signed in to change notification settings - Fork 32
/
CMakeLists.txt
37 lines (31 loc) · 992 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
cmake_minimum_required (VERSION 3.5)
if (UNIX)
add_definitions(-Wno-sign-compare -Wno-enum-compare)
endif(UNIX)
project(restserver)
set (CMAKE_CXX_STANDARD 11)
option(DBMS "Dbms" OFF)
include_directories("${CMAKE_SOURCE_DIR}")
set (CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/Build)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
add_executable(restserver
main.cpp
src/handler.cpp
)
set(Casablanca_LIBRARIES "-lboost_system -lcrypto -lssl -lcpprest")
set(LINKING_LIBRARIES ${Casablanca_LIBRARIES})
if(DBMS)
set(NEW_DB_SRC_DIR ${CMAKE_SOURCE_DIR}/dbms/src)
add_library(dbms SHARED
${NEW_DB_SRC_DIR}/Dbms.cpp
)
set(Dbms_dep_lib "-lpqxx -lpq")
set(LINKING_LIBRARIES ${LINKING_LIBRARIES} dbms ${Dbms_dep_lib})
endif(DBMS)
if (UNIX)
# Linking POSIX threads
find_package(Threads REQUIRED)
set(LINKING_LIBRARIES ${LINKING_LIBRARIES} Threads::Threads)
endif (UNIX)
target_link_libraries(restserver PRIVATE ${LINKING_LIBRARIES})