This repository has been archived by the owner on Oct 24, 2019. It is now read-only.
forked from dune-community/dune-hdd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
88 lines (69 loc) · 2.72 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
# This file is part of the dune-hdd project:
# http://users.dune-project.org/projects/dune-hdd
# Copyright holders: Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#
# Contributors: Rene Milk
project(dune-hdd CXX)
# 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}" )
# cmake specific
cmake_minimum_required( VERSION 2.8 )
set(CMAKE_COLOR_MAKEFILE ON)
# guess dune-common build dir
if(NOT (dune-common_DIR OR dune-common_ROOT OR "${CMAKE_PREFIX_PATH}" MATCHES ".*dune-common.*"))
string(REPLACE ${CMAKE_PROJECT_NAME} dune-common dune-common_DIR ${PROJECT_BINARY_DIR})
endif()
# find dune-common and set the module path
find_package(dune-common REQUIRED)
list(APPEND
CMAKE_MODULE_PATH
${dune-common_MODULE_PATH}
"${PROJECT_SOURCE_DIR}/cmake/modules")
#include the dune macros
include(DuneMacros)
# start a dune project with information from dune.module
dune_project()
# dune-stuff and dune-pymor cmake includes
list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/cmake
${CMAKE_CURRENT_SOURCE_DIR}/../dune-pymor/cmake
${CMAKE_CURRENT_SOURCE_DIR}/../dune-stuff/cmake)
include(DuneUtils)
include(GridUtils)
include(PymorUtils)
link_directories("/usr/lib" ${CCGNU_LIBRARY_DIRS})
# header
file(GLOB_RECURSE hdd "${CMAKE_CURRENT_SOURCE_DIR}/*.hh")
set(COMMON_HEADER ${hdd} ${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)
#if (ALUGRID_FOUND)
# set(GRIDTYPE "ALUGRID_CONFORM" CACHE STRING "GRIDTYPE" FORCE)
#endif (ALUGRID_FOUND)
# libs
set(COMMON_LIBS ${DUNE_DEFAULT_LIBS})
#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)
# search for spe10 data files
find_file(SPE10MODEL1DATA
NAMES perm_case1.dat
PATHS "${dune-hdd_SOURCE_DIR}/../local/src/spe10/model1"
DOC "Location of perm_case1.dat"
NO_DEFAULT_PATH)
add_subdirectory(examples EXCLUDE_FROM_ALL)
add_subdirectory(test EXCLUDE_FROM_ALL)
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)