-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (53 loc) · 1.29 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
52
53
54
55
56
57
58
59
60
61
62
63
cmake_minimum_required(VERSION 3.0)
project(databases_final_project)
set(CMAKE_CXX_STANDARD 14)
find_package(PostgreSQL REQUIRED)
set(SOURCES
src/main.cpp
src/database_executor.cpp
src/query_result.cpp
src/init_command_handler.cpp
src/api_command_handler.cpp
src/init_leader.cpp
src/api_support.cpp
src/api_upvote.cpp
src/api_actions.cpp
src/api_projects.cpp
src/api_votes.cpp
src/api_trolls.cpp
)
set(INCLUDES
inc/database_executor.hpp
inc/query_result.hpp
inc/command_handler.hpp
inc/init_command_handler.hpp
inc/api_command_handler.hpp
inc/abstract_api.hpp
inc/init_leader.hpp
inc/api_support.hpp
inc/api_upvote.hpp
inc/api_actions.hpp
inc/api_projects.hpp
inc/api_votes.hpp
inc/api_trolls.hpp
)
add_executable(${PROJECT_NAME} ${SOURCES} ${INCLUDES})
if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /W4)
else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic)
endif()
target_include_directories(${PROJECT_NAME} PRIVATE
inc
third_party
${PostgreSQL_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME} PRIVATE
${PostgreSQL_LIBRARIES}
)
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/resources
${CMAKE_CURRENT_BINARY_DIR}/resources
)