mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Provide CMake find module for opm-autodiff
If the module root is not explicitly specified, the loading of its configuration is delegated to a find module, which does a heuristic search in known/surrounding directories. Most OPM modules use the common logic in OpmPackage; this patch configures the search specifically for opm-autodiff.
This commit is contained in:
parent
fb3824e0da
commit
3112e465a0
44
cmake/Modules/Findopm-autodiff.cmake
Normal file
44
cmake/Modules/Findopm-autodiff.cmake
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# - Find OPM automatic differentiation library
|
||||||
|
#
|
||||||
|
# Defines the following variables:
|
||||||
|
# opm-autodiff_INCLUDE_DIRS Directory of header files
|
||||||
|
# opm-autodiff_LIBRARIES Directory of shared object files
|
||||||
|
# opm-autodiff_DEFINITIONS Defines that must be set to compile
|
||||||
|
# opm-autodiff_CONFIG_VARS List of defines that should be in config.h
|
||||||
|
# HAVE_OPM_AUTODIFF 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
|
||||||
|
|
||||||
|
# use the generic find routine
|
||||||
|
include (opm-autodiff-prereqs)
|
||||||
|
include (OpmPackage)
|
||||||
|
find_opm_package (
|
||||||
|
# module name
|
||||||
|
"opm-autodiff"
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
"${opm-autodiff_DEPS}"
|
||||||
|
|
||||||
|
# header to search for
|
||||||
|
"opm/autodiff/AutoDiff.hpp"
|
||||||
|
|
||||||
|
# library to search for
|
||||||
|
"opmautodiff"
|
||||||
|
|
||||||
|
# defines to be added to compilations
|
||||||
|
""
|
||||||
|
|
||||||
|
# test program
|
||||||
|
"#include <opm/autodiff/AutoDiff.hpp>
|
||||||
|
int main (void) {
|
||||||
|
Opm::AutoDiff<double> x = Opm::AutoDiff<double>::constant(42.);
|
||||||
|
(void) x;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
# config variables
|
||||||
|
"${opm-autodiff_CONFIG_VAR}"
|
||||||
|
)
|
||||||
|
include (UseDynamicBoost)
|
||||||
|
#debug_find_vars ("opm-autodiff")
|
Loading…
Reference in New Issue
Block a user