-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
121 lines (106 loc) · 2.77 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
cmake_minimum_required (VERSION 2.8.8)
project (Nutcracker C CXX Fortran)
enable_language (Fortran)
set(VERSION 1)
# Settings {{{
# Bundle required shared libraries {{{
set (BUNDLE_REQUIRED_SHARED_LIBRARIES
NO
CACHE BOOL
"If true, then required shared libraries are bundled with the package."
)
# }}}
# Output paths {{{
set (LIBRARY_OUTPUT_PATH
${PROJECT_BINARY_DIR}/lib
CACHE PATH
"Single directory for all libraries."
)
set (EXECUTABLE_OUTPUT_PATH
${PROJECT_BINARY_DIR}/bin
CACHE PATH
"Single directory for all executables."
)
mark_as_advanced(
LIBRARY_OUTPUT_PATH
EXECUTABLE_OUTPUT_PATH
)
# }}}
# Offline HTML+ {{{
set (OFFLINE_HTML
NO
CACHE BOOL
"If true, then ensures that HTML documentation can be viewed offline."
)
if(${OFFLINE_HTML})
set(USE_MATHJAX NO)
else(${OFFLINE_HTML})
set(USE_MATHJAX YES)
endif(${OFFLINE_HTML})
# }}}
# }}}
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules/")
# Platform-specific tweaks {{{
if(CMAKE_COMPILER_IS_GNUCC)
add_definitions(-Wall -Wno-strict-aliasing)
endif(CMAKE_COMPILER_IS_GNUCC)
# }}}
# Find packages {{{
# ARPACK {{{
find_package( ARPACK REQUIRED )
link_directories ( ${ARPACK_LIBRARY_DIRS} )
# }}}
# BLAS {{{
find_package( BLAS REQUIRED )
link_directories ( ${BLAS_LIBRARY_DIRS} )
include_directories ( ${BLAS_INCLUDE_DIRS} )
# }}}
# Boost {{{
find_package( Boost 1.48 COMPONENTS filesystem program_options signals system thread REQUIRED )
link_directories ( ${Boost_LIBRARY_DIRS} )
include_directories ( ${Boost_INCLUDE_DIRS} )
# }}}
# Doxygen & Inkscape {{{
find_package(Doxygen)
find_program(INKSCAPE inkscape)
# }}}
# HDF++ {{{
find_package( HDF++ 0.3 REQUIRED )
include_directories ( ${HDF++_INCLUDE_DIRS} )
link_directories ( ${HDF++_LIBRARY_DIRS} )
# }}}
# LAPACK {{{
find_package( LAPACK REQUIRED )
link_directories ( ${LAPACK_LIBRARY_DIRS} )
include_directories ( ${LAPACK_INCLUDE_DIRS} )
# }}}
# Protobuf {{{
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})
# }}}
# YamlCXX {{{
find_package( YamlCXX 0.5.0 REQUIRED )
link_directories ( ${YAMLCXX_LIBRARY_DIRS} )
include_directories ( ${YAMLCXX_INCLUDE_DIRS} )
# }}}
# }}}
# Configure build type {{{
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE "RelWithDebInfo" )
endif ()
message (STATUS "Build type is " ${CMAKE_BUILD_TYPE})
# }}}
include_directories ("includes")
add_subdirectory ("configuration")
include_directories (${CMAKE_BINARY_DIR}/configuration)
add_subdirectory ("sources")
# Configure tests {{{
find_package( Illuminate )
if(${Illuminate_FOUND})
add_subdirectory ("tests")
else(${Illuminate_FOUND})
add_custom_target(test
COMMAND ${CMAKE_COMMAND} -E echo "The Illuminate library is required to build the tests."
)
endif(${Illuminate_FOUND})
# }}}