~wbetz/fesslix/flxeigen

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Wolfgang Betz
  • Date: 2016-06-17 14:28:23 UTC
  • Revision ID: wolfgang.betz@fesslix.org-20160617142823-ao5x99dj066qkckg
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Fesslix - Stochastic Analysis
 
2
# Copyright (C) 2010-2016 Wolfgang Betz
 
3
#
 
4
# Fesslix is free software: you can redistribute it and/or modify
 
5
# it under the terms of the GNU General Public License as published by
 
6
# the Free Software Foundation, either version 3 of the License, or
 
7
# (at your option) any later version.
 
8
#
 
9
# Fesslix is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License
 
15
# along with Fesslix.  If not, see <http://www.gnu.org/licenses/>. 
 
16
 
 
17
 
 
18
project(flxeigen)
 
19
cmake_minimum_required(VERSION 2.8)
 
20
 
 
21
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
 
22
 
 
23
find_package(Flxlib REQUIRED)
 
24
 
 
25
# add the automatically determined parts of the RPATH
 
26
# which point to directories outside the build tree to the install RPATH
 
27
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
28
 
 
29
if (NOT CMAKE_BUILD_TYPE)
 
30
  set (CMAKE_BUILD_TYPE Release CACHE STRING
 
31
      "Choose the type of build, options are: None Debug Release."
 
32
      FORCE)
 
33
endif (NOT CMAKE_BUILD_TYPE)
 
34
 
 
35
 
 
36
if(UNIX) 
 
37
  if(DEFINED ENV{DEB_BUILD_ARCH_OS})
 
38
  else()
 
39
    SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wall)
 
40
  endif()
 
41
endif(UNIX) 
 
42
 
 
43
option ( FLX_DEBUG "with debugging stuff .. but maybe more stable" OFF )
 
44
option ( FLX_DEBUG_COUT "use std::cout for debugging in your code" OFF )
 
45
 
 
46
 
 
47
if(WIN32)
 
48
  option ( FLX_INSTALL_HEADERS "install the header files of Fesslix" ON )
 
49
else()
 
50
  option ( FLX_INSTALL_HEADERS "install the header files of Fesslix" OFF )
 
51
endif()
 
52
 
 
53
 
 
54
#===================================================================================
 
55
# Boost library
 
56
#===================================================================================
 
57
 
 
58
if(DEFINED ENV{BOOST_INCDIR}) 
 
59
  set(BOOST_INCLUDEDIR $ENV{BOOST_INCDIR})
 
60
endif() 
 
61
 
 
62
find_package(Boost 1.48.0 REQUIRED)
 
63
 
 
64
 
 
65
#===================================================================================
 
66
# GSL library
 
67
#===================================================================================
 
68
 
 
69
 
 
70
if(NOT("${CMAKE_VERSION}" LESS 3.2))
 
71
  FIND_PACKAGE(GSL)
 
72
endif()
 
73
 
 
74
option ( FLX_USE_GSL "compile with GSL support" ON )
 
75
  
 
76
 
 
77
 
 
78
#===================================================================================
 
79
# ARPACK library
 
80
#===================================================================================
 
81
 
 
82
if(UNIX) 
 
83
  FIND_PACKAGE(ARPACK)
 
84
  if (ARPACK_FOUND)
 
85
    option ( FLX_USE_ARPACK "compile with arpack support" ON )
 
86
  else()
 
87
    option ( FLX_USE_ARPACK "compile with arpack support" OFF )
 
88
  endif()
 
89
else(UNIX) 
 
90
    set ( FLX_USE_ARPACK "OFF" )
 
91
endif(UNIX) 
 
92
 
 
93
 
 
94
 
 
95
 
 
96
MARK_AS_ADVANCED( 
 
97
  FLX_DEBUG_COUT
 
98
)
 
99
 
 
100
#===================================================================================
 
101
# info for config.h - header
 
102
#===================================================================================
 
103
 
 
104
if(UNIX) 
 
105
  if("${FLX_USE_ARPACK}" STREQUAL "ON")
 
106
    set ( FLX_USE_ARPACKb 1 )
 
107
  else("${FLX_USE_ARPACK}" STREQUAL "ON")
 
108
    set ( FLX_USE_ARPACKb 0 )
 
109
  endif("${FLX_USE_ARPACK}" STREQUAL "ON")
 
110
else(UNIX)
 
111
  set ( FLX_USE_ARPACKb 0 )
 
112
endif(UNIX)
 
113
 
 
114
if("${FLX_USE_GSL}" STREQUAL "ON")
 
115
  set ( FLX_USE_GSLb 1 )
 
116
else("${FLX_USE_GSL}" STREQUAL "ON")
 
117
  set ( FLX_USE_GSLb 0 )
 
118
endif("${FLX_USE_GSL}" STREQUAL "ON")
 
119
 
 
120
 
 
121
if("${FLX_DEBUG}" STREQUAL "ON")
 
122
set ( FLX_DEBUGb 1 )
 
123
else("${FLX_DEBUG}" STREQUAL "ON")
 
124
set ( FLX_DEBUGb 0 )
 
125
endif("${FLX_DEBUG}" STREQUAL "ON")
 
126
if("${FLX_DEBUG_COUT}" STREQUAL "ON")
 
127
set ( FLX_DEBUG_COUTb 1 )
 
128
else("${FLX_DEBUG_COUT}" STREQUAL "ON")
 
129
set ( FLX_DEBUG_COUTb 0 )
 
130
endif("${FLX_DEBUG_COUT}" STREQUAL "ON")
 
131
 
 
132
 
 
133
 
 
134
 
 
135
set ( FLX_LIB_LINKstat SHARED)
 
136
 
 
137
 
 
138
add_subdirectory(src)
 
139