-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
45 lines (39 loc) · 959 Bytes
/
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
41
42
43
44
45
cmake_minimum_required(VERSION 2.8.12)
project(pallette C CXX)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
#设置C++编译选项
set(CXX_FLAGS
-g
-DCHECK_PTHREAD_RETURN_VALUE
-D_FILE_OFFSET_BITS=64
-Wall
-Wextra
-Werror
-Wconversion
-Wno-unused-parameter
-Wold-style-cast
-Woverloaded-virtual
-Wpointer-arith
-Wshadow
-Wwrite-strings
-march=native
-rdynamic
)
#设置编译器
set(CMAKE_CXX_COMPILER "g++")
add_compile_options(-std=c++11)
#设置Debug模式选项
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -Wall -g2 -ggdb")
#设置Release模式选项
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -finline-limit=1000 -DNDEBUG")
#可执行文件存放路径
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
#库文件存放路径
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
include_directories(
${PROJECT_SOURCE_DIR}
)
add_subdirectory(pallette)
add_subdirectory(examples)