forked from dune-community/dune-gdt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
70 lines (58 loc) · 2.22 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
# This file is part of the dune-gdt project:
# http://users.dune-project.org/projects/dune-gdt
# Copyright holders: Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
# set up project
project("dune-gdt" C CXX)
cmake_minimum_required(VERSION 2.8.6)
# local environment
set( ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../local/bin:$ENV{PATH}" )
set( ENV{LD_LIBRARY_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../local/lib:$ENV{LD_LIBRARY_PATH}" )
set( ENV{PKG_CONFIG_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../local/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}" )
# find dune-common and set the module path
find_package(dune-common)
list(APPEND CMAKE_MODULE_PATH
${dune-common_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/../dune-stuff/cmake/modules"
"${CMAKE_SOURCE_DIR}/cmake/modules")
#include the dune macros
include(DuneMacros)
include(AddALUGridCompileFlags)
# start a dune project with information from dune.module
dune_project()
include(DuneUtils)
file( GLOB_RECURSE gdt "${CMAKE_CURRENT_SOURCE_DIR}/*.hh" )
set( COMMON_HEADER ${gdt} ${DUNE_HEADERS} )
# add header of dependent modules for header listing
foreach(_mod ${ALL_DEPENDENCIES})
file(GLOB_RECURSE HEADER_LIST "${CMAKE_CURRENT_SOURCE_DIR}/../${_mod}/*.hh")
list(APPEND COMMON_HEADER ${HEADER_LIST})
endforeach(_mod DEPENDENCIES)
set_source_files_properties( ${COMMON_HEADER} PROPERTIES HEADER_FILE_ONLY 1 )
#disable most warnings from dependent modules
foreach(_mod ${ALL_DEPENDENCIES})
dune_module_to_uppercase(_upper_case "${_mod}")
if(${_mod}_INCLUDE_DIRS)
foreach( _idir ${${_mod}_INCLUDE_DIRS} )
add_definitions("-isystem ${_idir}")
endforeach( _idir )
endif(${_mod}_INCLUDE_DIRS)
endforeach(_mod DEPENDENCIES)
set( COMMON_LIBS
${DUNE_DEFAULT_LIBS}
${GRIDLIBS}
${FASPLIB}
)
# search for spe10 data files
find_file(SPE10MODEL1DATA
NAMES perm_case1.dat
PATHS "${dune-gdt_SOURCE_DIR}/../local/src/spe10/model1"
DOC "Location of perm_case1.dat"
NO_DEFAULT_PATH)
add_subdirectory(m4)
add_subdirectory(doc)
add_subdirectory(dune)
add_subdirectory(cmake/modules)
add_subdirectory(test EXCLUDE_FROM_ALL)
# finalize the dune project, e.g., generate config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)