-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
35 lines (26 loc) · 1.04 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
cmake_minimum_required(VERSION 3.12)
project(Freon
VERSION 0.1.0
LANGUAGES CXX)
message("> Project: \"${PROJECT_NAME}\" - Version: ${PROJECT_VERSION}")
set(CMAKE_CXX_STANDARD 11)
find_package(RapidJSON CONFIG REQUIRED)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "/Wall")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
elseif ("$CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "$CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
endif()
if (CMAKE_BUILD_TYPE MATCHES Debug)
message("- Debug mode selected")
message("- Using compiler flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
elseif(CMAKE_BUILD_TYPE MATCHES Release)
message("- Release mode selected")
message("- Using compiler flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
endif()
include_directories(${RAPIDJSON_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/include)
add_subdirectory(${CMAKE_SOURCE_DIR}/src)
add_subdirectory(${CMAKE_SOURCE_DIR}/tests)