-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
36 lines (27 loc) · 1.07 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
cmake_minimum_required(VERSION 3.16)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "Cmake generation in source dir is not allowed. Make an out of source build instead.")
endif()
# Config vcpkg
set(VCPKG_CRT_LINKAGE "static")
message(STATUS "Setting ${VCPKG_TARGET_TRIPLET} triplet")
project(bsuir-cw-library LANGUAGES CXX)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(FATAL_ERROR "Trying to compile for unsupported OS '${CMAKE_SYSTEM_NAME}'")
endif()
# Since we are using static linkage for packages, we need to use the same one here
if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDebug")
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
endif()
endif()
message(STATUS "Importing in-source packages")
add_subdirectory(Packages)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# Add definition for our internal use
add_compile_definitions(DEBUG_BUILD)
endif()
add_compile_definitions(NOMINMAX)
add_subdirectory(Source)