-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
30 lines (24 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
cmake_minimum_required(VERSION 3.16)
project(SimpleConfig)
set(CMAKE_CXX_STANDARD 17)
# ******************************** Check Build Type ********************************
if(CMAKE_BUILD_TYPE MATCHES "Debug")
add_definitions("-DDEBUG" "-D_DEBUG" "-D_DEBUG_")
else()
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -s -Wl,-x")
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "CXX flags: ${CMAKE_CXX_FLAGS}")
# ******************************** Check Build Type ********************************
# ******************************** Output Path ********************************
set(PATH_OUTPUT "${PROJECT_SOURCE_DIR}/${CMAKE_BUILD_TYPE}")
set(LIBRARY_OUTPUT_PATH "${PATH_OUTPUT}")
set(EXECUTABLE_OUTPUT_PATH "${PATH_OUTPUT}")
message(STATUS "Binary output path: ${PATH_OUTPUT}")
# ******************************** Output Path ********************************
set(PATH_SOURCE "${PROJECT_SOURCE_DIR}/source")
set(PATH_TESTS "${PROJECT_SOURCE_DIR}/tests")
set(BINARY_PREFIX "simple_")
add_subdirectory("./source")
add_subdirectory("./tests")