Skip to content
Snippets Groups Projects
Commit b65868a5 authored by Robert K's avatar Robert K
Browse files

[bugfix][GridSelector] Write ALUGrid grid defs to separate file to avoid dependencies

of the library to all headers (cmake problem). For all other downstream
modules the grid selection is still written to config.h
parent fbea8675
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,9 @@ project("dune-alugrid" C CXX)
set(BUILD_DOCS 1)
set(DUNE_REENABLE_ADD_TEST TRUE)
# grid selector in separate file to avoid excessive dependencies
set(ALUGRID_EXTRA_GRIDSELECTOR_FILE TRUE)
# general stuff
cmake_minimum_required(VERSION 2.8.12)
......
......@@ -9,9 +9,15 @@ dune_define_gridtype(GRIDSELECTOR_GRIDS GRIDTYPE ALUGRID_SIMPLEX
DUNETYPE "Dune::ALUGrid< dimgrid, dimworld, simplex, nonconforming >"
HEADERS dune/alugrid/grid.hh dune/alugrid/dgf.hh)
#if (ENABLE_GRID_SELECTOR)
# for ALUGrid module we write a separate grid selector file to avoid
# dependencies of the library files to all headers, for all other module
# the grid selection defs are written to config.h
if(DUNE_GRID_GRIDTYPE_SELECTOR AND ALUGRID_EXTRA_GRIDSELECTOR_FILE)
file(WRITE "${CMAKE_BINARY_DIR}/gridselector.hh" "#include <config.h>\n${GRIDSELECTOR_GRIDS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include${CMAKE_BINARY_DIR}/gridselector.hh")
else()
set(ALUGRID_CONFIG_H_BOTTOM "${ALUGRID_CONFIG_H_BOTTOM} ${GRIDSELECTOR_GRIDS}")
#endif (ENABLE_GRID_SELECTOR)
endif()
# avoid conflicts with normal ALUGrid
if( ALUGRID_CPPFLAGS )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment