Otherwise we are running into weired problems as downstream modules
refuse to set the version information correctly. This leads to
unset DUNE_MODULE_VERSION_{MINOR,MAJOR,REVISION} in config.h.
This only happened for dune-istl which was first requested by opm-core
but that module did not set the version information. Opm-grid requested
it, too. But this time this information was not correctly put into
opm-grid-config.cmake leading to erroneous checks like:
if (DEFINED DUNE_ISTL_VERSION_MAJOR AND NOT "${DUNE_ISTL_VERSION_MAJOR}" STREQUAL "")
message (WARNING "Incompatible value \"${DUNE_ISTL_VERSION_MAJOR}\" of variable \"DUNE_ISTL_VERSION_MAJOR\"")
endif ()
Note there should have been a number instead of an empty string. The version
numbers were also undefined in config.h of opm-grid. Same picture for opm-simulators.
My assumption is that for these modules Finddune-istl.cmake was implicitly included
when searching for opm-core. That module sets the version in the parent scope only
which might cause this problem. I am not sure though.
With this commit the version is always added to CONFIG_VARS for the first most upstream
OPM module that requests a dune module. This fixes the issue at least for me on my system.
Also note that this problem did not occur in all configurations. I experienced breaking
builds with the installed dune module 2.4.1 of Debian backports while using dunecontrol.
The warnings about unmatching versions happened with uninstalled 2.3, too.
34 lines
919 B
CMake
34 lines
919 B
CMake
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
|
|
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
|
|
|
|
# defines that must be present in config.h for our headers
|
|
set (opm-grid_CONFIG_VAR
|
|
DUNE_GRID_VERSION_MAJOR
|
|
DUNE_GRID_VERSION_MINOR
|
|
DUNE_GRID_VERSION_REVISION
|
|
DUNE_COMMON_VERSION_MAJOR
|
|
DUNE_COMMON_VERSION_MINOR
|
|
DUNE_COMMON_VERSION_REVISION
|
|
HAVE_ZOLTAN
|
|
)
|
|
|
|
# dependencies
|
|
set (opm-grid_DEPS
|
|
# compile with C99 support if available
|
|
"C99"
|
|
# compile with C++0x/11 support if available
|
|
"CXX11Features"
|
|
# various runtime library enhancements
|
|
"Boost 1.44.0
|
|
COMPONENTS date_time filesystem system unit_test_framework REQUIRED"
|
|
# DUNE dependency
|
|
"dune-common REQUIRED;
|
|
dune-grid REQUIRED;
|
|
dune-geometry REQUIRED
|
|
dune-istl"
|
|
# OPM dependency
|
|
"opm-common REQUIRED;
|
|
opm-core REQUIRED"
|
|
"ZOLTAN"
|
|
)
|