forked from lizhenghn123/zl_reactor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
60 lines (52 loc) · 1.57 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
cmake_minimum_required(VERSION 2.6)
###################################################################################
project(libzlreactor)
if (CMAKE_BUILD_TYPE)
else()
set(CMAKE_BUILD_TYPE RELEASE)
endif()
set(CXX_FLAGS
-g
# -DVALGRIND
-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
-std=c++0x
-rdynamic
)
if(CMAKE_BUILD_BITS EQUAL 32)
list(APPEND CXX_FLAGS "-m32")
endif()
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_CXX_FLAGS_DEBUG "-O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -finline-limit=1000 -DNDEBUG")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
message("------------ Options -------------")
message(" CMAKE_PROJECT: ${PROJECT_NAME}")
message(" CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
message(" CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message(" CMAKE_BUILD_BITS: ${CMAKE_BUILD_BITS}")
message(" CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
message(" EXECUTABLE_OUTPUT_PATH: ${EXECUTABLE_OUTPUT_PATH}")
message(" LIBRARY_OUTPUT_PATH: ${LIBRARY_OUTPUT_PATH}")
string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
message(STATUS "CXX_FLAGS = " ${CMAKE_CXX_FLAGS} " " ${CMAKE_CXX_FLAGS_${BUILD_TYPE}})
find_package(CURL)
if(CURL_FOUND)
message(STATUS "found curl")
endif()
add_subdirectory(zlreactor)
add_subdirectory(examples)
add_subdirectory(tests)