-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
40 lines (28 loc) · 1.09 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
PROJECT(taotu CXX)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++17")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++17 -fsanitize=address -Wall -O0 -DTAOTU_DEBUG")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
message(STATUS "Darwin detected, not using -fsanitize=leak")
else()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=leak")
endif()
ADD_DEFINITIONS(-Wno-format-security)
IF(CMAKE_BUILD_TYPE AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
MESSAGE(STATUS "CMAKE_CXX_FLAGS_DEBUG = " ${CMAKE_CXX_FLAGS_DEBUG})
ELSEIF(CMAKE_BUILD_TYPE AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
MESSAGE(STATUS "CMAKE_CXX_FLAGS_RELEASE = " ${CMAKE_CXX_FLAGS_RELEASE})
ENDIF()
FILE(COPY
"${PROJECT_SOURCE_DIR}/src/"
DESTINATION
"${PROJECT_BINARY_DIR}/output/include/taotu/"
FILES_MATCHING
PATTERN "*.h"
)
SET(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/output/lib/")
ADD_SUBDIRECTORY(src)
SET(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/output/bin/")
ADD_SUBDIRECTORY(test)
ADD_SUBDIRECTORY(example)