This module sets individual flags for each feature; there is not one "CXX11Features_FOUND" flags which is set. Thus, when putting the module as REQUIRED, the only consequence is that we cannot disable searching for it. Instead, we make it optional, meaning that the flags won't get set if it isn't included and the dependent modules will adjust accordingly.
59 lines
1.3 KiB
CMake
59 lines
1.3 KiB
CMake
# - Find DUNE common library
|
|
#
|
|
# Defines the following variables:
|
|
# dune-common_INCLUDE_DIRS Directory of header files
|
|
# dune-common_LIBRARIES Directory of shared object files
|
|
# dune-common_DEFINITIONS Defines that must be set to compile
|
|
# dune-common_CONFIG_VARS List of defines that should be in config.h
|
|
# HAVE_DUNE_COMMON Binary value to use in config.h
|
|
|
|
# Copyright (C) 2012 Uni Research AS
|
|
# This code is licensed under The GNU General Public License v3.0
|
|
|
|
include (OpmPackage)
|
|
find_opm_package (
|
|
# module name
|
|
"dune-common"
|
|
|
|
# dependencies
|
|
"CXX11Features;
|
|
BLAS REQUIRED;
|
|
LAPACK REQUIRED;
|
|
MPI
|
|
"
|
|
# header to search for
|
|
"dune/common/fvector.hh"
|
|
|
|
# library to search for
|
|
"dunecommon"
|
|
|
|
# defines to be added to compilations
|
|
"DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD=1"
|
|
|
|
# test program
|
|
"#include <dune/common/fvector.hh>
|
|
#include <dune/common/fmatrix.hh>
|
|
int main (void) {
|
|
Dune::FieldVector<double,1> v;
|
|
Dune::FieldMatrix<double,1,1> m;
|
|
m[0][0] = 1.0;
|
|
v[0] = 1.0;
|
|
Dune::FieldVector<double,1> w = m*v;
|
|
return 0;
|
|
}
|
|
"
|
|
# config variables
|
|
"HAVE_ARRAY;
|
|
HAVE_BOOST_MAKE_SHARED_HPP;
|
|
HAVE_BOOST_SHARED_PTR_HPP;
|
|
HAVE_GMP;
|
|
HAVE_MAKE_SHARED;
|
|
HAVE_MPI;
|
|
HAVE_NULLPTR;
|
|
HAVE_STATIC_ASSERT;
|
|
HAVE_TR1_TUPLE;
|
|
HAVE_TYPE_TRAITS;
|
|
HAVE_TUPLE
|
|
")
|
|
#debug_find_vars ("dune-common")
|