-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
67 lines (48 loc) · 1.79 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
60
61
62
63
64
65
66
67
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
PROJECT( xcppb )
IF ( CMAKE_COMPILER_IS_GNUCXX )
ADD_DEFINITIONS ( "-pedantic-errors -Wall -Wextra -Werror"
"-Wconversion"
"-Wfloat-equal -Wredundant-decls -Wstrict-null-sentinel -Winit-self"
"-Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy"
"-Wsign-promo -Wstrict-aliasing=1 -Wmissing-declarations"
"-Wold-style-cast"
"-Wno-long-long -ansi" )
IF( ENABLE_DEBUG_WARNINGS )
SET ( CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}" -Wpadded -Weffc++" )
ENDIF()
SET ( CMAKE_CXX_FLAGS_RELEASE "-O3 -fomit-frame-pointer -DNDEBUG" )
SET (CMAKE_REQUIRED_FLAGS "-Wall -Werror -pedantic")
ENDIF( CMAKE_COMPILER_IS_GNUCXX )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include )
SET( LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib )
SET( EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin )
FIND_PACKAGE( Boost 1.35.0 COMPONENTS
system
thread )
IF( NOT Boost_FOUND )
MESSAGE( STATUS "Boost not found!" )
ENDIF()
IF( Boost_INCLUDE_DIR )
ADD_DEFINITIONS( "-isystem ${Boost_INCLUDE_DIR}" )
ELSE()
MESSAGE( STATUS "Boost headers not found. You will have to specify them in your build environment or you can use -DBOOST_ROOT= or -DBoost_INCLUDE_DIR to tell cmake where your boost installation is." )
ENDIF()
IF( Boost_LIBRARY_DIRS )
LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
ELSE()
MESSAGE(STATUS "Boost libraries not found. Please set -DBoost_LIBRARY_DIR manually.")
ENDIF()
FIND_PACKAGE( X11 )
IF( NOT X11_FOUND )
MESSAGE( STATUS "X11 not found!" )
ENDIF()
IF( X11_INCLUDE_DIR )
INCLUDE_DIRECTORIES( ${X11_INCLUDE_DIR} )
ENDIF()
SET( SUBDIRVAL "... " )
ADD_SUBDIRECTORY( src )
ADD_SUBDIRECTORY( example )
MESSAGE( STATUS ${SUBDIRVAL} )