-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
28 lines (22 loc) · 825 Bytes
/
CMakeLists.txt
File metadata and controls
28 lines (22 loc) · 825 Bytes
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
# Version check
cmake_minimum_required (VERSION 3.8)
if(NOT "${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_EXTENSIONS OFF)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()
# Project
project(SimpleJSON)
# Add files
file(GLOB sources "parse/*.cpp" "stringify/*.cpp" "utility/*.cpp")
# Add library
add_library(SimpleJSON STATIC ${sources})
# Compiler Options
set(DEBUG_OPTIONS -fexceptions -g -Wall -pedantic-errors -pedantic)
set(RELEASE_OPTIONS -fexceptions -O3 -Wall -pedantic-errors -pedantic)
target_compile_options(SimpleJSON PUBLIC "$<$<CONFIG:DEBUG>:${DEBUG_OPTIONS}>")
target_compile_options(SimpleJSON PUBLIC "$<$<CONFIG:RELEASE>:${RELEASE_OPTIONS}>")