-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathCMakeLists.txt
76 lines (51 loc) · 2.78 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
68
69
70
71
72
73
74
75
76
cmake_minimum_required( VERSION 2.8 )
project( StrandSim C CXX )
###############################################################################
### Configure and check the build setting options
# If the user provided a CMAKE_BUILD_TYPE, create a cache variable
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif (NOT CMAKE_BUILD_TYPE)
if (APPLE)
option(USE_XCODE_PATCH "This is a option for XCode patch on MAC" ON)
endif()
###############################################################################
### Allow the user to set a preferred BLAS and LAPACK implementation
set( SUGGESTED_BLAS_LAPACK "" CACHE STRING "The desired LAPACK implementation (e.g. Generic, Apple, ACML, Intel10_64lp, Intel10_64lp_seq, ..." )
###############################################################################
### Set flags used across all builds (TODO: Check compiler types here!)
# Append an extra space if flags are already set
if( CMAKE_CXX_FLAGS )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} " )
endif( CMAKE_CXX_FLAGS )
# Enable c++0x support
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -DEIGEN_DONT_ALIGN -DEIGEN_DONT_ALIGN_STATICALLY" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
###############################################################################
### Set preprocessor defines used in all builds
if (WIN32)
add_definitions("-DBOOST_ALL_NO_LIB")
endif()
###############################################################################
### Set preprocessor defines used in debug builds
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
add_definitions( -DEIGEN_DONT_ALIGN ) # Also does -DEIGEN_DONT_VECTORIZE
endif( CMAKE_BUILD_TYPE STREQUAL "Debug" )
###############################################################################
### Set preprocessor defines used in release builds
#if( CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel" )
# add_definitions(-Dother_flags_go_here)
#endif( CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel" )
###############################################################################
### Set paths, etc
# Create a default location for custom cmake modules
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake )
# Allow projects to reference source relative to the root of the project
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
###############################################################################
### Add libraries, plugins
add_subdirectory( bogus )
add_subdirectory( StrandSim )
add_subdirectory( Apps/StrandSimulator )