-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (39 loc) · 1.33 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 3.1)
set(project_name example-postgresql) ## rename your project here
project(${project_name})
set(CMAKE_CXX_STANDARD 11)
add_library(${project_name}-lib
src/controller/PasteController.hpp
src/db/PasteDb.hpp
src/dto/ConfigDto.hpp
src/dto/PasteDTO.hpp
src/service/PasteService.cpp
src/service/PasteService.hpp
src/AppComponent.hpp
src/DatabaseComponent.hpp
src/ErrorHandler.cpp
src/ErrorHandler.hpp
src/ServiceComponent.hpp
)
target_include_directories(${project_name}-lib PUBLIC src)
## link libs
find_package(oatpp 1.3.0 REQUIRED)
find_package(oatpp-postgresql 1.3.0 REQUIRED)
target_link_libraries(${project_name}-lib
PUBLIC oatpp::oatpp
PUBLIC oatpp::oatpp-test
PUBLIC oatpp::oatpp-postgresql
)
add_definitions(
# Path to config file #
-DCONFIG_PATH="${CMAKE_CURRENT_LIST_DIR}/resources/config.json"
## Path to database migration scripts
-DDATABASE_MIGRATIONS="${CMAKE_CURRENT_SOURCE_DIR}/sql"
)
#################################################################
## add executables
add_executable(${project_name}-exe
src/App.cpp
)
target_link_libraries(${project_name}-exe ${project_name}-lib)
add_dependencies(${project_name}-exe ${project_name}-lib)