-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
80 lines (68 loc) · 2.44 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
cmake_minimum_required(VERSION 3.26)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file")
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg.json VCPKG_JSON)
string(JSON VERSION_STRING GET ${VCPKG_JSON} version-string)
message(STATUS "Project version: ${VERSION_STRING}")
project(Studio26F CXX)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message(STATUS "Compiler is Clang")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message(STATUS "Compiler is GCC")
add_compile_options(-Wno-volatile)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
message(STATUS "Compiler is Intel C++")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
message(STATUS "Compiler is Visual Studio C++")
add_compile_options(/MP /utf-8)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS NOMINMAX)
endif ()
add_compile_definitions(CMAKE_PROJECT_NAME="${PROJECT_NAME}")
add_compile_definitions(VERSION_STRING="${VERSION_STRING}")
add_executable(${PROJECT_NAME} main.cc)
find_package(boost_date_time CONFIG REQUIRED)
find_package(boost_system CONFIG REQUIRED)
find_package(cryptopp CONFIG REQUIRED)
find_package(Drogon CONFIG REQUIRED)
find_package(magic_enum CONFIG REQUIRED)
find_package(mailio CONFIG REQUIRED)
find_package(range-v3 CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME}
PRIVATE
Boost::date_time
Boost::system
cryptopp::cryptopp
Drogon::Drogon
magic_enum::magic_enum
mailio
range-v3
range-v3-meta
range-v3::meta
range-v3-concepts)
target_include_directories(${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/models)
aux_source_directory(controllers CTL_SRC)
aux_source_directory(filters FILTER_SRC)
aux_source_directory(helpers HELPER_SRC)
aux_source_directory(models MODEL_SRC)
aux_source_directory(plugins PLUGIN_SRC)
aux_source_directory(strategies STRATEGY_SRC)
aux_source_directory(structures STRUCT_SRC)
aux_source_directory(types TYPE_SRC)
aux_source_directory(utils UTIL_SRC)
target_sources(${PROJECT_NAME}
PRIVATE
${CTL_SRC}
${FILTER_SRC}
${HELPER_SRC}
${MODEL_SRC}
${PLUGIN_SRC}
${STRATEGY_SRC}
${STRUCT_SRC}
${TYPE_SRC}
${UTIL_SRC})
add_subdirectory(test)