mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added OPM-common as a ThirdParty library.
This commit is contained in:
committed by
Magne Sjaastad
parent
223cf5357f
commit
ca01feeb2f
20
ThirdParty/custom-opm-common/opm-common/.clang-format
vendored
Normal file
20
ThirdParty/custom-opm-common/opm-common/.clang-format
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
BasedOnStyle: WebKit,
|
||||
AlignAfterOpenBracket: AlwaysBreak,
|
||||
AlignConsecutiveAssignments: false,
|
||||
AlignConsecutiveDeclarations: false,
|
||||
AlignAfterOpenBracket: Align,
|
||||
AllowShortBlocksOnASingleLine: false,
|
||||
AllowShortFunctionsOnASingleLine: None,
|
||||
AlwaysBreakAfterReturnType: TopLevelDefinitions,
|
||||
AlwaysBreakTemplateDeclarations: Yes,
|
||||
BinPackArguments: false,
|
||||
BinPackParameters: false,
|
||||
BreakBeforeBraces: Linux,
|
||||
BreakConstructorInitializers: BeforeComma,
|
||||
ColumnLimit: 120,
|
||||
Cpp11BracedListStyle: true,
|
||||
FixNamespaceComments: true,
|
||||
MaxEmptyLinesToKeep: 5,
|
||||
NamespaceIndentation: Inner,
|
||||
}
|
||||
75
ThirdParty/custom-opm-common/opm-common/.gitignore
vendored
Normal file
75
ThirdParty/custom-opm-common/opm-common/.gitignore
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
# editor backup files
|
||||
*~
|
||||
.\#*
|
||||
\#*\#
|
||||
.\#*\#
|
||||
|
||||
# compiler output
|
||||
*.o
|
||||
*.mod
|
||||
|
||||
# libtool compatible files
|
||||
*.lo
|
||||
*.la
|
||||
|
||||
# Eclipse project settings
|
||||
.cproject
|
||||
.project
|
||||
.settings/*
|
||||
|
||||
# QtCreator project settings
|
||||
CMakeLists.txt.user*
|
||||
|
||||
# in-tree build with CMake
|
||||
CMakeCache.txt
|
||||
CMakeFiles/
|
||||
cmake_install.cmake
|
||||
config.h
|
||||
opm-core-config.cmake
|
||||
opm-core-config-version.cmake
|
||||
opm-core-install.cmake
|
||||
Makefile
|
||||
bin/
|
||||
lib/
|
||||
Doxyfile
|
||||
Documentation/html
|
||||
dune.module
|
||||
*.pc
|
||||
install_manifest.txt
|
||||
|
||||
# testing framework
|
||||
CTestTestfile.cmake
|
||||
DartConfiguration.tcl
|
||||
Testing/
|
||||
|
||||
# Build directory in source.
|
||||
build/
|
||||
|
||||
gmon.out
|
||||
log.log
|
||||
build
|
||||
install
|
||||
.cproject
|
||||
.project
|
||||
/testdata/statoil
|
||||
.idea
|
||||
/Debug/
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
|
||||
# Mac OS X debug info
|
||||
*.dSYM
|
||||
|
||||
# emacs directory setting:
|
||||
.dir-locals.el
|
||||
|
||||
*.pyc
|
||||
*.eggs
|
||||
*.egg-info
|
||||
0
ThirdParty/custom-opm-common/opm-common/.gitmodules
vendored
Normal file
0
ThirdParty/custom-opm-common/opm-common/.gitmodules
vendored
Normal file
381
ThirdParty/custom-opm-common/opm-common/CMakeLists.txt
vendored
Normal file
381
ThirdParty/custom-opm-common/opm-common/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,381 @@
|
||||
project(opm-common C CXX)
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
option(SIBLING_SEARCH "Search for other modules in sibling directories?" ON)
|
||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
|
||||
set(OPM_MACROS_ROOT ${PROJECT_SOURCE_DIR})
|
||||
|
||||
option(BUILD_TEST_FRAMEWORK "Create test framework?" ON)
|
||||
option(ENABLE_ECL_INPUT "Enable eclipse input support?" ON)
|
||||
option(ENABLE_ECL_OUTPUT "Enable eclipse output support?" ON)
|
||||
option(ENABLE_MOCKSIM "Build the mock simulator for io testing" ON)
|
||||
option(OPM_ENABLE_PYTHON "Enable python bindings?" OFF)
|
||||
option(OPM_INSTALL_PYTHON "Enable python bindings?" OFF)
|
||||
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable python bindings?" OFF)
|
||||
|
||||
# Output implies input
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
set(ENABLE_ECL_INPUT ON)
|
||||
endif()
|
||||
|
||||
# And likewise, no input means no output
|
||||
if(NOT ENABLE_ECL_INPUT)
|
||||
set(ENABLE_ECL_OUTPUT OFF)
|
||||
endif()
|
||||
|
||||
|
||||
# not the same location as most of the other projects; this hook overrides
|
||||
macro (dir_hook)
|
||||
endmacro (dir_hook)
|
||||
|
||||
# We need to define this variable in the installed cmake config file.
|
||||
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "#ENABLE_ECL_INPUT is needed by opm-common-prereq.cmake
|
||||
set(ENABLE_ECL_INPUT ${ENABLE_ECL_INPUT})
|
||||
set(OPM_MACROS_ROOT ${CMAKE_INSTALL_PREFIX}/share/opm)
|
||||
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)
|
||||
include(OpmPackage) #Make macros availabe after find_package(opm-common)")
|
||||
|
||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "#ENABLE_ECL_INPUT is needed by opm-common-prereq.cmake
|
||||
set(ENABLE_ECL_INPUT ${ENABLE_ECL_INPUT})
|
||||
set(OPM_MACROS_ROOT ${OPM_MACROS_ROOT})
|
||||
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)
|
||||
include(OpmPackage) #Make macros availabe after find_package(opm-common)")
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
|
||||
set(COMPARE_ECL_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/compareECL)
|
||||
set(OPM_PACK_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/opmpack)")
|
||||
|
||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
|
||||
set(COMPARE_ECL_COMMAND ${PROJECT_BINARY_DIR}/bin/compareECL)
|
||||
set(OPM_PACK_COMMAND ${PROJECT_BINARY_DIR}/bin/opmpack)")
|
||||
endif()
|
||||
|
||||
# project information is in dune.module. Read this file and set variables.
|
||||
# we cannot generate dune.module since it is read by dunecontrol before
|
||||
# the build starts, so it makes sense to keep the data there then.
|
||||
include (OpmInit)
|
||||
OpmSetPolicies()
|
||||
|
||||
# Look for the opm-tests repository; if found the variable
|
||||
# HAVE_OPM_TESTS will be set to true.
|
||||
include(Findopm-tests)
|
||||
|
||||
# list of prerequisites for this particular project; this is in a
|
||||
# separate file (in cmake/Modules sub-directory) because it is shared
|
||||
# with the find module
|
||||
include (${project}-prereqs)
|
||||
|
||||
# read the list of components from this file (in the project directory);
|
||||
# it should set various lists with the names of the files to include
|
||||
include (CMakeLists_files.cmake)
|
||||
|
||||
macro (config_hook)
|
||||
if(ENABLE_ECL_INPUT)
|
||||
if(NOT cjson_FOUND)
|
||||
list(APPEND EXTRA_INCLUDES ${PROJECT_SOURCE_DIR}/external/cjson)
|
||||
endif()
|
||||
# For this project
|
||||
include_directories(${EXTRA_INCLUDES} ${PROJECT_BINARY_DIR}/include)
|
||||
|
||||
# For downstreams
|
||||
list(APPEND EXTRA_INCLUDES ${PROJECT_BINARY_DIR}/include)
|
||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
|
||||
list(APPEND opm-common_INCLUDE_DIRS ${EXTRA_INCLUDES})")
|
||||
if(ENABLE_ECL_INPUT)
|
||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
|
||||
set(HAVE_ECL_INPUT 1)")
|
||||
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
|
||||
set(HAVE_ECL_INPUT 1)")
|
||||
endif()
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
|
||||
set(HAVE_ECL_OUTPUT 1)")
|
||||
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
|
||||
set(HAVE_ECL_OUTPUT 1)")
|
||||
endif()
|
||||
|
||||
# Configure boost targets for old cmake
|
||||
include(cmake/Modules/BoostTargets.cmake)
|
||||
|
||||
if (HAVE_DYNAMIC_BOOST_TEST)
|
||||
set_target_properties(Boost::unit_test_framework PROPERTIES INTERFACE_COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK=1)
|
||||
endif()
|
||||
endif()
|
||||
endmacro (config_hook)
|
||||
|
||||
macro (prereqs_hook)
|
||||
endmacro (prereqs_hook)
|
||||
|
||||
macro (sources_hook)
|
||||
if(ENABLE_ECL_INPUT)
|
||||
# Keyword generation
|
||||
include(GenerateKeywords.cmake)
|
||||
|
||||
# Append generated sources
|
||||
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserInit.cpp)
|
||||
foreach (name A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
|
||||
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserKeywords/${name}.cpp)
|
||||
endforeach()
|
||||
endif()
|
||||
#set_source_files_properties(src/opm/parser/eclipse/Python/Python.cpp
|
||||
# PROPERTIES COMPILE_FLAGS -Wno-shadow)
|
||||
endmacro (sources_hook)
|
||||
|
||||
macro (fortran_hook)
|
||||
endmacro (fortran_hook)
|
||||
|
||||
macro (files_hook)
|
||||
endmacro (files_hook)
|
||||
|
||||
macro (tests_hook)
|
||||
if(ENABLE_ECL_INPUT)
|
||||
include(ExtraTests.cmake)
|
||||
endif()
|
||||
endmacro (tests_hook)
|
||||
|
||||
macro (install_hook)
|
||||
install(DIRECTORY ${PROJECT_BINARY_DIR}/include/
|
||||
DESTINATION include
|
||||
PATTERN *.hpp)
|
||||
endmacro (install_hook)
|
||||
|
||||
# If opm-common is configured to embed the python interpreter we must make sure
|
||||
# that all downstream modules link libpython transitively. Due to the required
|
||||
# integration with Python+cmake machinery provided by pybind11 this is done by
|
||||
# manually adding to the opm-common_LIBRARIES variable here, and not in the
|
||||
# OpmnLibMain function. Here only the library dependency is implemented, the
|
||||
# bulk of the python configuration is further down in the file.
|
||||
if (OPM_ENABLE_PYTHON)
|
||||
find_package(PythonInterp REQUIRED)
|
||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
||||
find_package(PythonLibs REQUIRED)
|
||||
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Add dependency of Shlwapi.lib for Windows platforms
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
target_link_libraries(opmcommon Shlwapi)
|
||||
endif()
|
||||
|
||||
|
||||
# all setup common to the OPM library modules is done here
|
||||
include (OpmLibMain)
|
||||
|
||||
if (ENABLE_MOCKSIM)
|
||||
add_library(mocksim
|
||||
msim/src/msim.cpp)
|
||||
target_link_libraries(mocksim opmcommon)
|
||||
target_include_directories(mocksim PUBLIC msim/include)
|
||||
add_executable(msim examples/msim.cpp)
|
||||
target_link_libraries(msim mocksim)
|
||||
|
||||
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
||||
set(_libs mocksim opmcommon
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
|
||||
|
||||
foreach( test test_msim test_msim_ACTIONX test_msim_EXIT)
|
||||
opm_add_test(${test} SOURCES tests/msim/${test}.cpp
|
||||
LIBRARIES ${_libs}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests
|
||||
CONDITION ${HAVE_ECL_INPUT})
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Build the compare utilities
|
||||
if(ENABLE_ECL_INPUT)
|
||||
#add_executable(compareECL
|
||||
# test_util/EclFilesComparator.cpp
|
||||
# test_util/EclRegressionTest.cpp
|
||||
# test_util/compareECL.cpp
|
||||
# )
|
||||
|
||||
#add_executable(convertECL
|
||||
# test_util/convertECL.cpp
|
||||
# )
|
||||
|
||||
#add_executable(summary
|
||||
# test_util/summary.cpp
|
||||
# )
|
||||
|
||||
#foreach(target compareECL convertECL summary)
|
||||
# target_link_libraries(${target} opmcommon)
|
||||
# install(TARGETS ${target} DESTINATION bin)
|
||||
#endforeach()
|
||||
|
||||
# Add the tests
|
||||
set(_libs opmcommon
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
|
||||
|
||||
opm_add_test(test_EclFilesComparator
|
||||
CONDITION
|
||||
ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
|
||||
SOURCES
|
||||
tests/test_EclFilesComparator.cpp
|
||||
test_util/EclFilesComparator.cpp
|
||||
LIBRARIES
|
||||
${_libs}
|
||||
WORKING_DIRECTORY
|
||||
${PROJECT_BINARY_DIR}/tests
|
||||
)
|
||||
|
||||
opm_add_test(test_EclRegressionTest
|
||||
CONDITION
|
||||
ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
|
||||
SOURCES
|
||||
tests/test_EclRegressionTest.cpp
|
||||
test_util/EclFilesComparator.cpp
|
||||
test_util/EclRegressionTest.cpp
|
||||
LIBRARIES
|
||||
${_libs}
|
||||
WORKING_DIRECTORY
|
||||
${PROJECT_BINARY_DIR}/tests
|
||||
)
|
||||
|
||||
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry)
|
||||
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
|
||||
LIBRARIES ${_libs}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Install build system files
|
||||
install(DIRECTORY cmake DESTINATION share/opm)
|
||||
|
||||
# Install tab completion skeleton
|
||||
install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
|
||||
|
||||
if (OPM_ENABLE_PYTHON)
|
||||
# -------------------------------------------------------------------------
|
||||
# 1: Wrap C++ functionality in Python
|
||||
if (EXISTS "/etc/debian_version")
|
||||
set(PYTHON_PACKAGE_PATH "dist-packages")
|
||||
else()
|
||||
set(PYTHON_PACKAGE_PATH "site-packages")
|
||||
endif()
|
||||
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
|
||||
|
||||
make_directory(${PROJECT_BINARY_DIR}/python)
|
||||
get_target_property(_opmcommon_include_dirs opmcommon INCLUDE_DIRECTORIES)
|
||||
list(APPEND _opmcommon_include_dirs ${_ecl_include_dirs})
|
||||
string(REPLACE ";" ":" _setup_include_dirs "${_opmcommon_include_dirs}")
|
||||
|
||||
get_target_property(_opmcommon_lib_dirs opmcommon LINK_DIRECTORIES)
|
||||
if (CMAKE_PREFIX_PATH)
|
||||
list(APPEND _opmcommon_lib_dirs ${PROJECT_BINARY_DIR}/lib ${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR})
|
||||
else()
|
||||
list(APPEND _opmcommon_lib_dirs ${PROJECT_BINARY_DIR}/lib)
|
||||
endif()
|
||||
string(REPLACE ";" ":" _setup_lib_dirs "${_opmcommon_lib_dirs}")
|
||||
|
||||
if (USE_RUNPATH)
|
||||
set (_python_rpath_list)
|
||||
if (CMAKE_PREFIX_PATH)
|
||||
foreach(path ${CMAKE_PREFIX_PATH})
|
||||
list(APPEND _python_rpath_list "${path}/${CMAKE_INSTALL_LIBDIR}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
list(APPEND _python_rpath_list "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
if (_python_rpath_list)
|
||||
string(REPLACE ";" ":" _rpath "${_python_rpath_list}")
|
||||
set( _rpath_arg "--rpath=${_rpath}")
|
||||
else()
|
||||
set(_rpath_arg "")
|
||||
endif()
|
||||
else()
|
||||
set( _rpath_arg "")
|
||||
endif()
|
||||
|
||||
set(opm-common_PYTHON_PACKAGE_VERSION ${OPM_PYTHON_PACKAGE_VERSION_TAG})
|
||||
|
||||
# Generate versioned setup.py
|
||||
configure_file (${PROJECT_SOURCE_DIR}/python/setup.py.in ${PROJECT_BINARY_DIR}/python/setup.py)
|
||||
file(COPY ${PROJECT_SOURCE_DIR}/python/README.md DESTINATION ${PROJECT_BINARY_DIR}/python)
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} target_name.py
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python
|
||||
OUTPUT_VARIABLE python_lib_target)
|
||||
|
||||
add_custom_target(copy_python ALL
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/python/install.py ${PROJECT_SOURCE_DIR}/python ${PROJECT_BINARY_DIR} 0)
|
||||
|
||||
add_custom_command(OUTPUT python/opm/${python_lib_target}
|
||||
DEPENDS ${PYTHON_CXX_DEPENDS}
|
||||
DEPENDS copy_python
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/setup.py
|
||||
build
|
||||
build_ext
|
||||
--build-lib=${PROJECT_BINARY_DIR}/python
|
||||
--library-dirs=${_setup_lib_dirs}
|
||||
${_rpath_arg}
|
||||
--include-dirs=${_setup_include_dirs}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
|
||||
COMMENT "Building python bindings at python/opm/${python_lib_target}")
|
||||
add_custom_target(opmcommon_python ALL DEPENDS python/opm/${python_lib_target})
|
||||
add_dependencies(opmcommon_python opmcommon)
|
||||
|
||||
# The install target is based on manually copying the python file tree to the
|
||||
# installation area with a small installation script 'install.py'. Would have
|
||||
# preferred to use standard setup.py install, but the setup.py based solution
|
||||
# refuses to install to a location which the current python executable can not
|
||||
# load from, and the use of eggs in the setup.py based installation makes
|
||||
# debugging quite difficult.
|
||||
#
|
||||
# Since the installation of Python code is nonstandard it is protected by an
|
||||
# extra cmake switch, OPM_INSTALL_PYTHON. If you prefer you can still invoke
|
||||
# setup.py install manually - optionally with the generated script
|
||||
# setup-install.sh - and completely bypass cmake in the installation phase.
|
||||
if (OPM_INSTALL_PYTHON)
|
||||
install( CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/install.py ${PROJECT_BINARY_DIR}/python/opm ${DEST_PREFIX}${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} 1)")
|
||||
endif()
|
||||
|
||||
# Observe that if the opmcommon library has been built as a shared library the
|
||||
# python library opmcommon_python will in general not find it runtime while
|
||||
# testing.
|
||||
add_test(NAME python_tests
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
|
||||
COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/lib ${PYTHON_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${PROJECT_BINARY_DIR}/python test
|
||||
)
|
||||
|
||||
set_target_properties(opmcommon PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/python)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Let cmake configure some small shell scripts which can be used to simplify
|
||||
# building, testing and installation of the Python extensions.
|
||||
configure_file(python/setup-build.sh.in tmp/setup-build.sh)
|
||||
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-build.sh
|
||||
DESTINATION ${PROJECT_BINARY_DIR}
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
|
||||
|
||||
configure_file(python/setup-package.sh.in tmp/setup-package.sh)
|
||||
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-package.sh
|
||||
DESTINATION ${PROJECT_BINARY_DIR}
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
|
||||
|
||||
configure_file(python/setup-test.sh.in tmp/setup-test.sh)
|
||||
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-test.sh
|
||||
DESTINATION ${PROJECT_BINARY_DIR}
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
|
||||
|
||||
configure_file(python/setup-install.sh.in tmp/setup-install.sh)
|
||||
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-install.sh
|
||||
DESTINATION ${PROJECT_BINARY_DIR}
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
|
||||
|
||||
configure_file(python/enable-python.sh.in enable-python.sh)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 2: Embed the Python interpreter for keywords like PYACTION and PYINPUT
|
||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
||||
add_subdirectory(python/pybind11)
|
||||
target_include_directories(opmcommon SYSTEM PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
|
||||
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
|
||||
|
||||
add_definitions(-DEMBEDDED_PYTHON)
|
||||
endif()
|
||||
endif()
|
||||
841
ThirdParty/custom-opm-common/opm-common/CMakeLists_files.cmake
vendored
Normal file
841
ThirdParty/custom-opm-common/opm-common/CMakeLists_files.cmake
vendored
Normal file
@@ -0,0 +1,841 @@
|
||||
# This file sets up five lists:
|
||||
# MAIN_SOURCE_FILES List of compilation units which will be included in
|
||||
# the library. If it isn't on this list, it won't be
|
||||
# part of the library. Please try to keep it sorted to
|
||||
# maintain sanity.
|
||||
#
|
||||
# TEST_SOURCE_FILES List of programs that will be run as unit tests.
|
||||
#
|
||||
# TEST_DATA_FILES Files from the source three that should be made
|
||||
# available in the corresponding location in the build
|
||||
# tree in order to run tests there.
|
||||
#
|
||||
# EXAMPLE_SOURCE_FILES Other programs that will be compiled as part of the
|
||||
# build, but which is not part of the library nor is
|
||||
# run as tests.
|
||||
#
|
||||
# PUBLIC_HEADER_FILES List of public header files that should be
|
||||
# distributed together with the library. The source
|
||||
# files can of course include other files than these;
|
||||
# you should only add to this list if the *user* of
|
||||
# the library needs it.
|
||||
#
|
||||
# CROSS_COMPILE_FILES List of header files providing substitutes for
|
||||
# functions exclusively available on Linux build
|
||||
# systems.
|
||||
|
||||
list (APPEND MAIN_SOURCE_FILES
|
||||
src/opm/common/data/SimulationDataContainer.cpp
|
||||
src/opm/common/OpmLog/CounterLog.cpp
|
||||
src/opm/common/OpmLog/EclipsePRTLog.cpp
|
||||
src/opm/common/OpmLog/LogBackend.cpp
|
||||
src/opm/common/OpmLog/Logger.cpp
|
||||
src/opm/common/OpmLog/LogUtil.cpp
|
||||
src/opm/common/OpmLog/OpmLog.cpp
|
||||
src/opm/common/OpmLog/StreamLog.cpp
|
||||
src/opm/common/OpmLog/TimerLog.cpp
|
||||
src/opm/common/utility/ActiveGridCells.cpp
|
||||
src/opm/common/utility/FileSystem.cpp
|
||||
src/opm/common/utility/numeric/MonotCubicInterpolator.cpp
|
||||
src/opm/common/utility/parameters/Parameter.cpp
|
||||
src/opm/common/utility/parameters/ParameterGroup.cpp
|
||||
src/opm/common/utility/parameters/ParameterTools.cpp
|
||||
src/opm/common/utility/numeric/calculateCellVol.cpp
|
||||
src/opm/common/utility/TimeService.cpp
|
||||
)
|
||||
if(ENABLE_ECL_INPUT)
|
||||
list(APPEND MAIN_SOURCE_FILES
|
||||
src/opm/io/eclipse/SummaryNode.cpp
|
||||
src/opm/json/JsonObject.cpp
|
||||
src/opm/parser/eclipse/Deck/Deck.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckItem.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckValue.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckRecord.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckOutput.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckSection.cpp
|
||||
src/opm/parser/eclipse/Deck/UDAValue.cpp
|
||||
src/opm/parser/eclipse/Python/Python.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp
|
||||
src/opm/parser/eclipse/EclipseState/AquiferConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/AquiferCT.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Aquifetp.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Aquancon.cpp
|
||||
src/opm/parser/eclipse/EclipseState/checkDeck.cpp
|
||||
src/opm/parser/eclipse/EclipseState/EclipseConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/EclipseState.cpp
|
||||
src/opm/parser/eclipse/EclipseState/EndpointScaling.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Edit/EDITNNC.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/Box.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/BoxManager.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/FaceDir.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/FaultCollection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/Fault.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/FaultFace.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/GridDims.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/NNC.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/Operate.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/PinchMode.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/setKeywordBox.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/TransMult.cpp
|
||||
src/opm/parser/eclipse/EclipseState/InitConfig/Equil.cpp
|
||||
src/opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/InitConfig/InitConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/IOConfig/IOConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Runspec.cpp
|
||||
src/opm/parser/eclipse/EclipseState/TracerConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionParser.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Condition.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/State.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GPMaint.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GConSump.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/injection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MessageLimits.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/icd.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Compsegs.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/AICD.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/SICD.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Network/Branch.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Network/ExtNetwork.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Network/Node.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/RFTConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/RPTConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/SummaryState.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/TimeMap.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Connection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/eval_uda.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WList.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.cpp
|
||||
src/opm/parser/eclipse/EclipseState/SimulationConfig/BCConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/SimulationConfig/RockConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.cpp
|
||||
src/opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/ColumnSchema.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/DenT.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/JFunc.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/PvtxTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/SimpleTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/PolyInjTables.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/StandardCond.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/TableColumn.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/TableContainer.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/TableIndex.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/TLMixpar.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/TableSchema.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/RwgsaltTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParser.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp
|
||||
src/opm/parser/eclipse/Parser/ErrorGuard.cpp
|
||||
src/opm/parser/eclipse/Parser/ParseContext.cpp
|
||||
src/opm/parser/eclipse/Parser/Parser.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserEnums.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserItem.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserRecord.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
|
||||
src/opm/parser/eclipse/Units/Dimension.cpp
|
||||
src/opm/parser/eclipse/Units/UnitSystem.cpp
|
||||
src/opm/parser/eclipse/Utility/Functional.cpp
|
||||
)
|
||||
|
||||
|
||||
# This list is only used to register a CMake dependency between the the python
|
||||
# extension and the corresponding C++ wrapper files. The cpp files actually
|
||||
# listed here are repeated in the actual definition of the extension in the
|
||||
# setup.py file.
|
||||
list( APPEND PYTHON_CXX_SOURCE_FILES
|
||||
python/cxx/connection.cpp
|
||||
python/cxx/converters.cpp
|
||||
python/cxx/deck.cpp
|
||||
python/cxx/deck_keyword.cpp
|
||||
python/cxx/eclipse_io.cpp
|
||||
python/cxx/field_props.cpp
|
||||
python/cxx/eclipse_config.cpp
|
||||
python/cxx/eclipse_grid.cpp
|
||||
python/cxx/eclipse_state.cpp
|
||||
python/cxx/export.cpp
|
||||
python/cxx/group.cpp
|
||||
python/cxx/log.cpp
|
||||
python/cxx/parsecontext.cpp
|
||||
python/cxx/parser.cpp
|
||||
python/cxx/schedule.cpp
|
||||
python/cxx/summary_state.cpp
|
||||
python/cxx/table_manager.cpp
|
||||
python/cxx/unit_system.cpp
|
||||
python/cxx/well.cpp
|
||||
)
|
||||
|
||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
||||
set_source_files_properties(${PYTHON_CXX_SOURCE_FILES} PROPERTIES COMPILE_FLAGS -Wno-shadow)
|
||||
set_source_files_properties(src/opm/parser/eclipse/Python/PythonInterp.cpp PROPERTIES COMPILE_FLAGS -Wno-shadow)
|
||||
set_source_files_properties(src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp PROPERTIES COMPILE_FLAGS -Wno-shadow)
|
||||
list( APPEND MAIN_SOURCE_FILES
|
||||
src/opm/parser/eclipse/Python/PythonInterp.cpp
|
||||
src/opm/parser/eclipse/Python/PyRunModule.cpp
|
||||
${PYTHON_CXX_SOURCE_FILES})
|
||||
endif()
|
||||
|
||||
list( APPEND PYTHON_CXX_DEPENDS ${PYTHON_CXX_SOURCE_FILES}
|
||||
python/cxx/converters.hpp
|
||||
python/cxx/export.hpp)
|
||||
|
||||
if(NOT cjson_FOUND)
|
||||
list(APPEND MAIN_SOURCE_FILES external/cjson/cJSON.c)
|
||||
endif()
|
||||
endif()
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
list( APPEND MAIN_SOURCE_FILES
|
||||
src/opm/io/eclipse/EclFile.cpp
|
||||
src/opm/io/eclipse/EclOutput.cpp
|
||||
src/opm/io/eclipse/EclUtil.cpp
|
||||
src/opm/io/eclipse/EGrid.cpp
|
||||
src/opm/io/eclipse/ERft.cpp
|
||||
src/opm/io/eclipse/ERst.cpp
|
||||
src/opm/io/eclipse/ERsm.cpp
|
||||
src/opm/io/eclipse/ESmry.cpp
|
||||
src/opm/io/eclipse/ESmry_write_rsm.cpp
|
||||
src/opm/io/eclipse/OutputStream.cpp
|
||||
src/opm/io/eclipse/SummaryNode.cpp
|
||||
src/opm/io/eclipse/rst/connection.cpp
|
||||
src/opm/io/eclipse/rst/group.cpp
|
||||
src/opm/io/eclipse/rst/header.cpp
|
||||
src/opm/io/eclipse/rst/segment.cpp
|
||||
src/opm/io/eclipse/rst/state.cpp
|
||||
src/opm/io/eclipse/rst/well.cpp
|
||||
src/opm/output/eclipse/AggregateActionxData.cpp
|
||||
src/opm/output/eclipse/AggregateConnectionData.cpp
|
||||
src/opm/output/eclipse/AggregateGroupData.cpp
|
||||
src/opm/output/eclipse/AggregateMSWData.cpp
|
||||
src/opm/output/eclipse/AggregateUDQData.cpp
|
||||
src/opm/output/eclipse/AggregateWellData.cpp
|
||||
src/opm/output/eclipse/CreateActionxDims.cpp
|
||||
src/opm/output/eclipse/CreateDoubHead.cpp
|
||||
src/opm/output/eclipse/CreateInteHead.cpp
|
||||
src/opm/output/eclipse/CreateLogiHead.cpp
|
||||
src/opm/output/eclipse/CreateUdqDims.cpp
|
||||
src/opm/output/eclipse/DoubHEAD.cpp
|
||||
src/opm/output/eclipse/EclipseGridInspector.cpp
|
||||
src/opm/output/eclipse/EclipseIO.cpp
|
||||
src/opm/output/eclipse/InteHEAD.cpp
|
||||
src/opm/output/eclipse/LinearisedOutputTable.cpp
|
||||
src/opm/output/eclipse/LoadRestart.cpp
|
||||
src/opm/output/eclipse/LogiHEAD.cpp
|
||||
src/opm/output/eclipse/RestartIO.cpp
|
||||
src/opm/output/eclipse/Summary.cpp
|
||||
src/opm/output/eclipse/Tables.cpp
|
||||
src/opm/output/eclipse/RegionCache.cpp
|
||||
src/opm/output/eclipse/RestartValue.cpp
|
||||
src/opm/output/eclipse/WriteInit.cpp
|
||||
src/opm/output/eclipse/WriteRFT.cpp
|
||||
src/opm/output/eclipse/WriteRPT.cpp
|
||||
src/opm/output/eclipse/report/WELSPECS.cpp
|
||||
src/opm/output/data/Solution.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
list (APPEND TEST_SOURCE_FILES
|
||||
tests/test_ActiveGridCells.cpp
|
||||
tests/test_calculateCellVol.cpp
|
||||
tests/test_cmp.cpp
|
||||
tests/test_cubic.cpp
|
||||
tests/test_messagelimiter.cpp
|
||||
tests/test_nonuniformtablelinear.cpp
|
||||
tests/test_OpmLog.cpp
|
||||
tests/test_param.cpp
|
||||
tests/test_RootFinders.cpp
|
||||
tests/test_SimulationDataContainer.cpp
|
||||
tests/test_sparsevector.cpp
|
||||
tests/test_uniformtablelinear.cpp
|
||||
)
|
||||
if(ENABLE_ECL_INPUT)
|
||||
list(APPEND TEST_SOURCE_FILES
|
||||
tests/rst_test.cpp
|
||||
tests/test_ERsm.cpp
|
||||
tests/parser/ACTIONX.cpp
|
||||
tests/parser/ADDREGTests.cpp
|
||||
tests/parser/AquiferTests.cpp
|
||||
tests/parser/BoxTests.cpp
|
||||
tests/parser/ColumnSchemaTests.cpp
|
||||
tests/parser/ConnectionTests.cpp
|
||||
tests/parser/COMPSEGUnits.cpp
|
||||
tests/parser/CopyRegTests.cpp
|
||||
tests/parser/DeckValueTests.cpp
|
||||
tests/parser/DeckTests.cpp
|
||||
tests/parser/DynamicStateTests.cpp
|
||||
tests/parser/DynamicVectorTests.cpp
|
||||
tests/parser/EclipseGridTests.cpp
|
||||
tests/parser/EmbeddedPython.cpp
|
||||
tests/parser/EqualRegTests.cpp
|
||||
tests/parser/EventTests.cpp
|
||||
tests/parser/FaceDirTests.cpp
|
||||
tests/parser/FaultTests.cpp
|
||||
tests/parser/FieldPropsTests.cpp
|
||||
tests/parser/FoamTests.cpp
|
||||
tests/parser/FunctionalTests.cpp
|
||||
tests/parser/GeomodifierTests.cpp
|
||||
tests/parser/GroupTests.cpp
|
||||
tests/parser/InitConfigTest.cpp
|
||||
tests/parser/IOConfigTests.cpp
|
||||
tests/parser/MessageLimitTests.cpp
|
||||
tests/parser/MultiRegTests.cpp
|
||||
tests/parser/MultisegmentWellTests.cpp
|
||||
tests/parser/MULTREGTScannerTests.cpp
|
||||
tests/parser/NetworkTests.cpp
|
||||
tests/parser/OrderedMapTests.cpp
|
||||
tests/parser/ParseContextTests.cpp
|
||||
tests/parser/ParseContext_EXIT1.cpp
|
||||
tests/parser/ParseDATAWithDefault.cpp
|
||||
tests/parser/PYACTION.cpp
|
||||
tests/parser/RawKeywordTests.cpp
|
||||
tests/parser/test_ReportConfig.cpp
|
||||
tests/parser/ResinsightTest.cpp
|
||||
tests/parser/RestartConfigTests.cpp
|
||||
tests/parser/RFTConfigTests.cpp
|
||||
tests/parser/RockTableTests.cpp
|
||||
tests/parser/RunspecTests.cpp
|
||||
tests/parser/SaltTableTests.cpp
|
||||
tests/parser/ScheduleRestartTests.cpp
|
||||
tests/parser/ScheduleTests.cpp
|
||||
tests/parser/SectionTests.cpp
|
||||
tests/parser/SimpleTableTests.cpp
|
||||
tests/parser/SimulationConfigTest.cpp
|
||||
tests/parser/StarTokenTests.cpp
|
||||
tests/parser/StringTests.cpp
|
||||
tests/parser/SummaryConfigTests.cpp
|
||||
tests/parser/TabdimsTests.cpp
|
||||
tests/parser/TableColumnTests.cpp
|
||||
tests/parser/TableContainerTests.cpp
|
||||
tests/parser/TableManagerTests.cpp
|
||||
tests/parser/TableSchemaTests.cpp
|
||||
tests/parser/ThresholdPressureTest.cpp
|
||||
tests/parser/TimeMapTest.cpp
|
||||
tests/parser/TracerTests.cpp
|
||||
tests/parser/TransMultTests.cpp
|
||||
tests/parser/TuningTests.cpp
|
||||
tests/parser/UDQTests.cpp
|
||||
tests/parser/UnitTests.cpp
|
||||
tests/parser/ValueTests.cpp
|
||||
tests/parser/WellSolventTests.cpp
|
||||
tests/parser/WellTracerTests.cpp
|
||||
tests/parser/WellTests.cpp
|
||||
tests/parser/WLIST.cpp
|
||||
tests/parser/WTEST.cpp)
|
||||
endif()
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
list (APPEND TEST_SOURCE_FILES
|
||||
tests/test_AggregateActionxData.cpp
|
||||
tests/test_AggregateWellData.cpp
|
||||
tests/test_AggregateGroupData.cpp
|
||||
tests/test_AggregateMSWData.cpp
|
||||
tests/test_AggregateConnectionData.cpp
|
||||
tests/test_AggregateUDQData.cpp
|
||||
tests/test_ArrayDimChecker.cpp
|
||||
tests/test_data_GuideRateValue.cpp
|
||||
tests/test_EclipseIO.cpp
|
||||
tests/test_DoubHEAD.cpp
|
||||
tests/test_InteHEAD.cpp
|
||||
tests/test_LinearisedOutputTable.cpp
|
||||
tests/test_LogiHEAD.cpp
|
||||
tests/test_OutputStream.cpp
|
||||
tests/test_regionCache.cpp
|
||||
tests/test_PaddedOutputString.cpp
|
||||
tests/test_Restart.cpp
|
||||
tests/test_RFT.cpp
|
||||
tests/test_rst.cpp
|
||||
tests/test_Solution.cpp
|
||||
tests/test_Summary.cpp
|
||||
tests/test_Summary_Group.cpp
|
||||
tests/test_Tables.cpp
|
||||
tests/test_Wells.cpp
|
||||
tests/test_WindowedArray.cpp
|
||||
tests/test_restartwellinfo.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
list (APPEND TEST_DATA_FILES
|
||||
tests/testdata.param
|
||||
)
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
list (APPEND TEST_DATA_FILES
|
||||
tests/expect-wdims.chldg.err.out
|
||||
tests/expect-wdims.err.out
|
||||
tests/BASE_SIM.DATA
|
||||
tests/BASE_SIM_THPRES.DATA
|
||||
tests/RESTART_SIM.DATA
|
||||
tests/summary_deck.DATA
|
||||
tests/group_group.DATA
|
||||
tests/testblackoilstate3.DATA
|
||||
tests/testrft.DATA
|
||||
tests/table_deck.DATA
|
||||
tests/summary_deck_non_constant_porosity.DATA
|
||||
tests/SUMMARY_EFF_FAC.DATA
|
||||
tests/SPE1CASE1.DATA
|
||||
tests/SPE1CASE1.SMSPEC
|
||||
tests/SPE1CASE1A.SMSPEC
|
||||
tests/SPE9_CP_PACKED.DATA
|
||||
tests/SOFR_TEST.DATA
|
||||
tests/UDQ_BASE.DATA
|
||||
tests/UDQ_RESTART.DATA
|
||||
tests/UDQ_TEST_WCONPROD_IUAD-2.DATA
|
||||
tests/UDQ_ACTIONX_TEST1.DATA
|
||||
tests/UDQ_ACTIONX_TEST1_U.DATA
|
||||
tests/include_example_pvt.txt
|
||||
tests/include_example_summary.txt
|
||||
tests/include_sgof.txt
|
||||
tests/include_swof.txt
|
||||
tests/include_grid_3x5x4.grdecl
|
||||
tests/SPE1CASE2.DATA
|
||||
tests/SPE1CASE2_RESTART.DATA
|
||||
tests/SPE1CASE2.X0060
|
||||
tests/PYACTION.DATA
|
||||
tests/act1.py
|
||||
tests/MSW.DATA
|
||||
tests/EXIT_TEST.DATA
|
||||
tests/action_syntax_error.py
|
||||
tests/action_missing_run.py
|
||||
tests/EMBEDDED_PYTHON.DATA
|
||||
tests/wclose.py
|
||||
tests/msim/MSIM_PYACTION.DATA
|
||||
tests/msim/action1.py
|
||||
tests/msim/action2.py
|
||||
)
|
||||
endif()
|
||||
|
||||
list (APPEND EXAMPLE_SOURCE_FILES
|
||||
)
|
||||
if(ENABLE_ECL_INPUT)
|
||||
list (APPEND TEST_DATA_FILES
|
||||
tests/ECLFILE.INIT
|
||||
tests/ECLFILE.FINIT
|
||||
tests/SPE1CASE1.EGRID
|
||||
tests/SPE1CASE1.RFT
|
||||
tests/SPE1_TESTCASE.UNRST
|
||||
tests/SPE1_TESTCASE.FUNRST
|
||||
tests/SPE1_TESTCASE.F0025
|
||||
tests/SPE1_TESTCASE.X0025
|
||||
tests/SPE1CASE1.UNSMRY
|
||||
tests/SPE1CASE1A.UNSMRY
|
||||
tests/SPE1CASE1_RST60.SMSPEC
|
||||
tests/SPE1CASE1_RST60.UNSMRY
|
||||
tests/MODEL2_RESTART.DATA
|
||||
tests/restart/MODEL2.UNRST
|
||||
)
|
||||
list (APPEND EXAMPLE_SOURCE_FILES
|
||||
#examples/opmi.cpp
|
||||
#examples/opmpack.cpp
|
||||
#examples/opmhash.cpp
|
||||
#examples/wellgraph.cpp
|
||||
#examples/make_lodsmry.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
# programs listed here will not only be compiled, but also marked for
|
||||
# installation
|
||||
list (APPEND PROGRAM_SOURCE_FILES
|
||||
)
|
||||
if(ENABLE_ECL_INPUT)
|
||||
list (APPEND PROGRAM_SOURCE_FILES
|
||||
examples/opmi.cpp
|
||||
examples/opmpack.cpp
|
||||
examples/opmhash.cpp
|
||||
examples/make_lodsmry.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
list( APPEND PUBLIC_HEADER_FILES
|
||||
opm/common/ErrorMacros.hpp
|
||||
opm/common/Exceptions.hpp
|
||||
opm/common/data/SimulationDataContainer.hpp
|
||||
opm/common/OpmLog/CounterLog.hpp
|
||||
opm/common/OpmLog/EclipsePRTLog.hpp
|
||||
opm/common/OpmLog/LogBackend.hpp
|
||||
opm/common/OpmLog/Logger.hpp
|
||||
opm/common/OpmLog/LogUtil.hpp
|
||||
opm/common/OpmLog/MessageFormatter.hpp
|
||||
opm/common/OpmLog/MessageLimiter.hpp
|
||||
opm/common/OpmLog/Location.hpp
|
||||
opm/common/OpmLog/OpmLog.hpp
|
||||
opm/common/OpmLog/StreamLog.hpp
|
||||
opm/common/OpmLog/TimerLog.hpp
|
||||
opm/common/utility/ActiveGridCells.hpp
|
||||
opm/common/utility/FileSystem.hpp
|
||||
opm/common/utility/numeric/cmp.hpp
|
||||
opm/common/utility/platform_dependent/disable_warnings.h
|
||||
opm/common/utility/platform_dependent/reenable_warnings.h
|
||||
opm/common/utility/numeric/blas_lapack.h
|
||||
opm/common/utility/numeric/buildUniformMonotoneTable.hpp
|
||||
opm/common/utility/numeric/linearInterpolation.hpp
|
||||
opm/common/utility/numeric/MonotCubicInterpolator.hpp
|
||||
opm/common/utility/numeric/NonuniformTableLinear.hpp
|
||||
opm/common/utility/numeric/RootFinders.hpp
|
||||
opm/common/utility/numeric/SparseVector.hpp
|
||||
opm/common/utility/numeric/UniformTableLinear.hpp
|
||||
opm/common/utility/parameters/ParameterGroup.hpp
|
||||
opm/common/utility/parameters/ParameterGroup_impl.hpp
|
||||
opm/common/utility/parameters/Parameter.hpp
|
||||
opm/common/utility/parameters/ParameterMapItem.hpp
|
||||
opm/common/utility/parameters/ParameterRequirement.hpp
|
||||
opm/common/utility/parameters/ParameterStrings.hpp
|
||||
opm/common/utility/parameters/ParameterTools.hpp
|
||||
opm/common/utility/numeric/calculateCellVol.hpp
|
||||
opm/common/utility/String.hpp
|
||||
opm/common/utility/TimeService.hpp
|
||||
)
|
||||
if(ENABLE_ECL_INPUT)
|
||||
list(APPEND PUBLIC_HEADER_FILES
|
||||
opm/io/eclipse/SummaryNode.hpp
|
||||
opm/json/JsonObject.hpp
|
||||
opm/parser/eclipse/Utility/Functional.hpp
|
||||
opm/parser/eclipse/Utility/Typetools.hpp
|
||||
opm/parser/eclipse/Generator/KeywordGenerator.hpp
|
||||
opm/parser/eclipse/Generator/KeywordLoader.hpp
|
||||
opm/parser/eclipse/Units/UnitSystem.hpp
|
||||
opm/parser/eclipse/Units/Units.hpp
|
||||
opm/parser/eclipse/Units/Dimension.hpp
|
||||
opm/parser/eclipse/Parser/ErrorGuard.hpp
|
||||
opm/parser/eclipse/Parser/ParserItem.hpp
|
||||
opm/parser/eclipse/Parser/Parser.hpp
|
||||
opm/parser/eclipse/Parser/ParserRecord.hpp
|
||||
opm/parser/eclipse/Parser/ParserKeyword.hpp
|
||||
opm/parser/eclipse/Parser/InputErrorAction.hpp
|
||||
opm/parser/eclipse/Parser/ParserEnums.hpp
|
||||
opm/parser/eclipse/Parser/ParseContext.hpp
|
||||
opm/parser/eclipse/Parser/ParserConst.hpp
|
||||
opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/InitConfig/Equil.hpp
|
||||
opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Util/Value.hpp
|
||||
opm/parser/eclipse/EclipseState/Util/IOrderSet.hpp
|
||||
opm/parser/eclipse/EclipseState/Util/OrderedMap.hpp
|
||||
opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Edit/EDITNNC.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/GridDims.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/TransMult.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/PinchMode.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/FaultCollection.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/Fault.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/Box.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/FaultFace.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/NNC.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/BoxManager.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp
|
||||
opm/parser/eclipse/EclipseState/Grid/MinpvMode.hpp
|
||||
opm/parser/eclipse/EclipseState/EndpointScaling.hpp
|
||||
opm/parser/eclipse/EclipseState/TracerConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/DenT.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SimpleTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/StandardCond.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PolyInjTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PdvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/TlpmixpaTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PvdgTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/MsfnTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/GasvisctTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/Regdims.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SpecrockTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PermfactTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/RwgsaltTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SaltpvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlydhflfTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlymwinjTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/RsvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SkprwatTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SkprpolyTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SpecheatTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SgcwmisTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/Sof2Table.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/TLMixpar.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/TableManager.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SwfnTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/EnptvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SwofTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/Aqudims.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/JFunc.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/TableIndex.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PvtgTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PvtgwTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PvtgwoTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/Tabdims.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/TableSchema.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/RocktabTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/EnkrvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlyrockTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PvtxTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/WatvisctTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/TableEnums.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/RvvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/TableContainer.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/AqutabTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlyadsTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/FoamadsTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PbvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SorwmisTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlymaxTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlyviscTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/TableColumn.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SsfnTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PvdoTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/OilvisctTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SgfnTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/MiscTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SgwfnTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PvdsTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/Rock2dTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/RockwnodTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/OverburdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/ColumnSchema.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PmiscTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/RtempvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SlgofTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/ImptvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/ImkrvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/Sof3Table.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SgofTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/TracerVdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/EclipseState.hpp
|
||||
opm/parser/eclipse/EclipseState/EclipseConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Aquancon.hpp
|
||||
opm/parser/eclipse/EclipseState/AquiferConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/AquiferCT.hpp
|
||||
opm/parser/eclipse/EclipseState/Aquifetp.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/Condition.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/State.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Network/Branch.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Network/ExtNetwork.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Network/Node.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/ProductionControls.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/InjectionControls.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/RPTConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GPMaint.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GConSump.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Events.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/icd.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/AICD.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/SICD.hpp
|
||||
opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp
|
||||
opm/parser/eclipse/EclipseState/SimulationConfig/BCConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/SimulationConfig/RockConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.hpp
|
||||
opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/checkDeck.hpp
|
||||
opm/parser/eclipse/EclipseState/Runspec.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp
|
||||
opm/parser/eclipse/Deck/DeckItem.hpp
|
||||
opm/parser/eclipse/Deck/Deck.hpp
|
||||
opm/parser/eclipse/Deck/DeckSection.hpp
|
||||
opm/parser/eclipse/Deck/DeckOutput.hpp
|
||||
opm/parser/eclipse/Deck/DeckValue.hpp
|
||||
opm/parser/eclipse/Deck/DeckKeyword.hpp
|
||||
opm/parser/eclipse/Deck/DeckRecord.hpp
|
||||
opm/parser/eclipse/Deck/UDAValue.hpp
|
||||
opm/parser/eclipse/Deck/value_status.hpp
|
||||
opm/parser/eclipse/Python/Python.hpp)
|
||||
endif()
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
list(APPEND PUBLIC_HEADER_FILES
|
||||
opm/io/eclipse/EclFile.hpp
|
||||
opm/io/eclipse/EclIOdata.hpp
|
||||
opm/io/eclipse/EclOutput.hpp
|
||||
opm/io/eclipse/EclUtil.hpp
|
||||
opm/io/eclipse/EGrid.hpp
|
||||
opm/io/eclipse/ERft.hpp
|
||||
opm/io/eclipse/ERst.hpp
|
||||
opm/io/eclipse/ERsm.hpp
|
||||
opm/io/eclipse/ESmry.hpp
|
||||
opm/io/eclipse/PaddedOutputString.hpp
|
||||
opm/io/eclipse/OutputStream.hpp
|
||||
opm/io/eclipse/SummaryNode.hpp
|
||||
opm/io/eclipse/rst/connection.hpp
|
||||
opm/io/eclipse/rst/group.hpp
|
||||
opm/io/eclipse/rst/header.hpp
|
||||
opm/io/eclipse/rst/segment.hpp
|
||||
opm/io/eclipse/rst/state.hpp
|
||||
opm/io/eclipse/rst/well.hpp
|
||||
opm/output/data/Aquifer.hpp
|
||||
opm/output/data/Cells.hpp
|
||||
opm/output/data/GuideRateValue.hpp
|
||||
opm/output/data/Groups.hpp
|
||||
opm/output/data/Solution.hpp
|
||||
opm/output/data/Wells.hpp
|
||||
opm/output/eclipse/VectorItems/aquifer.hpp
|
||||
opm/output/eclipse/VectorItems/connection.hpp
|
||||
opm/output/eclipse/VectorItems/group.hpp
|
||||
opm/output/eclipse/VectorItems/intehead.hpp
|
||||
opm/output/eclipse/VectorItems/logihead.hpp
|
||||
opm/output/eclipse/VectorItems/msw.hpp
|
||||
opm/output/eclipse/VectorItems/tabdims.hpp
|
||||
opm/output/eclipse/VectorItems/well.hpp
|
||||
opm/output/eclipse/AggregateActionxData.hpp
|
||||
opm/output/eclipse/AggregateGroupData.hpp
|
||||
opm/output/eclipse/AggregateConnectionData.hpp
|
||||
opm/output/eclipse/AggregateMSWData.hpp
|
||||
opm/output/eclipse/AggregateUDQData.hpp
|
||||
opm/output/eclipse/AggregateWellData.hpp
|
||||
opm/output/eclipse/DoubHEAD.hpp
|
||||
opm/output/eclipse/EclipseGridInspector.hpp
|
||||
opm/output/eclipse/EclipseIO.hpp
|
||||
opm/output/eclipse/EclipseIOUtil.hpp
|
||||
opm/output/eclipse/InteHEAD.hpp
|
||||
opm/output/eclipse/LinearisedOutputTable.hpp
|
||||
opm/output/eclipse/LogiHEAD.hpp
|
||||
opm/output/eclipse/RegionCache.hpp
|
||||
opm/output/eclipse/RestartIO.hpp
|
||||
opm/output/eclipse/RestartValue.hpp
|
||||
opm/output/eclipse/Summary.hpp
|
||||
opm/output/eclipse/Tables.hpp
|
||||
opm/output/eclipse/WindowedArray.hpp
|
||||
opm/output/eclipse/WriteInit.hpp
|
||||
opm/output/eclipse/WriteRFT.hpp
|
||||
opm/output/eclipse/WriteRPT.hpp
|
||||
opm/output/eclipse/WriteRestartHelpers.hpp
|
||||
opm/output/OutputWriter.hpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_ECL_INPUT OR ENABLE_ECL_OUTPUT)
|
||||
list(APPEND TEST_SOURCE_FILES
|
||||
tests/test_SummaryNode.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
list( APPEND PUBLIC_HEADER_FILES
|
||||
cross-platform/windows/Substitutes.hpp
|
||||
)
|
||||
endif()
|
||||
24
ThirdParty/custom-opm-common/opm-common/CopyHeaders.cmake
vendored
Normal file
24
ThirdParty/custom-opm-common/opm-common/CopyHeaders.cmake
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${BASE_DIR}/tmp_gen/ParserInit.cpp
|
||||
${BASE_DIR}/ParserInit.cpp)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${BASE_DIR}/tmp_gen/TestKeywords.cpp
|
||||
${BASE_DIR}/TestKeywords.cpp)
|
||||
|
||||
|
||||
file(GLOB HDRS ${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords/*.hpp)
|
||||
|
||||
foreach(HDR ${HDRS})
|
||||
file(RELATIVE_PATH hdr ${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords ${HDR})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${HDR}
|
||||
${BASE_DIR}/include/opm/parser/eclipse/Parser/ParserKeywords/${hdr})
|
||||
|
||||
endforeach()
|
||||
|
||||
foreach (name A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${BASE_DIR}/tmp_gen/ParserKeywords/${name}.cpp
|
||||
${BASE_DIR}/ParserKeywords/${name}.cpp)
|
||||
endforeach()
|
||||
127
ThirdParty/custom-opm-common/opm-common/ExtraTests.cmake
vendored
Normal file
127
ThirdParty/custom-opm-common/opm-common/ExtraTests.cmake
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
# Libs to link tests against
|
||||
set(TEST_LIBS opmcommon Boost::unit_test_framework)
|
||||
set(EXTRA_TESTS)
|
||||
|
||||
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
||||
|
||||
# Generated source, needs to be here
|
||||
opm_add_test(InlineKeywordTest
|
||||
EXE_NAME TestKeywords
|
||||
SOURCES ${PROJECT_BINARY_DIR}/TestKeywords.cpp
|
||||
LIBRARIES ${TEST_LIBS})
|
||||
list(APPEND EXTRA_TESTS TestKeywords)
|
||||
|
||||
# Extra compile definitions and extra parameters
|
||||
include(cmake/Modules/CheckCaseSensitiveFileSystem.cmake)
|
||||
set(_testdir ${PROJECT_SOURCE_DIR}/tests/parser/data)
|
||||
|
||||
opm_add_test(ParserTests
|
||||
SOURCES tests/parser/ParserTests.cpp
|
||||
LIBRARIES ${TEST_LIBS}
|
||||
TEST_ARGS ${_testdir}/)
|
||||
list(APPEND EXTRA_TESTS ParserTests)
|
||||
|
||||
opm_add_test(ParserIncludeTests
|
||||
SOURCES tests/parser/ParserIncludeTests.cpp
|
||||
LIBRARIES ${TEST_LIBS}
|
||||
TEST_ARGS ${_testdir}/parser/)
|
||||
target_compile_definitions(ParserIncludeTests PRIVATE
|
||||
-DHAVE_CASE_SENSITIVE_FILESYSTEM=${HAVE_CASE_SENSITIVE_FILESYSTEM})
|
||||
list(APPEND EXTRA_TESTS ParserIncludeTests)
|
||||
|
||||
opm_add_test(PvtxTableTests
|
||||
SOURCES tests/parser/PvtxTableTests.cpp
|
||||
LIBRARIES ${TEST_LIBS}
|
||||
TEST_ARGS ${_testdir}/integration_tests/)
|
||||
list(APPEND EXTRA_TESTS PvtxTableTests)
|
||||
|
||||
opm_add_test(EclipseStateTests
|
||||
SOURCES tests/parser/EclipseStateTests.cpp
|
||||
LIBRARIES ${TEST_LIBS}
|
||||
TEST_ARGS ${_testdir}/integration_tests/)
|
||||
list(APPEND EXTRA_TESTS EclipseStateTests)
|
||||
|
||||
foreach (test BoxTest
|
||||
CheckDeckValidity
|
||||
EclipseGridCreateFromDeck
|
||||
EDITNNCTests
|
||||
IncludeTest
|
||||
IntegrationTests
|
||||
IOConfigIntegrationTest
|
||||
NNCTests
|
||||
ParseKEYWORD
|
||||
Polymer
|
||||
ScheduleCreateFromDeck
|
||||
TransMultIntegrationTests)
|
||||
|
||||
opm_add_test(${test}
|
||||
SOURCES tests/parser/integration/${test}.cpp
|
||||
LIBRARIES ${TEST_LIBS}
|
||||
TEST_ARGS ${_testdir}/integration_tests/)
|
||||
list(APPEND EXTRA_TESTS ${test})
|
||||
endforeach ()
|
||||
|
||||
opm_add_test( rst_spe1
|
||||
SOURCES tests/rst_test.cpp
|
||||
LIBRARIES ${TEST_LIBS}
|
||||
TEST_ARGS tests/SPE1CASE2.DATA tests/SPE1CASE2_RESTART.DATA )
|
||||
|
||||
opm_add_test( rst_msw
|
||||
SOURCES tests/rst_test.cpp
|
||||
LIBRARIES ${TEST_LIBS}
|
||||
TEST_ARGS tests/MSW.DATA tests/MSW_RESTART.DATA )
|
||||
|
||||
# opm-tests dependent tests
|
||||
if(HAVE_OPM_TESTS)
|
||||
opm_add_test(parse_write ONLY_COMPILE
|
||||
SOURCES tests/parser/integration/parse_write.cpp
|
||||
LIBRARIES ${TEST_LIBS})
|
||||
list(APPEND EXTRA_TESTS parse_write)
|
||||
foreach (deck ${OPM_TESTS_ROOT}/norne/NORNE_ATW2013.DATA
|
||||
${OPM_TESTS_ROOT}/spe1_solvent/SPE1CASE2_SOLVENT.DATA
|
||||
${OPM_TESTS_ROOT}/spe9_solvent/SPE9_CP_SOLVENT_CO2.DATA
|
||||
${OPM_TESTS_ROOT}/spe5/SPE5CASE1.DATA
|
||||
${OPM_TESTS_ROOT}/polymer_simple2D/2D_THREEPHASE_POLY_HETER.DATA
|
||||
${OPM_TESTS_ROOT}/spe1/SPE1CASE1.DATA
|
||||
${OPM_TESTS_ROOT}/spe1/SPE1CASE2.DATA
|
||||
${OPM_TESTS_ROOT}/spe1/SPE1CASE2_FAMII.DATA
|
||||
${OPM_TESTS_ROOT}/spe1/SPE1CASE2_SLGOF.DATA
|
||||
${OPM_TESTS_ROOT}/spe3/SPE3CASE1.DATA
|
||||
${OPM_TESTS_ROOT}/spe3/SPE3CASE2.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_GROUP.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT_RESTART.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9.DATA
|
||||
${OPM_TESTS_ROOT}/spe10model1/SPE10_MODEL1.DATA
|
||||
${OPM_TESTS_ROOT}/spe10model2/SPE10_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/msw_2d_h/2D_H__.DATA
|
||||
${OPM_TESTS_ROOT}/model2/0_BASE_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/model2/1_MULTREGT_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/model2/2_MULTXYZ_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/model2/3_MULTFLT_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/model2/4_MINPVV_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/model2/5_SWATINIT_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/model2/6_ENDSCALE_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/model2/7_HYSTERESIS_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/model2/8_MULTIPLY_TRANXYZ_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/model2/9_EDITNNC_MODEL2.DATA)
|
||||
|
||||
get_filename_component(test_name ${deck} NAME_WE)
|
||||
opm_add_test(${test_name} NO_COMPILE
|
||||
EXE_NAME parse_write
|
||||
TEST_ARGS ${deck})
|
||||
endforeach()
|
||||
opm_add_test("SPE9_CP_GROUP2" NO_COMPILE EXE_NAME parse_write TEST_ARGS "${OPM_TESTS_ROOT}/spe9group/SPE9_CP_GROUP.DATA")
|
||||
set_property(TEST NORNE_ATW2013
|
||||
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
|
||||
endif()
|
||||
|
||||
# JSON tests
|
||||
opm_add_test(jsonTests
|
||||
SOURCES tests/json/jsonTests.cpp
|
||||
LIBRARIES ${TEST_LIBS}
|
||||
TEST_ARGS ${PROJECT_SOURCE_DIR}/tests/json/example1.json)
|
||||
list(APPEND EXTRA_TESTS jsonTests)
|
||||
|
||||
endif()
|
||||
118
ThirdParty/custom-opm-common/opm-common/GenerateKeywords.cmake
vendored
Normal file
118
ThirdParty/custom-opm-common/opm-common/GenerateKeywords.cmake
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
set(genkw_SOURCES src/opm/json/JsonObject.cpp
|
||||
src/opm/parser/eclipse/Parser/createDefaultKeywordList.cpp
|
||||
src/opm/parser/eclipse/Deck/UDAValue.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckValue.cpp
|
||||
src/opm/parser/eclipse/Deck/Deck.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckItem.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckRecord.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckOutput.cpp
|
||||
src/opm/parser/eclipse/Generator/KeywordGenerator.cpp
|
||||
src/opm/parser/eclipse/Generator/KeywordLoader.cpp
|
||||
src/opm/parser/eclipse/Parser/ErrorGuard.cpp
|
||||
src/opm/parser/eclipse/Parser/ParseContext.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserEnums.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserItem.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserRecord.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
|
||||
src/opm/parser/eclipse/Units/Dimension.cpp
|
||||
src/opm/parser/eclipse/Units/UnitSystem.cpp
|
||||
src/opm/common/OpmLog/OpmLog.cpp
|
||||
src/opm/common/OpmLog/Logger.cpp
|
||||
src/opm/common/OpmLog/StreamLog.cpp
|
||||
src/opm/common/OpmLog/LogBackend.cpp
|
||||
src/opm/common/OpmLog/LogUtil.cpp
|
||||
)
|
||||
if(NOT cjson_FOUND)
|
||||
list(APPEND genkw_SOURCES external/cjson/cJSON.c)
|
||||
endif()
|
||||
|
||||
add_executable(genkw ${genkw_SOURCES})
|
||||
|
||||
target_link_libraries(genkw ${opm-common_LIBRARIES})
|
||||
|
||||
# Add dependency of Shlwapi.lib for Windows platforms
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
target_link_libraries(genkw "Shlwapi.lib")
|
||||
endif()
|
||||
|
||||
# Generate keyword list
|
||||
include(src/opm/parser/eclipse/share/keywords/keyword_list.cmake)
|
||||
string(REGEX REPLACE "([^;]+)" "${PROJECT_SOURCE_DIR}/src/opm/parser/eclipse/share/keywords/\\1" keyword_files "${keywords}")
|
||||
configure_file(src/opm/parser/eclipse/keyword_list.argv.in keyword_list.argv)
|
||||
|
||||
# Generate keyword source
|
||||
|
||||
add_custom_command( OUTPUT
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/B.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/C.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/D.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/E.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/F.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/G.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/H.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/I.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/J.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/K.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/L.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/M.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/N.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/O.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/P.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Q.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/R.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/S.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/T.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/U.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/V.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/W.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/X.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Y.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Z.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp
|
||||
COMMAND genkw keyword_list.argv
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/include/
|
||||
opm/parser/eclipse/Parser/ParserKeywords
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp
|
||||
DEPENDS genkw ${keyword_files} src/opm/parser/eclipse/share/keywords/keyword_list.cmake
|
||||
)
|
||||
|
||||
# To avoid some rebuilds
|
||||
add_custom_command(OUTPUT
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/A.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/B.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/C.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/D.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/E.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/F.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/G.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/H.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/I.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/J.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/K.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/L.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/M.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/N.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/O.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/P.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/Q.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/R.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/S.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/T.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/U.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/V.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/W.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/X.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/Y.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/Z.cpp
|
||||
${PROJECT_BINARY_DIR}/TestKeywords.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserInit.cpp
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -DBASE_DIR=${PROJECT_BINARY_DIR}
|
||||
-P ${PROJECT_SOURCE_DIR}/CopyHeaders.cmake)
|
||||
675
ThirdParty/custom-opm-common/opm-common/LICENSE
vendored
Normal file
675
ThirdParty/custom-opm-common/opm-common/LICENSE
vendored
Normal file
@@ -0,0 +1,675 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
3
ThirdParty/custom-opm-common/opm-common/README.md
vendored
Normal file
3
ThirdParty/custom-opm-common/opm-common/README.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# opm-common
|
||||
Contains common components used throughout all of OPM,
|
||||
in particular CMake modules for the build system.
|
||||
63
ThirdParty/custom-opm-common/opm-common/changelog.md
vendored
Normal file
63
ThirdParty/custom-opm-common/opm-common/changelog.md
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
# Changelog
|
||||
|
||||
A short month-by-month synopsis of change highlights. Most bugfixes won't make
|
||||
it in here, only the bigger features and interface changes.
|
||||
|
||||
# Important changes between release 2019.04 and 2019.10
|
||||
|
||||
* opm-common and the rest of OPM does not use libecl anymore and
|
||||
supports reading and writing Eclipse files directly
|
||||
* Improved Eclipse compatible restart, support for unified and non unified
|
||||
files, and formatted and unformatted files
|
||||
* Support for reading and checking various additional keywords was introduced (those
|
||||
starting with A - M, R, T, V, W, Z).
|
||||
* ACTIONX support implemented
|
||||
* NUPCOL support implemented
|
||||
* UDA, UDQ support implemented
|
||||
* Implemented writing saturation function scaled end-point arrays (e.g., SWL, SGU,
|
||||
SOWCR, KRORW, PCG) to INIT file
|
||||
* Fixes concerning interaction of WELOPEN and WCON* with WECON and
|
||||
WTEST
|
||||
* Added support for FOAM keywords (FOAMMOB, FOAMROCK, WFOAM)
|
||||
* Refactored and reimplemented Well representation in deck
|
||||
|
||||
# 2016.12
|
||||
* ZCORN adjustments improved, considers cell-cell relations
|
||||
* Slightly more robust compilation - won't crash if locales are broken
|
||||
* Accessing the PVTW table has a richer interface
|
||||
* FAULTS face direction accepts X+, I+, Y+, J+, Z+ and K+
|
||||
* WELOPEN can be controlled with completion numbers (last two parameters)
|
||||
* COMPLUMP is now supported
|
||||
* Don't crash on aquifer keywords
|
||||
* GMWSET and FMWSET are expanded properly
|
||||
* Don't crash on DEBUG
|
||||
* Read support for COORDSYS, GRUPRIG, LGR, PRORDER, TRACERS, TUNINGDP,
|
||||
WDFACCOR, WEFAC, and WORKLIM, no longer crashes.
|
||||
* RS and RV support.
|
||||
* Support for DENSITY, PVTW, and ROCK tables
|
||||
* JFUNC is understood and exposed
|
||||
|
||||
# 2016.11
|
||||
* A new class, Runspec, for the RUNSPEC section, has been introduced
|
||||
* Nodes in the FIELD group are no longer added to the Summary config
|
||||
* WCONHIST only adds phases present in the deck
|
||||
* cJSON can now be installed externally
|
||||
* DeckItem and ParserItem internals refactored
|
||||
* Build time reduced by only giving necessary source files to the json compiler
|
||||
* Support for OPERATE, WSEGITER and GCONPROD
|
||||
* Internal shared_ptrs removed from Schedule and children; interface updated
|
||||
* Schedule is now copyable with regular C++ copy semantics - no internal refs
|
||||
* Well head I/J is now time step dependent
|
||||
* Well reference depth is time step dependent
|
||||
* Some ZCORN issues fixed
|
||||
* gas/oil and oil/gas ratio unit fixed for FIELD units
|
||||
|
||||
# 2016.10
|
||||
* Significant improvements in overall parser performance
|
||||
* shared_ptr has largely been removed from all public interfaces
|
||||
* JFUNC keyword can be parsed
|
||||
* Boolean conversions are explicit
|
||||
* The Units.hpp header from core is moved here, replacing ConversionFactors
|
||||
* The ConstPtr and Ptr shared pointer aliases are removed
|
||||
* UnitSystem, Eclipse3DProperties, and OilVaporizationProperties are default
|
||||
constructible
|
||||
102
ThirdParty/custom-opm-common/opm-common/cmake/Modules/AddOptions.cmake
vendored
Normal file
102
ThirdParty/custom-opm-common/opm-common/cmake/Modules/AddOptions.cmake
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
# - Add options without repeating them on the command line
|
||||
#
|
||||
# Synopsis:
|
||||
#
|
||||
# add_options (lang build opts)
|
||||
#
|
||||
# where:
|
||||
#
|
||||
# lang Name of the language whose compiler should receive the
|
||||
# options, e.g. CXX. If a comma-separated list is received
|
||||
# then the option is added for all those languages. Use the
|
||||
# special value ALL_LANGUAGES for these languages: CXX, C
|
||||
# and Fortran
|
||||
#
|
||||
# build Kind of build to which this options should apply,
|
||||
# such as DEBUG and RELEASE. This can also be a comma-
|
||||
# separated list. Use the special value ALL_BUILDS to apply
|
||||
# to all builds.
|
||||
#
|
||||
# opts List of options to add. Each should be quoted.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# add_options (CXX RELEASE "-O3" "-DNDEBUG" "-Wall")
|
||||
|
||||
function (add_options langs builds)
|
||||
# special handling of empty language specification
|
||||
if ("${langs}" STREQUAL "ALL_LANGUAGES")
|
||||
set (langs CXX C Fortran)
|
||||
endif ("${langs}" STREQUAL "ALL_LANGUAGES")
|
||||
foreach (lang IN LISTS langs)
|
||||
# prepend underscore if necessary
|
||||
foreach (build IN LISTS builds)
|
||||
if (NOT ("${build}" STREQUAL "ALL_BUILDS"))
|
||||
set (_bld "_${build}")
|
||||
string (TOUPPER "${_bld}" _bld)
|
||||
else (NOT ("${build}" STREQUAL "ALL_BUILDS"))
|
||||
set (_bld "")
|
||||
endif (NOT ("${build}" STREQUAL "ALL_BUILDS"))
|
||||
# if we want everything in the "global" flag, then simply
|
||||
# ignore the build type here and go add everything to that one
|
||||
if (CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
set (_bld "")
|
||||
endif ()
|
||||
foreach (_opt IN LISTS ARGN)
|
||||
set (_var "CMAKE_${lang}_FLAGS${_bld}")
|
||||
#message (STATUS "Adding \"${_opt}\" to \${${_var}}")
|
||||
# remove it first
|
||||
string (REPLACE "${_opt}" "" _without "${${_var}}")
|
||||
string (STRIP "${_without}" _without)
|
||||
# we need to strip this one as well, so they are comparable
|
||||
string (STRIP "${${_var}}" _stripped)
|
||||
# if it wasn't there, then add it at the end
|
||||
if ("${_without}" STREQUAL "${_stripped}")
|
||||
# don't add any extra spaces if no options yet are set
|
||||
if (NOT ${_stripped} STREQUAL "")
|
||||
set (${_var} "${_stripped} ${_opt}")
|
||||
else (NOT ${_stripped} STREQUAL "")
|
||||
set (${_var} "${_opt}")
|
||||
endif (NOT ${_stripped} STREQUAL "")
|
||||
set (${_var} "${${_var}}" PARENT_SCOPE)
|
||||
endif ("${_without}" STREQUAL "${_stripped}")
|
||||
endforeach (_opt)
|
||||
endforeach (build)
|
||||
endforeach (lang)
|
||||
endfunction (add_options lang build)
|
||||
|
||||
# set varname to flag unless user has specified something that matches regex
|
||||
function (set_default_option lang varname flag regex)
|
||||
# lang is either C, CXX or Fortran
|
||||
if ("${lang}" STREQUAL "Fortran")
|
||||
set (letter "F")
|
||||
else ()
|
||||
set (letter "${lang}")
|
||||
endif ()
|
||||
string (TOUPPER "${CMAKE_BUILD_TYPE}" _build)
|
||||
if ((NOT ("$ENV{${letter}FLAGS}" MATCHES "${regex}"))
|
||||
AND (NOT ("${CMAKE_${lang}_FLAGS}" MATCHES "${regex}"))
|
||||
AND (NOT ("${CMAKE_${lang}_FLAGS_${_build}}" MATCHES "${regex}")))
|
||||
set (${varname} ${flag} PARENT_SCOPE)
|
||||
else ()
|
||||
set (${varname} PARENT_SCOPE)
|
||||
endif ()
|
||||
endfunction (set_default_option)
|
||||
|
||||
# clear default options as a proxy for not using any default options
|
||||
# at all. there is one *huge* problem with this: CMake runs the platform
|
||||
# initialization before executing any line at all in the project and
|
||||
# there seems to be no way to disable that behaviour, so we cannot really
|
||||
# distinguish between a platform default and something that the user has
|
||||
# passed on the command line. the best thing we can do is to all user-
|
||||
# defined setting if they are something other than the platform default.
|
||||
macro (no_default_options)
|
||||
foreach (lang IN ITEMS C CXX Fortran)
|
||||
foreach (build IN ITEMS DEBUG RELEASE MINSIZEREL RELWITHDEBINFO)
|
||||
if ("${CMAKE_${lang}_FLAGS_${build}}" STREQUAL "${CMAKE_${lang}_FLAGS_${build}_INIT}")
|
||||
# for some strange reason we cannot clear this flag, only set it to empty
|
||||
set (CMAKE_${lang}_FLAGS_${build} "")
|
||||
endif ()
|
||||
endforeach (build)
|
||||
endforeach (lang)
|
||||
endmacro (no_default_options)
|
||||
49
ThirdParty/custom-opm-common/opm-common/cmake/Modules/BoostTargets.cmake
vendored
Normal file
49
ThirdParty/custom-opm-common/opm-common/cmake/Modules/BoostTargets.cmake
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# make targets for boost if find module did not do the job
|
||||
|
||||
if(NOT TARGET Boost::system)
|
||||
add_library(Boost::system UNKNOWN IMPORTED)
|
||||
set_target_properties(Boost::system PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
|
||||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
|
||||
IMPORTED_LOCATION "${Boost_SYSTEM_LIBRARY}"
|
||||
IMPORTED_LOCATION_DEBUG "${Boost_SYSTEM_LIBRARY_DEBUG}"
|
||||
IMPORTED_LOCATION_RELEASE "${Boost_SYSTEM_LIBRARY_RELEASE}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET Boost::filesystem)
|
||||
add_library(Boost::filesystem UNKNOWN IMPORTED)
|
||||
set_target_properties(Boost::filesystem PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
|
||||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
|
||||
INTERFACE_COMPILE_DEFINITIONS BOOST_FILESYSTEM_VERSION=3
|
||||
INTERFACE_LINK_LIBRARIES "${boost_system}"
|
||||
IMPORTED_LOCATION "${Boost_FILESYSTEM_LIBRARY}"
|
||||
IMPORTED_LOCATION_DEBUG "${Boost_FILESYSTEM_LIBRARY_DEBUG}"
|
||||
IMPORTED_LOCATION_RELEASE "${Boost_FILESYSTEM_LIBRARY_RELEASE}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET Boost::regex)
|
||||
add_library(Boost::regex UNKNOWN IMPORTED)
|
||||
set_target_properties(Boost::regex PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
|
||||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${boost_system}"
|
||||
IMPORTED_LOCATION "${Boost_REGEX_LIBRARY}"
|
||||
IMPORTED_LOCATION_DEBUG "${Boost_REGEX_LIBRARY_DEBUG}"
|
||||
IMPORTED_LOCATION_RELEASE "${Boost_REGEX_LIBRARY_RELEASE}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET Boost::unit_test_framework)
|
||||
add_library(Boost::unit_test_framework UNKNOWN IMPORTED)
|
||||
set_target_properties(Boost::unit_test_framework PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
|
||||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${boost_system}"
|
||||
IMPORTED_LOCATION "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}"
|
||||
IMPORTED_LOCATION_DEBUG "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY_DEBUG}"
|
||||
IMPORTED_LOCATION_RELEASE "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE}"
|
||||
)
|
||||
endif()
|
||||
29
ThirdParty/custom-opm-common/opm-common/cmake/Modules/CheckCaseSensitiveFileSystem.cmake
vendored
Normal file
29
ThirdParty/custom-opm-common/opm-common/cmake/Modules/CheckCaseSensitiveFileSystem.cmake
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# Module to check whether the file system is case sensitive or not
|
||||
#
|
||||
# Sets the following variable:
|
||||
#
|
||||
# HAVE_CASE_SENSITIVE_FILESYSTEM True if the file system honors the case of files
|
||||
|
||||
message(STATUS "Checking whether the file system is case-sensitive")
|
||||
# create a file containing uppercase characters
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/UPPER" "Foo")
|
||||
|
||||
# check if the all-lowercase file with the same name can be opened
|
||||
set(FooContents "")
|
||||
if (EXISTS "${CMAKE_BINARY_DIR}/upper")
|
||||
file(READ "${CMAKE_BINARY_DIR}/upper" FooContents)
|
||||
endif()
|
||||
|
||||
# remove the file again in order not to have it dangling around...
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/UPPER")
|
||||
|
||||
# check the contents of the file opened with lower-case. If it is
|
||||
# empty, the file system is case sensitive.
|
||||
if ("${FooContents}" STREQUAL "Foo")
|
||||
message(STATUS "File system is not case-sensitive")
|
||||
set(HAVE_CASE_SENSITIVE_FILESYSTEM 0)
|
||||
else()
|
||||
message(STATUS "File system is case-sensitive")
|
||||
set(HAVE_CASE_SENSITIVE_FILESYSTEM 1)
|
||||
endif()
|
||||
120
ThirdParty/custom-opm-common/opm-common/cmake/Modules/ConfigVars.cmake
vendored
Normal file
120
ThirdParty/custom-opm-common/opm-common/cmake/Modules/ConfigVars.cmake
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
# - Create config.h based on a list of variables
|
||||
#
|
||||
# Synopsis:
|
||||
# configure_vars (FILE syntax filename verb varlist)
|
||||
# where
|
||||
# syntax CXX or CMAKE, depending on target
|
||||
# filename Full path (including name) of config.h
|
||||
# verb WRITE or APPEND if truncating or not
|
||||
# varlist List of variable names that has been defined
|
||||
#
|
||||
# In addition, this function will define HAVE_CONFIG_H for the
|
||||
# following compilations, (only) if the filename is "config.h".
|
||||
#
|
||||
# Example:
|
||||
# list (APPEND FOO_CONFIG_VARS
|
||||
# "/* bar library */"
|
||||
# "HAVE_BAR"
|
||||
# "HAVE_BAR_VERSION_2"
|
||||
# )
|
||||
# configure_vars (
|
||||
# FILE CXX ${PROJECT_BINARY_DIR}/config.h
|
||||
# WRITE ${FOO_CONFIG_VARS}
|
||||
# )
|
||||
|
||||
# Copyright (C) 2012 Uni Research AS
|
||||
# This file is licensed under the GNU General Public License v3.0
|
||||
|
||||
function (configure_vars obj syntax filename verb)
|
||||
# this is just to make the syntax look like the build-in commands
|
||||
if (NOT ("X Y Z ${obj}" STREQUAL "X Y Z FILE" AND
|
||||
(("${verb}" STREQUAL "WRITE") OR ("${verb}" STREQUAL "APPEND"))))
|
||||
message (FATAL_ERROR "Syntax error in argument list")
|
||||
endif ()
|
||||
if (NOT (("${syntax}" STREQUAL "CXX") OR ("${syntax}" STREQUAL "CMAKE")))
|
||||
message (FATAL_ERROR "Invalid target syntax \"${syntax}\"")
|
||||
endif (NOT (("${syntax}" STREQUAL "CXX") OR ("${syntax}" STREQUAL "CMAKE")))
|
||||
|
||||
# truncate the file if the verb was "WRITE"
|
||||
if (verb STREQUAL "WRITE")
|
||||
file (WRITE "${filename}" "")
|
||||
endif (verb STREQUAL "WRITE")
|
||||
|
||||
# whenever we use this, we also signal to the header files that we
|
||||
# have "config.h". add this before any other files (known till now)
|
||||
# to avoid confusion from other configuration files.
|
||||
get_filename_component (_config_path "${filename}" PATH)
|
||||
get_filename_component (_config_file "${filename}" NAME)
|
||||
if ("${_config_file}" MATCHES "config\\.h(\\..+)?")
|
||||
add_definitions (-DHAVE_CONFIG_H=1)
|
||||
include_directories (BEFORE "${_config_path}")
|
||||
endif ("${_config_file}" MATCHES "config\\.h(\\..+)?")
|
||||
|
||||
# only write the current value of each variable once
|
||||
set (_args ${ARGN})
|
||||
if (_args)
|
||||
list (REMOVE_DUPLICATES _args)
|
||||
endif (_args)
|
||||
|
||||
# process each variable
|
||||
set (_prev_verbatim TRUE)
|
||||
foreach (_var IN LISTS _args)
|
||||
|
||||
# massage the name to remove source code formatting
|
||||
string (REGEX REPLACE "^[\\n\\t\\ ]+" "" _var "${_var}")
|
||||
string (REGEX REPLACE "[\\n\\t\\ ]+$" "" _var "${_var}")
|
||||
|
||||
# if the name of a variable has the syntax of a comments, write it
|
||||
# verbatim to the file; this can be used to create headings
|
||||
if ("X Y Z ${_var}" MATCHES "^X Y Z /[/*]")
|
||||
if (NOT _prev_verbatim)
|
||||
file (APPEND "${filename}" "\n")
|
||||
endif (NOT _prev_verbatim)
|
||||
file (APPEND "${filename}" "${_var}\n")
|
||||
set (_prev_verbatim TRUE)
|
||||
|
||||
else ()
|
||||
|
||||
# write a CMake statements that warns if the value has changed
|
||||
if ("${syntax}" STREQUAL "CMAKE")
|
||||
set (_db "\${") # to avoid parsing problems
|
||||
# special case: if we have a truth variable HAVE_ and this is
|
||||
# either just defined (as is), or set to 1 explicitly, then both
|
||||
# of these count as "true", so put in a check that also accepts
|
||||
# both of these values.
|
||||
if (("${_var}" MATCHES "^HAVE_.*") AND
|
||||
(("${${_var}}" STREQUAL "") OR ("${${_var}}" STREQUAL "1")))
|
||||
set (_cond "(\"${_db}${_var}}\" STREQUAL \"\") OR (\"${_db}${_var}}\" STREQUAL \"1\")")
|
||||
else ()
|
||||
set (_cond "\"${_db}${_var}}\" STREQUAL \"${${_var}}\"")
|
||||
endif ()
|
||||
file (APPEND "${filename}" "if (DEFINED ${_var} AND NOT (${_cond}))\n")
|
||||
file (APPEND "${filename}" "\tmessage (WARNING \"Incompatible value \\\"${_db}${_var}}\\\" of variable \\\"${_var}\\\"\")\n")
|
||||
file (APPEND "${filename}" "endif ()\n")
|
||||
endif ()
|
||||
|
||||
# check for empty variable; variables that are explicitly set to false
|
||||
# is not included in this clause
|
||||
if ((NOT DEFINED ${_var}) OR ("${${_var}}" STREQUAL ""))
|
||||
if ("${syntax}" STREQUAL "CMAKE")
|
||||
file (APPEND "${filename}" "set (${_var})\n")
|
||||
else ("${syntax}" STREQUAL "CMAKE")
|
||||
file (APPEND "${filename}" "/* #undef ${_var} */\n")
|
||||
endif ("${syntax}" STREQUAL "CMAKE")
|
||||
else ((NOT DEFINED ${_var}) OR ("${${_var}}" STREQUAL ""))
|
||||
# write to file using the correct syntax
|
||||
if ("${syntax}" STREQUAL "CMAKE")
|
||||
# escape backslash and double quote characters
|
||||
string (REPLACE "\\" "\\\\" _quoted "${${_var}}")
|
||||
string (REPLACE "\"" "\\\"" _quoted "${_quoted}")
|
||||
|
||||
file (APPEND "${filename}" "set (${_var} \"${_quoted}\")\n")
|
||||
else ("${syntax}" STREQUAL "CMAKE")
|
||||
file (APPEND "${filename}" "#define ${_var} ${${_var}}\n")
|
||||
endif ("${syntax}" STREQUAL "CMAKE")
|
||||
|
||||
endif ((NOT DEFINED ${_var}) OR ("${${_var}}" STREQUAL ""))
|
||||
set (_prev_verbatim FALSE)
|
||||
endif ()
|
||||
endforeach(_var)
|
||||
endfunction (configure_vars obj syntax filename verb)
|
||||
38
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Duplicates.cmake
vendored
Normal file
38
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Duplicates.cmake
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# - Remove duplicate library declarations
|
||||
#
|
||||
# Synopsis:
|
||||
#
|
||||
# remove_duplicate_libraries (module)
|
||||
#
|
||||
# where
|
||||
# module Name of the module whose libraries should be pruned
|
||||
|
||||
# Copyright (C) 2013 Uni Research AS
|
||||
# This file is licensed under the GNU General Public License v3.0
|
||||
|
||||
# libraries should always be trimmed from the beginning, so that also
|
||||
# missing functions in those later in the list will be resolved
|
||||
macro (remove_duplicate_libraries module)
|
||||
if (DEFINED ${module}_LIBRARIES)
|
||||
list (REVERSE ${module}_LIBRARIES)
|
||||
list (REMOVE_DUPLICATES ${module}_LIBRARIES)
|
||||
list (REVERSE ${module}_LIBRARIES)
|
||||
endif (DEFINED ${module}_LIBRARIES)
|
||||
endmacro (remove_duplicate_libraries module)
|
||||
|
||||
# headers can be trimmed from the end, since adding a directory to
|
||||
# the list is an idempotent action
|
||||
macro (remove_duplicate_var module suffix)
|
||||
if (DEFINED ${module}_${suffix})
|
||||
list (REMOVE_DUPLICATES ${module}_${suffix})
|
||||
endif (DEFINED ${module}_${suffix})
|
||||
endmacro (remove_duplicate_var module suffix)
|
||||
|
||||
# fix up both headers and libraries, in case two dependencies have
|
||||
# included the same second-level library independently
|
||||
macro (remove_dup_deps module)
|
||||
remove_duplicate_var (${module} INCLUDE_DIRS)
|
||||
remove_duplicate_var (${module} LINKER_FLAGS)
|
||||
remove_duplicate_var (${module} CONFIG_VARS)
|
||||
remove_duplicate_libraries (${module})
|
||||
endmacro (remove_dup_deps module)
|
||||
46
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindAlberta.cmake
vendored
Normal file
46
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindAlberta.cmake
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
find_library(ALBERTA_LTDL_LIB
|
||||
NAMES ltdl
|
||||
PATH_SUFFIXES lib lib32 lib64
|
||||
)
|
||||
find_path(ALBERTA_INCLUDE_DIR
|
||||
NAMES alberta/alberta.h
|
||||
PATHS ${ALBERTA_ROOT}
|
||||
PATH_SUFFIXES alberta include NO_DEFAULT_PATH
|
||||
DOC "Include path of Alberta")
|
||||
find_path(ALBERTA_INCLUDE_DIR
|
||||
NAMES
|
||||
alberta/alberta.h
|
||||
PATHS /usr/local /opt
|
||||
PATH_SUFFIXES alberta)
|
||||
#look for libraries
|
||||
find_library(ALBERTA_UTIL_LIB
|
||||
NAMES alberta_util alberta_utilities
|
||||
PATHS ${ALBERTA_ROOT}
|
||||
PATH_SUFFIXES lib lib32 lib64
|
||||
NO_DEFAULT_PATH)
|
||||
find_library(ALBERTA_UTIL_LIB
|
||||
NAMES alberta_util alberta_utilities
|
||||
PATH_SUFFIXES lib lib32 lib64)
|
||||
|
||||
foreach(dim RANGE 1 9)
|
||||
find_library(ALBERTA_${dim}D_LIB alberta_${dim}d
|
||||
PATHS ${ALBERTA_ROOT}
|
||||
PATH_SUFFIXES lib lib32 lib64
|
||||
Cache FILEPATH DOC "Alberta lib for ${dim}D" NO_DEFAULT_PATH)
|
||||
find_library(ALBERTA_${dim}D_LIB alberta_${dim}d PATH_SUFFIXES lib lib32 lib64)
|
||||
if(ALBERTA_${dim}D_LIB)
|
||||
set(ALBERTA_LIBRARIES ${ALBERTA_LIBRARIES} ${ALBERTA_${dim}D_LIB})
|
||||
endif()
|
||||
endforeach(dim RANGE 1 9)
|
||||
|
||||
if(ALBERTA_LIBRARIES AND ALBERTA_INCLUDE_DIR)
|
||||
set(ALBERTA_INCLUDE_DIRS ${ALBERTA_INCLUDE_DIR})
|
||||
set(ALBERTA_LIBRARIES ${ALBERTA_LIBRARIES} ${ALBERTA_UTIL_LIB} ${ALBERTA_LTDL_LIB})
|
||||
set(ALBERTA_FOUND ON)
|
||||
set(Alberta_FOUND ON)
|
||||
set(HAVE_ALBERTA 1)
|
||||
set(DUNE_ALBERTA_VERSION 0x300)
|
||||
else()
|
||||
set(ALBERTA_FOUND OFF)
|
||||
set(Alberta_FOUND OFF)
|
||||
endif()
|
||||
25
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindC99.cmake
vendored
Normal file
25
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindC99.cmake
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# - Module that checks for supported C99 features.
|
||||
|
||||
# macro to only add option once
|
||||
include (AddOptions)
|
||||
|
||||
# try to use compiler flag -std=c99
|
||||
set (C_STD99_FLAGS "-std=c99")
|
||||
|
||||
# incidently, the C++ test is so simple that it can be used to compile C as well
|
||||
include (CheckCCompilerFlag)
|
||||
check_c_compiler_flag (${C_STD99_FLAGS} HAVE_C99)
|
||||
|
||||
# add option if we are capable
|
||||
if (HAVE_C99)
|
||||
add_options (C ALL_BUILDS "${C_STD99_FLAGS}")
|
||||
else (HAVE_C99)
|
||||
set (C_STD99_FLAGS)
|
||||
endif (HAVE_C99)
|
||||
|
||||
# handle quiet and required
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (C99
|
||||
DEFAULT_MSG
|
||||
C_STD99_FLAGS
|
||||
)
|
||||
11
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindClangCheck.cmake
vendored
Normal file
11
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindClangCheck.cmake
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Find clang-check.
|
||||
#
|
||||
# This module defines:
|
||||
# CLANGCHECK_PROGRAM, the clang-check executable.
|
||||
# CLANGHCECK_FOUND, If false, do not try to use cppcheck.
|
||||
#
|
||||
find_program(CLANGCHECK_PROGRAM NAMES clang-check clang-check-3.8)
|
||||
|
||||
find_package_handle_standard_args(ClangCheck DEFAULT_MSG CLANGCHECK_PROGRAM)
|
||||
|
||||
mark_as_advanced(CLANGCHECK_PROGRAM)
|
||||
11
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindCppCheck.cmake
vendored
Normal file
11
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindCppCheck.cmake
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Find CppCheck.
|
||||
#
|
||||
# This module defines:
|
||||
# CPPCHECK_PROGRAM, the cppcheck executable.
|
||||
# CPPCHECK_FOUND, If false, do not try to use cppcheck.
|
||||
#
|
||||
find_program(CPPCHECK_PROGRAM NAMES cppcheck)
|
||||
|
||||
find_package_handle_standard_args(CppCheck DEFAULT_MSG CPPCHECK_PROGRAM)
|
||||
|
||||
mark_as_advanced(CPPCHECK_PROGRAM)
|
||||
49
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindCwrap.cmake
vendored
Normal file
49
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindCwrap.cmake
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# Find the Python wrappers for module cwrap from ert
|
||||
#
|
||||
# Set the cache variable CWRAP_PYTHON_PATH to the install location of the root
|
||||
# ert package.
|
||||
|
||||
find_package(PythonInterp)
|
||||
if(PYTHONINTERP_FOUND)
|
||||
|
||||
# We try to find the cwrap Python distribution. This is done by running Python
|
||||
# code which tries to 'import cwrap' and prints out the path to the module if
|
||||
# the import succeeds.
|
||||
#
|
||||
# The normal Python import machinery is employed, so if you have installed cwrap
|
||||
# python in a default location, or alternatively set the PYTHONPATH variable the
|
||||
# cwrap Python distribution will eventually be found there, independently of the
|
||||
# alternatives which are tested with the ${PATH_LIST} variable.
|
||||
|
||||
if (EXISTS "/etc/debian_version")
|
||||
set( PYTHON_PACKAGE_PATH "dist-packages")
|
||||
else()
|
||||
set( PYTHON_PACKAGE_PATH "site-packages")
|
||||
endif()
|
||||
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
|
||||
|
||||
set(PATH_LIST)
|
||||
if (ERT_ROOT)
|
||||
list(APPEND PATH_LIST ${ERT_ROOT})
|
||||
endif()
|
||||
list(APPEND PATH_LIST ${CMAKE_PREFIX_PATH})
|
||||
|
||||
# Add various popular sibling alternatives.
|
||||
list(APPEND PATH_LIST "${PROJECT_SOURCE_DIR}/../ert/build"
|
||||
"${PROJECT_BINARY_DIR}/../ert-build")
|
||||
|
||||
foreach( PATH ${PATH_LIST})
|
||||
set( python_code "import sys; sys.path.insert(0 , '${PATH}/${PYTHON_INSTALL_PREFIX}'); import os.path; import inspect; import cwrap; print os.path.dirname(os.path.dirname(inspect.getfile(cwrap)))")
|
||||
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "${python_code}"
|
||||
RESULT_VARIABLE import_result
|
||||
OUTPUT_VARIABLE stdout_output
|
||||
ERROR_VARIABLE stderr_output
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
|
||||
if (${import_result} EQUAL 0)
|
||||
set( CWRAP_PYTHON_PATH ${stdout_output} CACHE PATH "Python path for cwrap" )
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
find_package_handle_standard_args("Cwrap" DEFAULT_MSG CWRAP_PYTHON_PATH)
|
||||
23
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindCxaDemangle.cmake
vendored
Normal file
23
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindCxaDemangle.cmake
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# Module that checks whether the compiler supports the
|
||||
# abi::__cxa_demangle function required to
|
||||
# make the type names returned by typeid() human-readable
|
||||
#
|
||||
# Sets the following variable:
|
||||
# HAVE_CXA_DEMANGLE
|
||||
#
|
||||
# perform tests
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("#include <cxxabi.h>
|
||||
int main(void){
|
||||
int foobar = 0;
|
||||
const char *foo = typeid(foobar).name();
|
||||
int status;
|
||||
char *demangled = abi::__cxa_demangle( foo, 0, 0, &status );
|
||||
}" HAVE_CXA_DEMANGLE)
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
# prevent useless message from being displayed
|
||||
set (FIND_PACKAGE_MESSAGE_DETAILS_CxaDemangle "[1][v()]"
|
||||
CACHE INTERNAL "Details about finding CxaDemangle")
|
||||
find_package_handle_standard_args (CxaDemangle DEFAULT_MSG HAVE_CXA_DEMANGLE)
|
||||
125
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindEigen3.cmake
vendored
Normal file
125
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindEigen3.cmake
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
# - Try to find Eigen3 lib
|
||||
#
|
||||
# This module supports requiring a minimum version, e.g. you can do
|
||||
# find_package(Eigen3 3.1.2)
|
||||
# to require version 3.1.2 or newer of Eigen3.
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# EIGEN3_FOUND - system has eigen lib with correct version
|
||||
# EIGEN3_INCLUDE_DIR - the eigen include directory
|
||||
# EIGEN3_VERSION - eigen version
|
||||
|
||||
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
|
||||
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
|
||||
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
|
||||
|
||||
if(NOT Eigen3_FIND_VERSION)
|
||||
if(NOT Eigen3_FIND_VERSION_MAJOR)
|
||||
set(Eigen3_FIND_VERSION_MAJOR 2)
|
||||
endif(NOT Eigen3_FIND_VERSION_MAJOR)
|
||||
if(NOT Eigen3_FIND_VERSION_MINOR)
|
||||
set(Eigen3_FIND_VERSION_MINOR 91)
|
||||
endif(NOT Eigen3_FIND_VERSION_MINOR)
|
||||
if(NOT Eigen3_FIND_VERSION_PATCH)
|
||||
set(Eigen3_FIND_VERSION_PATCH 0)
|
||||
endif(NOT Eigen3_FIND_VERSION_PATCH)
|
||||
|
||||
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
|
||||
endif(NOT Eigen3_FIND_VERSION)
|
||||
|
||||
macro(_eigen3_check_version)
|
||||
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
|
||||
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
|
||||
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
|
||||
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
set(EIGEN3_VERSION_OK FALSE)
|
||||
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
set(EIGEN3_VERSION_OK TRUE)
|
||||
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
|
||||
if(NOT EIGEN3_VERSION_OK)
|
||||
|
||||
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
|
||||
"but at least version ${Eigen3_FIND_VERSION} is required")
|
||||
endif(NOT EIGEN3_VERSION_OK)
|
||||
endmacro(_eigen3_check_version)
|
||||
|
||||
# only probe if we haven't a path in our cache
|
||||
if (NOT EIGEN3_INCLUDE_DIR)
|
||||
|
||||
# allow Eigen3_ROOT to be used in addition to EIGEN3_ROOT
|
||||
if (Eigen3_ROOT)
|
||||
set (EIGEN3_ROOT "${Eigen3_ROOT}")
|
||||
endif (Eigen3_ROOT)
|
||||
|
||||
# if the _ROOT is specified, then look *only* there; don't allow any
|
||||
# other version to be swapped in to substitute; if not specified, then
|
||||
# go search usual locations
|
||||
if (EIGEN3_ROOT)
|
||||
# if we are given the path to a "build" tree (meaning somewhere Eigen3
|
||||
# has been configured), then use the eigen3.pc file to figure out the
|
||||
# name of the *real* root directory
|
||||
if (EXISTS "${EIGEN3_ROOT}/CMakeCache.txt")
|
||||
# get the cache entry that tells use the source tree location
|
||||
set (_regex "Eigen_SOURCE_DIR:STATIC=\(.*\)")
|
||||
file (STRINGS
|
||||
"${EIGEN3_ROOT}/CMakeCache.txt"
|
||||
EIGEN3_SOURCE_TREE
|
||||
REGEX "${_regex}"
|
||||
)
|
||||
# trim away the key definition, be left with the value
|
||||
if (EIGEN3_SOURCE_TREE)
|
||||
string (REGEX REPLACE
|
||||
"${_regex}"
|
||||
"\\1"
|
||||
EIGEN3_SOURCE_TREE
|
||||
"${EIGEN3_SOURCE_TREE}"
|
||||
)
|
||||
# if something doesn't look as expected, abort and search in _ROOT
|
||||
else ()
|
||||
set (EIGEN3_SOURCE_TREE "${EIGEN3_ROOT}")
|
||||
endif ()
|
||||
else ()
|
||||
set (EIGEN3_SOURCE_TREE "${EIGEN3_ROOT}")
|
||||
endif ()
|
||||
|
||||
find_path (EIGEN3_INCLUDE_DIR
|
||||
NAMES signature_of_eigen3_matrix_library
|
||||
PATHS ${EIGEN3_SOURCE_TREE}
|
||||
PATH_SUFFIXES eigen3 include/eigen3 eigen include/eigen
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
else (EIGEN3_ROOT)
|
||||
# assume that if there is a sibling directory to our project which
|
||||
# is called eigen3, there is a newer version located there, or that
|
||||
# it may have been checked out next to the build directory
|
||||
find_path(EIGEN3_INCLUDE_DIR
|
||||
NAMES signature_of_eigen3_matrix_library
|
||||
HINTS ${CMAKE_SOURCE_DIR}/../
|
||||
${PROJECT_SOURCE_DIR}/../
|
||||
${CMAKE_INSTALL_PREFIX}/include
|
||||
${KDE4_INCLUDE_DIR}
|
||||
PATH_SUFFIXES eigen3 eigen
|
||||
)
|
||||
endif (EIGEN3_ROOT)
|
||||
endif (NOT EIGEN3_INCLUDE_DIR)
|
||||
|
||||
if(EIGEN3_INCLUDE_DIR)
|
||||
_eigen3_check_version()
|
||||
endif(EIGEN3_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
|
||||
|
||||
mark_as_advanced(EIGEN3_INCLUDE_DIR)
|
||||
|
||||
|
||||
49
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindMETIS.cmake
vendored
Normal file
49
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindMETIS.cmake
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# -*-cmake-*-
|
||||
#
|
||||
# Try to find the libMETIS graph partioning library
|
||||
#
|
||||
# Once done, this will define:
|
||||
#
|
||||
# METIS_FOUND - system has the libMETIS graph partioning library
|
||||
# HAVE_METIS - like METIS_FOUND, but for the inclusion in config.h
|
||||
# METIS_INCLUDE_DIRS - incude paths to use libMETIS
|
||||
# METIS_LIBRARIES - Link these to use libMETIS
|
||||
|
||||
set(METIS_SEARCH_PATH "/usr" "/usr/local" "/opt" "/opt/local")
|
||||
set(METIS_NO_DEFAULT_PATH "")
|
||||
if(METIS_ROOT)
|
||||
set(METIS_SEARCH_PATH "${METIS_ROOT}")
|
||||
set(METIS_NO_DEFAULT_PATH "NO_DEFAULT_PATH")
|
||||
endif()
|
||||
|
||||
# search for files which implements this module
|
||||
find_path (METIS_INCLUDE_DIRS
|
||||
NAMES "metis.h"
|
||||
PATHS ${METIS_SEARCH_PATH}
|
||||
PATH_SUFFIXES "include" "METISLib" "include/metis"
|
||||
${METIS_NO_DEFAULT_PATH})
|
||||
|
||||
# only search in architecture-relevant directory
|
||||
if (CMAKE_SIZEOF_VOID_P)
|
||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||
endif (CMAKE_SIZEOF_VOID_P)
|
||||
|
||||
find_library(METIS_LIBRARIES
|
||||
NAMES "metis"
|
||||
PATHS ${METIS_SEARCH_PATH}
|
||||
PATH_SUFFIXES "lib/.libs" "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
${METIS_NO_DEFAULT_PATH})
|
||||
|
||||
set (METIS_FOUND FALSE)
|
||||
if (METIS_INCLUDE_DIRS OR METIS_LIBRARIES)
|
||||
set(METIS_FOUND TRUE)
|
||||
set(HAVE_METIS TRUE)
|
||||
endif()
|
||||
|
||||
# print a message to indicate status of this package
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(METIS
|
||||
DEFAULT_MSG
|
||||
METIS_LIBRARIES
|
||||
METIS_INCLUDE_DIRS
|
||||
)
|
||||
166
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindPETSc.cmake
vendored
Normal file
166
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindPETSc.cmake
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
# - Try to find Petsc lib
|
||||
#
|
||||
# This module supports requiring a minimum version, e.g. you can do
|
||||
# find_package(Petsc)
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# PETSC_FOUND - system has Petsc lib with correct version
|
||||
# PETSC_INCLUDE_DIRS - the Petsc include directory
|
||||
# PETSC_LIBRARIES - the Petsc library.
|
||||
|
||||
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
|
||||
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
|
||||
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
|
||||
|
||||
# find out the size of a pointer. this is required to only search for
|
||||
# libraries in the directories relevant for the architecture
|
||||
|
||||
if(NOT USE_PETSC)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P)
|
||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||
endif (CMAKE_SIZEOF_VOID_P)
|
||||
|
||||
# if PETSC_ROOT is set, then this is the only place searched for petsc headers
|
||||
# and includes
|
||||
set(_no_default_path "")
|
||||
if(PETSC_ROOT)
|
||||
set (_no_default_path "NO_DEFAULT_PATH")
|
||||
endif()
|
||||
|
||||
# look for a system-wide BLAS library
|
||||
set(PETSC_BLAS_LIBRARY "")
|
||||
find_package(BLAS QUIET)
|
||||
list(APPEND PETSC_BLAS_LIBRARY "${BLAS_LIBRARIES}")
|
||||
|
||||
# if BLAS wasn't found, look for it in PETSC_ROOT. Won't search if
|
||||
# PETSC_BLAS_LIBRARY is set.
|
||||
find_library(PETSC_BLAS_LIBRARY
|
||||
NAME "blas"
|
||||
PATH ${PETSC_ROOT}
|
||||
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
${_no_default_path}
|
||||
)
|
||||
|
||||
# print message if there was still no blas found!
|
||||
if(NOT BLAS_FOUND AND NOT PETSC_BLAS_LIBRARY)
|
||||
message(STATUS "BLAS not found but required for PETSc")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(PETSC_LAPACK_LIBRARY "")
|
||||
find_package(LAPACK QUIET)
|
||||
list(APPEND PETSC_LAPACK_LIBRARY "${LAPACK_LIBRARIES}")
|
||||
|
||||
# if LAPACK wasn't found, look for it in PETSC_ROOT
|
||||
find_library(PETSC_LAPACK_LIBRARY
|
||||
NAME "lapack"
|
||||
PATH ${PETSC_ROOT}
|
||||
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
${_no_default_path}
|
||||
)
|
||||
|
||||
# print message if there was still no blas found!
|
||||
if(NOT LAPACK_FOUND AND NOT PETSC_LAPACK_LIBRARY)
|
||||
message(STATUS "LAPACK not found but required for PETSc")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(X11 QUIET)
|
||||
if (X11_FOUND)
|
||||
list(APPEND PETSC_X11_LIBRARY "${X11_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
# these variables must exist. Since not finding MPI, both the header and the
|
||||
# object file , may not be an error, we want the option of concatenating the
|
||||
# empty variable onto the PETSC_LIBRARIES/INCLUDE_DIRS lists
|
||||
set(PETSC_MPI_LIBRARY "")
|
||||
set(PETSC_MPI_INCLUDE_DIRS "")
|
||||
|
||||
find_package(MPI)
|
||||
if(MPI_FOUND)
|
||||
list(APPEND PETSC_MPI_LIBRARY "${MPI_LIBRARIES}")
|
||||
set(PETSC_MPI_INCLUDE_DIRS ${MPI_INCLUDE_PATH})
|
||||
|
||||
else(MPI_FOUND)
|
||||
# if a system MPI wasn't found, look for PETSc's serial implementation. This
|
||||
# won't be available if PETSc was compiled with --with-mpi=0, so not finding
|
||||
# this won't be an error. This only needs to find the header, as the MPI
|
||||
# implementation should be already be compiled into PETSc.
|
||||
message(STATUS "Could not find a system provided MPI. Searching for PETSc provided mpiuni fallback implementation.")
|
||||
find_path(PETSC_MPI_INCLUDE_DIRS
|
||||
NAMES "mpi.h"
|
||||
PATHS ${PETSC_ROOT}/include
|
||||
PATH_SUFFIXES "mpiuni"
|
||||
${_no_default_path}
|
||||
)
|
||||
endif(MPI_FOUND)
|
||||
|
||||
if(NOT PETSC_MPI_INCLUDE_DIRS)
|
||||
message(WARNING "Could not find any MPI implementation. If PETSc is compiled with --with-mpi=0 this is ok. Otherwise you will get linker errors or (possibly subtle) runtime errors. Continuing.")
|
||||
if(NOT USE_MPI)
|
||||
message("To build with MPI support, pass -DUSE_MPI=ON to CMake.")
|
||||
endif(NOT USE_MPI)
|
||||
endif(NOT PETSC_MPI_INCLUDE_DIRS)
|
||||
|
||||
# only probe if we haven't a path in our cache
|
||||
if (Petsc_ROOT)
|
||||
set (PETSC_ROOT "${Petsc_ROOT}")
|
||||
endif (Petsc_ROOT)
|
||||
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
set(OLD_PKG $ENV{PKG_CONFIG_PATH})
|
||||
set(ENV{PKG_CONFIG_PATH} $ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig)
|
||||
pkg_check_modules(PETSC PETSc>=3.4.0)
|
||||
set(ENV{PKG_CONFIG_PATH} ${OLD_PKG})
|
||||
set(PETSC_LIBRARIES ${PETSC_STATIC_LDFLAGS})
|
||||
set(PETSC_LIBRARY ${PETSC_LIBRARIES})
|
||||
set(PETSC_INCLUDE_DIR ${PETSC_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if(NOT PETSC_FOUND)
|
||||
find_path (PETSC_NORMAL_INCLUDE_DIR
|
||||
NAMES "petsc.h"
|
||||
PATHS ${PETSC_ROOT}
|
||||
PATH_SUFFIXES "include" "petsc"
|
||||
${_no_default_path}
|
||||
)
|
||||
|
||||
list(APPEND PETSC_INCLUDE_DIR ${PETSC_NORMAL_INCLUDE_DIR})
|
||||
|
||||
# look for actual Petsc library
|
||||
find_library(PETSC_LIBRARY
|
||||
NAMES "petsc-3.4.3" "petsc-3.4.4" "petsc"
|
||||
PATHS ${PETSC_ROOT}
|
||||
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
${_no_default_path}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT PETSC_LIBRARY)
|
||||
message(STATUS "Could not find the PETSc library")
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Petsc DEFAULT_MSG PETSC_INCLUDE_DIR PETSC_LIBRARY)
|
||||
mark_as_advanced(PETSC_INCLUDE_DIR PETSC_LIBRARY)
|
||||
|
||||
# if both headers and library are found, store results
|
||||
if(PETSC_FOUND)
|
||||
set(PETSC_INCLUDE_DIRS ${PETSC_INCLUDE_DIR})
|
||||
list(APPEND PETSC_INCLUDE_DIRS ${PETSC_MPI_INCLUDE_DIRS})
|
||||
|
||||
set(PETSC_LIBRARIES ${PETSC_LIBRARY})
|
||||
|
||||
list(APPEND PETSC_LIBRARIES ${PETSC_BLAS_LIBRARY})
|
||||
list(APPEND PETSC_LIBRARIES ${PETSC_LAPACK_LIBRARY})
|
||||
list(APPEND PETSC_LIBRARIES ${PETSC_X11_LIBRARY})
|
||||
list(APPEND PETSC_LIBRARIES ${PETSC_MPI_LIBRARY})
|
||||
endif()
|
||||
80
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindPTScotch.cmake
vendored
Normal file
80
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindPTScotch.cmake
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
# Module that checks whether PT-Scotch is available.
|
||||
#
|
||||
# Accepts the following variables:
|
||||
#
|
||||
# PTSCOTCH_ROOT: Prefix where PT-Scotch is installed.
|
||||
# PTSCOTCH_SUFFIX: Scotch might be compiled using different
|
||||
# integer sizes (int32, int32, long). When
|
||||
# this is is set the headers and libaries
|
||||
# are search under the suffix
|
||||
# include/scotch-${PTSCOTCH_SUFFIX, and
|
||||
# lib/scotch-${PTSCOTCH_SUFFIX}, respectively.
|
||||
# Sets the following variables:
|
||||
# PTSCOTCH_INCLUDE_DIRS: All include directories needed to compile PT-Scotch programs.
|
||||
# PTSCOTCH_LIBRARIES: Alle libraries needed to link PT-Scotch programs.
|
||||
# PTSCOTCH_FOUND: True if PT-Scotch was found.
|
||||
#
|
||||
# Provides the following macros:
|
||||
#
|
||||
# find_package(PTScotch)
|
||||
|
||||
find_package(MPI)
|
||||
macro(_search_pt_lib libvar libname doc)
|
||||
find_library(${libvar} ${libname}
|
||||
PATHS ${PTSCOTCH_ROOT} ${PTSCOTCH_ROOT}/lib PATH_SUFFIXES ${PATH_SUFFIXES}
|
||||
NO_DEFAULT_PATH
|
||||
DOC "${doc}")
|
||||
find_library(${libvar} ${libname})
|
||||
endmacro(_search_pt_lib)
|
||||
|
||||
if(PTSCOTCH_SUFFIX)
|
||||
set(PATH_SUFFIXES "scotch-${PTSCOTCH_SUFFIX}")
|
||||
else(PTSCOTCH_SUFFIX)
|
||||
set(PATH_SUFFIXES "scotch")
|
||||
endif(PTSCOTCH_SUFFIX)
|
||||
|
||||
include(CMakePushCheckState)
|
||||
cmake_push_check_state() # Save variables
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${MPI_DUNE_INCLUDE_PATH})
|
||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${MPI_DUNE_COMPILE_FLAGS}")
|
||||
|
||||
find_path(PTSCOTCH_INCLUDE_DIR ptscotch.h
|
||||
PATHS ${PTSCOTCH_ROOT} ${PTSCOTCH_ROOT}/include
|
||||
PATH_SUFFIXES ${PATH_SUFFIXES}
|
||||
NO_DEFAULT_PATH
|
||||
DOC "Include directory of PT-Scotch")
|
||||
find_path(PTSCOTCH_INCLUDE_DIR ptscotch.h
|
||||
PATH_SUFFIXES ${PATH_SUFFIXES})
|
||||
|
||||
_search_pt_lib(SCOTCH_LIBRARY scotch "The main Scotch library.")
|
||||
_search_pt_lib(PTSCOTCH_LIBRARY ptscotch "The main PT-Scotch library.")
|
||||
_search_pt_lib(PTSCOTCHERR_LIBRARY ptscotcherr "The PT-Scotch error library.")
|
||||
|
||||
# behave like a CMake module is supposed to behave
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
"PTScotch"
|
||||
DEFAULT_MSG
|
||||
PTSCOTCH_INCLUDE_DIR
|
||||
SCOTCH_LIBRARY
|
||||
PTSCOTCH_LIBRARY
|
||||
PTSCOTCHERR_LIBRARY
|
||||
)
|
||||
#restore old values
|
||||
cmake_pop_check_state()
|
||||
|
||||
if(PTSCOTCH_FOUND)
|
||||
set(PTSCOTCH_INCLUDE_DIRS ${PTSCOTCH_INCLUDE_DIR})
|
||||
set(PTSCOTCH_LIBRARIES ${SCOTCH_LIBRARY} ${PTSCOTCH_LIBRARY} ${PTSCOTCHERR_LIBRARY} ${MPI_DUNE_LIBRARIES}
|
||||
CACHE FILEPATH "All libraries needed to link programs using PT-Scotch")
|
||||
set(PTSCOCH_LINK_FLAGS "${DUNE_MPI_LINK_FLAGS}"
|
||||
CACHE STRING "PT-Scotch link flags")
|
||||
set(HAVE_PTSCOTCH 1)
|
||||
# log result
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determing location of PT-Scotch succeded:\n"
|
||||
"Include directory: ${PTSCOTCH_INCLUDE_DIRS}\n"
|
||||
"Library directory: ${PTSCOTCH_LIBRARIES}\n\n")
|
||||
endif(PTSCOTCH_FOUND)
|
||||
|
||||
mark_as_advanced(PTSCOTCH_INCLUDE_DIRS PTSCOTCH_LIBRARIES HAVE_PTSCOTCH)
|
||||
97
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindParMETIS.cmake
vendored
Normal file
97
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindParMETIS.cmake
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
# Module that checks whether ParMETIS or the ParMETIS interface of PT-Scotch
|
||||
# is available.
|
||||
#
|
||||
# Accepts the following variables:
|
||||
#
|
||||
# PARMETIS_ROOT: Prefix where ParMETIS is installed.
|
||||
# PARMETIS_SUFFIX: Scotch might be compiled using different
|
||||
# integer sizes (int32, int32, long). When
|
||||
# this is is set the headers and libaries
|
||||
# are search under the suffix
|
||||
# include/parmetis-${PARMETIS_SUFFIX}, and
|
||||
# lib/parmetis-${PARMETIS_SUFFIX}, respectively.
|
||||
# Sets the following variables:
|
||||
# PARMETIS_INCLUDE_DIRS: All include directories needed to compile ParMETIS programs.
|
||||
# PARMETIS_LIBRARIES: Alle libraries needed to link ParMETIS programs.
|
||||
# PARMETIS_FOUND: True if ParMETIS was found.
|
||||
#
|
||||
# Provides the following macros:
|
||||
#
|
||||
# find_package(ParMETIS)
|
||||
|
||||
find_package(MPI)
|
||||
|
||||
if(MPI_C_FOUND)
|
||||
macro(_search_parmetis_lib libvar libname doc)
|
||||
find_library(${libvar} ${libname}
|
||||
PATHS ${PARMETIS_ROOT} ${PARMETIS_ROOT}/lib PATH_SUFFIXES ${PATH_SUFFIXES}
|
||||
NO_DEFAULT_PATH
|
||||
DOC "${doc}")
|
||||
find_library(${libvar} ${libname})
|
||||
endmacro(_search_parmetis_lib)
|
||||
|
||||
if(PARMETIS_SUFFIX)
|
||||
set(PATH_SUFFIXES "-${PARMETIS_SUFFIX}")
|
||||
else(PARMETIS_SUFFIX)
|
||||
set(PATH_SUFFIXES "")
|
||||
endif(PARMETIS_SUFFIX)
|
||||
|
||||
include(CMakePushCheckState)
|
||||
cmake_push_check_state() # Save variables
|
||||
|
||||
find_path(PARMETIS_INCLUDE_DIR parmetis.h
|
||||
PATHS ${PARMETIS_ROOT} ${PARMETIS_ROOT}/include
|
||||
PATH_SUFFIXES parmetis${PATH_SUFFIXES}
|
||||
NO_DEFAULT_PATH
|
||||
DOC "Include directory of ParMETIS")
|
||||
find_path(PARMETIS_INCLUDE_DIR parmetis.h
|
||||
PATH_SUFFIXES parmetis${PATH_SUFFIXES})
|
||||
|
||||
# find the serial version of METIS
|
||||
find_package(METIS)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${MPI_C_INCLUDE_PATH} )
|
||||
if(PARMETIS_INCLUDE_DIR)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${PARMETIS_INCLUDE_DIR})
|
||||
if(METIS_INCLUDE_DIRS)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${METIS_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${MPI_C_COMPILE_FLAGS}")
|
||||
|
||||
include(CheckIncludeFile)
|
||||
check_include_file(parmetis.h PARMETIS_FOUND)
|
||||
_search_parmetis_lib(PARMETIS_LIBRARY parmetis "The main ParMETIS library.")
|
||||
|
||||
# behave like a CMake module is supposed to behave
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
"ParMETIS"
|
||||
DEFAULT_MSG
|
||||
PARMETIS_INCLUDE_DIR
|
||||
PARMETIS_LIBRARY
|
||||
METIS_LIBRARIES
|
||||
PARMETIS_FOUND
|
||||
METIS_FOUND
|
||||
)
|
||||
#restore old values
|
||||
cmake_pop_check_state()
|
||||
|
||||
if(PARMETIS_FOUND)
|
||||
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR})
|
||||
set(PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARIES} ${MPI_C_LIBRARIES}
|
||||
CACHE FILEPATH "All libraries needed to link programs using ParMETIS")
|
||||
set(PARMETIS_LINK_FLAGS "${DUNE_C_LINK_FLAGS}"
|
||||
CACHE STRING "ParMETIS link flags")
|
||||
set(HAVE_PARMETIS 1)
|
||||
# log result
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining location of ParMETIS succeded:\n"
|
||||
"Include directory: ${PARMETIS_INCLUDE_DIRS}\n"
|
||||
"Library directory: ${PARMETIS_LIBRARIES}\n\n")
|
||||
|
||||
endif(PARMETIS_FOUND)
|
||||
|
||||
mark_as_advanced(PARMETIS_INCLUDE_DIRS PARMETIS_LIBRARIES HAVE_PARMETIS)
|
||||
else(MPI_C_FOUND)
|
||||
message(WARNING "MPI not found ==> ParMETIS disabled! Plase make sure -DUSE_MPI=ON was set if you need ParMETIS.")
|
||||
endif(MPI_C_FOUND)
|
||||
49
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindQuadmath.cmake
vendored
Normal file
49
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindQuadmath.cmake
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# Module that checks whether the compiler supports the
|
||||
# quadruple precision floating point math
|
||||
#
|
||||
# Sets the following variables:
|
||||
# HAVE_QUAD
|
||||
# QUADMATH_LIBRARIES
|
||||
#
|
||||
# perform tests
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(CMakePushCheckState)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
if(NOT DEFINED USE_QUADMATH OR USE_QUADMATH)
|
||||
if(NOT DEFINED HAVE_EXTENDED_NUMERIC_LITERALS)
|
||||
check_cxx_compiler_flag("-Werror -fext-numeric-literals" HAVE_EXTENDED_NUMERIC_LITERALS)
|
||||
endif()
|
||||
|
||||
if (HAVE_EXTENDED_NUMERIC_LITERALS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals")
|
||||
endif()
|
||||
|
||||
cmake_push_check_state(RESET)
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "quadmath")
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <quadmath.h>
|
||||
|
||||
int main(void){
|
||||
__float128 foo = sqrtq(123.456);
|
||||
foo = FLT128_MIN;
|
||||
}" QUADMATH_FOUND)
|
||||
cmake_pop_check_state()
|
||||
|
||||
if (QUADMATH_FOUND)
|
||||
set(QUADMATH_LIBRARIES "quadmath")
|
||||
set(HAVE_QUAD "${QUADMATH_FOUND}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (USE_QUADMATH AND NOT QUADMATH_FOUND)
|
||||
message(FATAL_ERROR "Quadruple precision math support was explicitly requested but is unavailable!")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Quadmath
|
||||
DEFAULT_MSG
|
||||
QUADMATH_LIBRARIES
|
||||
HAVE_QUAD
|
||||
)
|
||||
294
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindSuiteSparse.cmake
vendored
Normal file
294
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindSuiteSparse.cmake
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
# - Find Tim Davis' SuiteSparse collection of sparse matrix libraries
|
||||
#
|
||||
# Synopsis:
|
||||
# find_package (SuiteSparse COMPONENTS <list-of-components>)
|
||||
#
|
||||
# Components are:
|
||||
# amd Approximate Minimum Degree ordering
|
||||
# camd Constrained Approximate Minimum Degree ordering
|
||||
# colamd COLumn Approximate Minimum Degree ordering
|
||||
# ccolamd Constrained COLumn Approximate Minimum Degree ordering
|
||||
# cholmod Supernodal sparse Cholesky factorization and update
|
||||
# umfpack Unsymmetric MultiFrontal sparse LU factorization
|
||||
#
|
||||
# The following variables will be set:
|
||||
#
|
||||
# SuiteSparse_FOUND True if all dependencies are satisfied
|
||||
# SuiteSparse_Xxx_FOUND True if module Xxx is found
|
||||
# HAVE_SUITESPARSE_Xxx_H Binary value indicating presence of header
|
||||
# SuiteSparse_INCLUDE_DIRS Paths containing the SuiteSparse header files
|
||||
# SuiteSparse_LIBRARIES Name of the libraries which must be linked
|
||||
# SuiteSparse_DEFINITIONS Defines that must be passed to the compiler
|
||||
# SuiteSparse_LINKER_FLAGS Options that must be passed when linking
|
||||
#
|
||||
# The following options can be set to configure the module:
|
||||
#
|
||||
# SUITESPARSE_USE_STATIC Link with a static library, even if a
|
||||
# dynamic library is also present. Note that
|
||||
# setting this to OFF does not ensure that a
|
||||
# shared library will be used.
|
||||
#
|
||||
# See <http://www.cise.ufl.edu/research/sparse/SuiteSparse>.
|
||||
|
||||
# Copyright (C) 2012 Uni Research AS
|
||||
# This file is licensed under the GNU General Public License v3.0
|
||||
|
||||
function (try_compile_umfpack varname)
|
||||
include (CMakePushCheckState)
|
||||
include (CheckCSourceCompiles)
|
||||
cmake_push_check_state ()
|
||||
set (CMAKE_REQUIRED_INCLUDES ${UMFPACK_INCLUDE_DIRS})
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${UMFPACK_LIBRARY} ${ARGN} ${SuiteSparse_EXTRA_LIBS})
|
||||
check_c_source_compiles (
|
||||
"#include <umfpack.h>
|
||||
int main (void) {
|
||||
void *Symbolic, *Numeric;
|
||||
double Info[UMFPACK_INFO], Control[UMFPACK_CONTROL];
|
||||
umfpack_dl_defaults(Control);
|
||||
umfpack_dl_symbolic(0, 0, 0, 0, 0,
|
||||
&Symbolic, Control, Info);
|
||||
umfpack_dl_numeric (0, 0, 0,
|
||||
Symbolic, &Numeric, Control, Info);
|
||||
umfpack_dl_free_symbolic(&Symbolic);
|
||||
umfpack_dl_solve(UMFPACK_A, 0, 0, 0, 0, 0,
|
||||
Numeric, Control, Info);
|
||||
umfpack_dl_free_numeric(&Numeric);
|
||||
umfpack_timer ();
|
||||
return 0;
|
||||
}" ${varname})
|
||||
cmake_pop_check_state ()
|
||||
set (${varname} "${${varname}}" PARENT_SCOPE)
|
||||
endfunction (try_compile_umfpack varname)
|
||||
|
||||
# variables to pass on to other packages
|
||||
if (FIND_QUIETLY)
|
||||
set (SuiteSparse_QUIET "QUIET")
|
||||
else (FIND_QUIETLY)
|
||||
set (SuiteSparse_QUIET "")
|
||||
endif (FIND_QUIETLY)
|
||||
|
||||
# we need to link to BLAS and LAPACK
|
||||
if (NOT BLAS_FOUND)
|
||||
find_package (BLAS ${SuiteSparse_QUIET} REQUIRED)
|
||||
endif (NOT BLAS_FOUND)
|
||||
if (NOT LAPACK_FOUND)
|
||||
find_package (LAPACK ${SuiteSparse_QUIET} REQUIRED)
|
||||
endif (NOT LAPACK_FOUND)
|
||||
|
||||
# we also need the math part of the runtime library
|
||||
find_library (MATH_LIBRARY NAMES "m")
|
||||
set (SuiteSparse_EXTRA_LIBS ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MATH_LIBRARY})
|
||||
|
||||
# if we don't get any further clues about where to look, then start
|
||||
# roaming around the system
|
||||
set (_no_default_path "")
|
||||
|
||||
# search system directories by default
|
||||
set (SuiteSparse_SEARCH_PATH)
|
||||
|
||||
# pick up paths from the environment if specified there; these replace the
|
||||
# pre-defined paths so that we don't accidentially pick up old stuff
|
||||
if (NOT $ENV{SuiteSparse_DIR} STREQUAL "")
|
||||
set (SuiteSparse_SEARCH_PATH "$ENV{SuiteSparse_DIR}")
|
||||
endif (NOT $ENV{SuiteSparse_DIR} STREQUAL "")
|
||||
if (SuiteSparse_DIR)
|
||||
set (SuiteSparse_SEARCH_PATH "${SuiteSparse_DIR}")
|
||||
endif (SuiteSparse_DIR)
|
||||
# CMake uses _DIR suffix as default for config-mode files; it is unlikely
|
||||
# that we are building SuiteSparse ourselves; use _ROOT suffix to specify
|
||||
# location to pre-canned binaries
|
||||
if (NOT $ENV{SuiteSparse_ROOT} STREQUAL "")
|
||||
set (SuiteSparse_SEARCH_PATH "$ENV{SuiteSparse_ROOT}")
|
||||
endif (NOT $ENV{SuiteSparse_ROOT} STREQUAL "")
|
||||
if (SuiteSparse_ROOT)
|
||||
set (SuiteSparse_SEARCH_PATH "${SuiteSparse_ROOT}")
|
||||
endif (SuiteSparse_ROOT)
|
||||
# most commonly, we use the uppercase version of this variable
|
||||
if (SUITESPARSE_ROOT)
|
||||
set (SuiteSparse_SEARCH_PATH "${SUITESPARSE_ROOT}")
|
||||
endif (SUITESPARSE_ROOT)
|
||||
|
||||
# if we have specified a search path, then confine ourselves to that
|
||||
if (SuiteSparse_SEARCH_PATH)
|
||||
set (_no_default_path "NO_DEFAULT_PATH")
|
||||
endif (SuiteSparse_SEARCH_PATH)
|
||||
|
||||
# transitive closure of dependencies; after this SuiteSparse_MODULES is the
|
||||
# full list of modules that must be found to satisfy the user's link demands
|
||||
set (SuiteSparse_MODULES ${SuiteSparse_FIND_COMPONENTS})
|
||||
list (FIND SuiteSparse_MODULES "umfpack" UMFPACK_DESIRED)
|
||||
if (NOT UMFPACK_DESIRED EQUAL -1)
|
||||
list (APPEND SuiteSparse_MODULES amd cholmod)
|
||||
endif (NOT UMFPACK_DESIRED EQUAL -1)
|
||||
list (FIND SuiteSparse_MODULES "cholmod" CHOLMOD_DESIRED)
|
||||
if (NOT CHOLMOD_DESIRED EQUAL -1)
|
||||
list (APPEND SuiteSparse_MODULES amd camd colamd)
|
||||
endif (NOT CHOLMOD_DESIRED EQUAL -1)
|
||||
if (SuiteSparse_MODULES)
|
||||
list (REMOVE_DUPLICATES SuiteSparse_MODULES)
|
||||
endif (SuiteSparse_MODULES)
|
||||
|
||||
# if someone else already have found all the packages for us, then don't do anything
|
||||
set (SuiteSparse_EVERYTHING_FOUND TRUE)
|
||||
foreach (module IN LISTS SuiteSparse_MODULES)
|
||||
string (TOUPPER ${module} MODULE)
|
||||
if (NOT SuiteSparse_${MODULE}_FOUND)
|
||||
set (SuiteSparse_EVERYTHING_FOUND FALSE)
|
||||
break ()
|
||||
endif (NOT SuiteSparse_${MODULE}_FOUND)
|
||||
endforeach (module)
|
||||
if (SuiteSparse_EVERYTHING_FOUND)
|
||||
return ()
|
||||
endif (SuiteSparse_EVERYTHING_FOUND)
|
||||
|
||||
# only search in architecture-relevant directory
|
||||
if (CMAKE_SIZEOF_VOID_P)
|
||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||
endif (CMAKE_SIZEOF_VOID_P)
|
||||
|
||||
# if we are told to link SuiteSparse statically, add these parts
|
||||
# to the name so we always match only that particular type of lib
|
||||
option (SUITESPARSE_USE_STATIC "Link SuiteSparse statically" OFF)
|
||||
mark_as_advanced (SUITESPARSE_USE_STATIC)
|
||||
if (SUITESPARSE_USE_STATIC)
|
||||
set (_pref_ "${CMAKE_STATIC_LIBRARY_PREFIX}")
|
||||
set (_suff_ "${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
else (SUITESPARSE_USE_STATIC)
|
||||
set (_pref_ "")
|
||||
set (_suff_ "")
|
||||
endif (SUITESPARSE_USE_STATIC)
|
||||
|
||||
# if SuiteSparse >= 4.0 we must also link with libsuitesparseconfig
|
||||
# assume that this is the case if we find the library; otherwise just
|
||||
# ignore it (older versions don't have a file named like this)
|
||||
find_library (config_LIBRARY
|
||||
NAMES "${_pref_}suitesparseconfig${_suff_}"
|
||||
PATHS ${SuiteSparse_SEARCH_PATH}
|
||||
PATH_SUFFIXES ".libs" "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib/ufsparse"
|
||||
${_no_default_path}
|
||||
)
|
||||
if (config_LIBRARY)
|
||||
list (APPEND SuiteSparse_EXTRA_LIBS ${config_LIBRARY})
|
||||
# POSIX.1-2001 REALTIME portion require us to link this library too for
|
||||
# clock_gettime() which is used by suitesparseconfig
|
||||
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||
list (APPEND SuiteSparse_EXTRA_LIBS "-lrt")
|
||||
endif ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||
endif (config_LIBRARY)
|
||||
|
||||
# search filesystem for each of the module individually
|
||||
foreach (module IN LISTS SuiteSparse_MODULES)
|
||||
string (TOUPPER ${module} MODULE)
|
||||
# search for files which implements this module
|
||||
find_path (${MODULE}_INCLUDE_DIR
|
||||
NAMES ${module}.h
|
||||
PATHS ${SuiteSparse_SEARCH_PATH}
|
||||
PATH_SUFFIXES "include" "include/suitesparse" "include/ufsparse" "${MODULE}/Include"
|
||||
${_no_default_path}
|
||||
)
|
||||
|
||||
find_library (${MODULE}_LIBRARY
|
||||
NAMES "${_pref_}${module}${_suff_}"
|
||||
PATHS ${SuiteSparse_SEARCH_PATH}
|
||||
PATH_SUFFIXES "lib/.libs" "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib/ufsparse" "${MODULE}/Lib"
|
||||
${_no_default_path}
|
||||
)
|
||||
# start out by including the module itself; other dependencies will be added later
|
||||
set (${MODULE}_INCLUDE_DIRS ${${MODULE}_INCLUDE_DIR})
|
||||
set (${MODULE}_LIBRARIES ${${MODULE}_LIBRARY})
|
||||
endforeach (module)
|
||||
|
||||
# insert any inter-modular dependencies here
|
||||
if (CHOLMOD_LIBRARY)
|
||||
list (APPEND CHOLMOD_LIBRARIES ${AMD_LIBRARIES} ${COLAMD_LIBRARIES})
|
||||
# optional libraries; don't insert any -NOT_FOUND paths
|
||||
if (CAMD_LIBRARY)
|
||||
list (APPEND CHOLMOD_LIBRARIES ${CAMD_LIBRARIES})
|
||||
endif (CAMD_LIBRARY)
|
||||
if (CCOLAMD_LIBRARY)
|
||||
list (APPEND CHOLMOD_LIBRARIES ${CCOLAMD_LIBRARIES})
|
||||
endif (CCOLAMD_LIBRARY)
|
||||
list (REVERSE CHOLMOD_LIBRARIES)
|
||||
# always remove the *first* library from the list
|
||||
list (REMOVE_DUPLICATES CHOLMOD_LIBRARIES)
|
||||
list (REVERSE CHOLMOD_LIBRARIES)
|
||||
endif (CHOLMOD_LIBRARY)
|
||||
if (UMFPACK_LIBRARY)
|
||||
set (UMFPACK_EXTRA_LIBS)
|
||||
# test if umfpack is usable with only amd and not cholmod
|
||||
try_compile_umfpack (HAVE_UMFPACK_WITHOUT_CHOLMOD ${AMD_LIBRARIES})
|
||||
if (HAVE_UMFPACK_WITHOUT_CHOLMOD)
|
||||
list (APPEND UMFPACK_EXTRA_LIBS ${AMD_LIBRARIES})
|
||||
else (HAVE_UMFPACK_WITHOUT_CHOLMOD)
|
||||
if (CHOLMOD_LIBRARIES)
|
||||
try_compile_umfpack (HAVE_UMFPACK_WITH_CHOLMOD ${CHOLMOD_LIBRARIES})
|
||||
if (HAVE_UMFPACK_WITH_CHOLMOD)
|
||||
list (APPEND UMFPACK_EXTRA_LIBS ${CHOLMOD_LIBRARIES})
|
||||
else (HAVE_UMFPACK_WITH_CHOLMOD)
|
||||
set (UMFPACK_EXTRA_LIBS "-NOTFOUND")
|
||||
endif (HAVE_UMFPACK_WITH_CHOLMOD)
|
||||
else (CHOLMOD_LIBRARIES)
|
||||
# if we don't have cholmod, then we certainly cannot have umfpack with cholmod
|
||||
set (UMFPACK_EXTRA_LIBS "-NOTFOUND")
|
||||
endif (CHOLMOD_LIBRARIES)
|
||||
endif (HAVE_UMFPACK_WITHOUT_CHOLMOD)
|
||||
list (APPEND UMFPACK_LIBRARIES ${UMFPACK_EXTRA_LIBS})
|
||||
list (REVERSE UMFPACK_LIBRARIES)
|
||||
list (REMOVE_DUPLICATES UMFPACK_LIBRARIES)
|
||||
list (REVERSE UMFPACK_LIBRARIES)
|
||||
endif (UMFPACK_LIBRARY)
|
||||
|
||||
# don't reset these sets; if two packages request SuiteSparse with
|
||||
# different modules, we want the sets to be merged
|
||||
#set (SuiteSparse_LIBRARIES "")
|
||||
#set (SuiteSparse_INCLUDE_DIRS "")
|
||||
|
||||
# determine which modules were found based on whether all dependencies
|
||||
# were satisfied; create a list of ALL modules (specified) that was found
|
||||
# (to be included in one swoop in CMakeLists.txt)
|
||||
set (SuiteSparse_FOUND TRUE)
|
||||
foreach (module IN LISTS SuiteSparse_FIND_COMPONENTS)
|
||||
string (TOUPPER ${module} MODULE)
|
||||
set (SuiteSparse_${MODULE}_FOUND TRUE)
|
||||
foreach (file IN LISTS ${MODULE}_INCLUDE_DIRS ${MODULE}_LIBRARIES)
|
||||
if (NOT EXISTS ${file})
|
||||
set (SuiteSparse_${MODULE}_FOUND FALSE)
|
||||
endif (NOT EXISTS ${file})
|
||||
endforeach (file)
|
||||
if (NOT SuiteSparse_${MODULE}_FOUND)
|
||||
set (SuiteSparse_FOUND FALSE)
|
||||
# use empty string instead of zero, so it can be tested with #ifdef
|
||||
# as well as #if in the source code
|
||||
set (HAVE_SUITESPARSE_${MODULE}_H "" CACHE INT "Is ${module} header present?")
|
||||
else (NOT SuiteSparse_${MODULE}_FOUND)
|
||||
set (HAVE_SUITESPARSE_${MODULE}_H 1 CACHE INT "Is ${module} header present?")
|
||||
list (APPEND SuiteSparse_LIBRARIES "${${MODULE}_LIBRARIES}")
|
||||
list (APPEND SuiteSparse_LINKER_FLAGS "${${MODULE}_LINKER_FLAGS}")
|
||||
list (APPEND SuiteSparse_INCLUDE_DIRS "${${MODULE}_INCLUDE_DIRS}")
|
||||
endif (NOT SuiteSparse_${MODULE}_FOUND)
|
||||
mark_as_advanced (HAVE_SUITESPARSE_${MODULE}_H)
|
||||
mark_as_advanced (${MODULE}_INCLUDE_DIR)
|
||||
mark_as_advanced (${MODULE}_LIBRARY)
|
||||
endforeach (module)
|
||||
|
||||
if (SuiteSparse_INCLUDE_DIRS)
|
||||
list (REMOVE_DUPLICATES SuiteSparse_INCLUDE_DIRS)
|
||||
endif (SuiteSparse_INCLUDE_DIRS)
|
||||
if (SuiteSparse_LIBRARIES)
|
||||
list (REVERSE SuiteSparse_LIBRARIES)
|
||||
list (REMOVE_DUPLICATES SuiteSparse_LIBRARIES)
|
||||
list (REVERSE SuiteSparse_LIBRARIES)
|
||||
endif (SuiteSparse_LIBRARIES)
|
||||
|
||||
# print a message to indicate status of this package
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (SuiteSparse
|
||||
DEFAULT_MSG
|
||||
SuiteSparse_LIBRARIES
|
||||
SuiteSparse_INCLUDE_DIRS
|
||||
)
|
||||
|
||||
# add these after checking to not pollute the message output (checking for
|
||||
# BLAS and LAPACK is REQUIRED so if they are not found, we'll have failed
|
||||
# already; suitesparseconfig is "optional" anyway)
|
||||
list (APPEND SuiteSparse_LIBRARIES ${SuiteSparse_EXTRA_LIBS})
|
||||
185
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindSuperLU.cmake
vendored
Normal file
185
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindSuperLU.cmake
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
#
|
||||
# Module that checks whether SuperLU is available and usable.
|
||||
# SuperLU must be a version released after the year 2005.
|
||||
#
|
||||
# Variables used by this module which you may want to set:
|
||||
# SUPERLU_ROOT Path list to search for SuperLU
|
||||
#
|
||||
# Sets the follwing variable:
|
||||
#
|
||||
# SUPERLU_FOUND True if SuperLU available and usable.
|
||||
# SUPERLU_MIN_VERSION_4_3 True if SuperLU version >= 4.3.
|
||||
# SUPERLU_POST_2005_VERSION True if SuperLU is from post-2005
|
||||
# SUPERLU_WITH_VERSION Human readable string containing version information.
|
||||
# SUPERLU_INCLUDE_DIRS Path to the SuperLU include dirs.
|
||||
# SUPERLU_LIBRARIES Name to the SuperLU library.
|
||||
#
|
||||
|
||||
if(NOT USE_SUPERLU)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(CheckIncludeFiles)
|
||||
include(CMakePushCheckState)
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
cmake_push_check_state()
|
||||
|
||||
set(SUPERLU_FOUND "FALSE")
|
||||
|
||||
# find out the size of a pointer. this is required to only search for
|
||||
# libraries in the directories relevant for the architecture
|
||||
if (CMAKE_SIZEOF_VOID_P)
|
||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||
endif (CMAKE_SIZEOF_VOID_P)
|
||||
|
||||
# look for files only at the positions given by the user if
|
||||
# an explicit path is specified
|
||||
if(SUPERLU_ROOT)
|
||||
set (_no_default_path "NO_DEFAULT_PATH")
|
||||
else()
|
||||
set (_no_default_path "")
|
||||
endif()
|
||||
|
||||
# look for a system-wide BLAS library
|
||||
find_package(BLAS QUIET)
|
||||
|
||||
# look for the internal SuperLU blas library (but only if no
|
||||
# system-wide library was found and a path to the superLU library was
|
||||
# specified)
|
||||
set(SUPERLU_BLAS_LIBRARY "")
|
||||
if (BLAS_FOUND)
|
||||
list(APPEND SUPERLU_BLAS_LIBRARY "${BLAS_LIBRARIES}")
|
||||
elseif(SUPERLU_ROOT)
|
||||
find_library(SUPERLU_BLAS_LIBRARY
|
||||
NAMES "blas"
|
||||
PATHS ${SUPERLU_ROOT}
|
||||
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# print message if there was still no blas found!
|
||||
if(NOT BLAS_FOUND AND NOT SUPERLU_BLAS_LIBRARY)
|
||||
message(STATUS "BLAS not found but required for SuperLU")
|
||||
return()
|
||||
endif()
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${SUPERLU_BLAS_LIBRARY}")
|
||||
|
||||
# find the directory containing the SuperLU include files
|
||||
if (NOT SUPERLU_INCLUDE_DIR)
|
||||
find_path(SUPERLU_INCLUDE_DIR
|
||||
NAMES "supermatrix.h"
|
||||
PATHS ${SUPERLU_ROOT}
|
||||
PATH_SUFFIXES "superlu" "include/superlu" "include" "SRC"
|
||||
${_no_default_path}
|
||||
)
|
||||
endif()
|
||||
if(NOT SUPERLU_INCLUDE_DIR)
|
||||
message(STATUS "Directory with the SuperLU include files not found")
|
||||
return()
|
||||
endif()
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${SUPERLU_INCLUDE_DIR}")
|
||||
|
||||
# look for actual SuperLU library
|
||||
if (NOT SUPERLU_LIBRARY)
|
||||
find_library(SUPERLU_LIBRARY
|
||||
NAMES "superlu_4.3" "superlu_4.2" "superlu_4.1" "superlu_4.0" "superlu_3.1" "superlu_3.0" "superlu"
|
||||
PATHS ${SUPERLU_ROOT}
|
||||
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
${_no_default_path}
|
||||
)
|
||||
endif()
|
||||
if(NOT SUPERLU_LIBRARY)
|
||||
message(STATUS "Directory with the SuperLU library not found")
|
||||
return()
|
||||
endif()
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${SUPERLU_LIBRARY}")
|
||||
|
||||
# check whether "mem_usage_t.expansions" was found in "slu_ddefs.h"
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <slu_ddefs.h>
|
||||
int main(void)
|
||||
{
|
||||
mem_usage_t mem;
|
||||
return mem.expansions;
|
||||
}"
|
||||
HAVE_MEM_USAGE_T_EXPANSIONS)
|
||||
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <slu_ddefs.h>
|
||||
int main(void)
|
||||
{
|
||||
return SLU_DOUBLE;
|
||||
}"
|
||||
SUPERLU_MIN_VERSION_4_3)
|
||||
|
||||
# check whether version is at least post-2005
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <slu_ddefs.h>
|
||||
int main(void)
|
||||
{
|
||||
GlobalLU_t g;
|
||||
return 0;
|
||||
}"
|
||||
SUPERLU_POST_2005_VERSION)
|
||||
|
||||
# check whether version is at least 5.0
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
typedef int int_t;
|
||||
#include <supermatrix.h>
|
||||
#include <slu_util.h>
|
||||
int main(void)
|
||||
{
|
||||
GlobalLU_t glu;
|
||||
return 0;
|
||||
}"
|
||||
SUPERLU_MIN_VERSION_5)
|
||||
|
||||
cmake_pop_check_state()
|
||||
|
||||
if(SUPERLU_MIN_VERSION_4_3)
|
||||
set(SUPERLU_WITH_VERSION "SuperLU >= 4.3" CACHE STRING
|
||||
"Human readable string containing SuperLU version information.")
|
||||
else()
|
||||
set(SUPERLU_WITH_VERSION "SuperLU <= 4.2, post 2005" CACHE STRING
|
||||
"Human readable string containing SuperLU version information.")
|
||||
endif()
|
||||
|
||||
if(SUPERLU_MIN_VERSION_5)
|
||||
include(UseDuneVer)
|
||||
find_dune_version("dune" "istl")
|
||||
set(DUNE_ISTL_VERSION ${DUNE_ISTL_VERSION_MAJOR}.${DUNE_ISTL_VERSION_MINOR}.${DUNE_ISTL_VERSION_REVISION})
|
||||
if(DUNE_ISTL_VERSION VERSION_LESS 2.5)
|
||||
message(STATUS "SuperLU requested, but version found not compatible with dune-istl ${DUNE_ISTL_VERSION}")
|
||||
set(SUPERLU_LIBRARY "")
|
||||
set(SUPERLU_INCLUDE_DIR "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# behave like a CMake module is supposed to behave
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
"SuperLU"
|
||||
DEFAULT_MSG
|
||||
SUPERLU_INCLUDE_DIR
|
||||
SUPERLU_LIBRARY)
|
||||
|
||||
mark_as_advanced(SUPERLU_INCLUDE_DIR SUPERLU_LIBRARY)
|
||||
|
||||
# if both headers and library are found, store results
|
||||
if(SUPERLU_FOUND)
|
||||
set(SUPERLU_INCLUDE_DIRS ${SUPERLU_INCLUDE_DIR})
|
||||
set(SUPERLU_LIBRARIES ${SUPERLU_LIBRARY})
|
||||
set(SUPERLU_INT_TYPE int)
|
||||
if(SUPERLU_MIN_VERSION_4_3)
|
||||
set(HAVE_SLU_DDEFS_H 1)
|
||||
check_include_files(slu_sdefs.h HAVE_SLU_SDEFS_H)
|
||||
check_include_files(slu_cdefs.h HAVE_SLU_CDEFS_H)
|
||||
check_include_files(slu_zdefs.h HAVE_SLU_ZDEFS_H)
|
||||
endif()
|
||||
if (SUPERLU_BLAS_LIBRARY)
|
||||
list(APPEND SUPERLU_LIBRARIES ${SUPERLU_BLAS_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
cmake_pop_check_state()
|
||||
112
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindUG.cmake
vendored
Normal file
112
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindUG.cmake
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
#
|
||||
# This module first tests for UG and then sets the necessary flags
|
||||
# and config.h defines. If UG is found UG_FOUND will be true.
|
||||
#
|
||||
|
||||
# this function is required in order not to pollute the global
|
||||
# namespace with the macros defined in ug-config*.cmake
|
||||
function(opmFindUg)
|
||||
if(NOT UG_ROOT)
|
||||
# check whether UG is in /usr/local
|
||||
if(EXISTS "/usr/local/include/ug")
|
||||
set(UG_ROOT "/usr/local")
|
||||
|
||||
# check whether UG is in /usr
|
||||
elseif(EXISTS "/usr/include/ug")
|
||||
set(UG_ROOT "/usr")
|
||||
|
||||
# oops
|
||||
else()
|
||||
message(STATUS "Could not find UG. It seems to be not installed.")
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UG_ROOT AND NOT UG_DIR)
|
||||
# define the directory where the config file resides
|
||||
if(EXISTS "${UG_ROOT}/lib/cmake/ug/ug-config.cmake")
|
||||
set(UG_DIR ${UG_ROOT}/lib/cmake/ug)
|
||||
elseif(EXISTS "${UG_ROOT}/lib64/cmake/ug/ug-config.cmake")
|
||||
set(UG_DIR ${UG_ROOT}/lib64/cmake/ug)
|
||||
else()
|
||||
message(WARNING "Could not find file ug-config.cmake relative to given UG_ROOT")
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# include the config mode files kindly provided by UG...
|
||||
include(${UG_DIR}/ug-config-version.cmake)
|
||||
include(${UG_DIR}/ug-config.cmake)
|
||||
|
||||
set(UG_FOUND "1")
|
||||
if(NOT UG_FOR_DUNE STREQUAL "yes")
|
||||
set(UG_FOUND "0")
|
||||
message(WARNING "UG was not configured for DUNE. Did pass --enable-dune to its configure?")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(HAVE_UG ${UG_FOUND})
|
||||
|
||||
# parse version
|
||||
string(REGEX REPLACE "([0-9]*)\\.[0-9]*\\..*" "\\1" UG_VERSION_MAJOR "${PACKAGE_VERSION}")
|
||||
string(REGEX REPLACE "[0-9]*\\.([0-9]*)\\..*" "\\1" UG_VERSION_MINOR "${PACKAGE_VERSION}")
|
||||
string(REGEX REPLACE "[0-9]*\\.[0-9]*\\.([0-9]*).*" "\\1" UG_VERSION_REVISION "${PACKAGE_VERSION}")
|
||||
|
||||
string(REGEX REPLACE ".*-patch([0-9]*)" "\\1" TMP "${PACKAGE_VERSION}")
|
||||
if(TMP STREQUAL "${PACKAGE_VERSION}")
|
||||
set(UG_VERSION_PATCHLEVEL "")
|
||||
else()
|
||||
set(UG_VERSION_PATCHLEVEL "${TMP}")
|
||||
endif()
|
||||
|
||||
# Adjust compiler/linker arguments
|
||||
set(UG_LIBRARY_DIR "${libdir}")
|
||||
|
||||
foreach (UG_RAW_LIB "-lugS2" "-lugS3" "-ldevS")
|
||||
string(REGEX REPLACE "-l(.*)" "\\1" UG_LIB "${UG_RAW_LIB}")
|
||||
set(UG_LIB_FILE "${UG_LIBRARY_DIR}/lib${UG_LIB}.a")
|
||||
if (EXISTS "${UG_LIB_FILE}")
|
||||
set(UG_LIBS "${UG_LIBS}" ${UG_LIB_FILE})
|
||||
else()
|
||||
set(UG_LIBS "${UG_LIBS}" ${UG_LIB})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(UG_LIBRARIES "${UG_LIBS}")
|
||||
|
||||
# export all variables which need to be seen globally
|
||||
set(UG_FOUND "${UG_FOUND}" PARENT_SCOPE)
|
||||
set(HAVE_UG "${HAVE_UG}" PARENT_SCOPE)
|
||||
set(UG_INCLUDE_DIRS "${UG_INCLUDES}" PARENT_SCOPE)
|
||||
set(UG_LIBRARIES "${UG_LIBRARIES}" PARENT_SCOPE)
|
||||
set(UG_VERSION_MAJOR "${UG_VERSION_MAJOR}" PARENT_SCOPE)
|
||||
set(UG_VERSION_MINOR "${UG_VERSION_MINOR}" PARENT_SCOPE)
|
||||
set(UG_VERSION_REVISION "${UG_VERSION_REVISION}" PARENT_SCOPE)
|
||||
set(UG_VERSION_PATCHLEVEL "${UG_VERSION_PATCHLEVEL}" PARENT_SCOPE)
|
||||
|
||||
set(UG_DEFINITIONS "${UG_COMPILE_FLAGS}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
if (NOT HAVE_UG)
|
||||
opmFindUg()
|
||||
|
||||
set(HAVE_UG "${HAVE_UG}" CACHE BOOL "UG library is available")
|
||||
set(UG_INCLUDE_DIRS "${UG_INCLUDE_DIRS}" CACHE STRING "Directory containing the headers of the UG library")
|
||||
set(UG_LIBRARIES "${UG_LIBRARIES}" CACHE STRING "The libraries which need to be linked to be able to use the UG library")
|
||||
set(UG_DEFINITIONS "${UG_DEFINITIONS}" CACHE STRING "The compiler flags for the UG library")
|
||||
set(UG_VERSION_MAJOR "${UG_VERSION_MAJOR}" CACHE INT "Major version of the UG release")
|
||||
set(UG_VERSION_MINOR "${UG_VERSION_MINOR}" CACHE INT "Minor version of the UG release")
|
||||
set(UG_VERSION_REVISION "${UG_VERSION_REVISION}" CACHE INT "Revision of the UG release")
|
||||
set(UG_VERSION_PATCHLEVEL "${UG_VERSION_PATCHLEVEL}" CACHE INT "Patchlevel of the UG release")
|
||||
|
||||
mark_as_advanced(HAVE_UG)
|
||||
mark_as_advanced(UG_INCLUDE_DIRS)
|
||||
mark_as_advanced(UG_LIBRARIES)
|
||||
mark_as_advanced(UG_DEFINITIONS)
|
||||
mark_as_advanced(UG_VERSION_MAJOR)
|
||||
mark_as_advanced(UG_VERSION_MINOR)
|
||||
mark_as_advanced(UG_VERSION_REVISION)
|
||||
mark_as_advanced(UG_VERSION_PATCHLEVEL)
|
||||
else()
|
||||
set(UG_FOUND "0")
|
||||
endif()
|
||||
25
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindValgrind.cmake
vendored
Normal file
25
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindValgrind.cmake
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# Find Valgrind.
|
||||
#
|
||||
# This module defines:
|
||||
# VALGRIND_INCLUDE_DIR, where to find valgrind/memcheck.h, etc.
|
||||
# VALGRIND_PROGRAM, the valgrind executable.
|
||||
# VALGRIND_FOUND, If false, do not try to use valgrind.
|
||||
#
|
||||
# If you have valgrind installed in a non-standard place, you can define
|
||||
# VALGRIND_ROOT to tell cmake where it is.
|
||||
if (VALGRIND_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h
|
||||
/usr/include /usr/local/include ${VALGRIND_ROOT}/include)
|
||||
|
||||
# if VALGRIND_ROOT is empty, we explicitly add /bin to the search
|
||||
# path, but this does not hurt...
|
||||
find_program(VALGRIND_PROGRAM NAMES valgrind PATH ${VALGRIND_ROOT}/bin)
|
||||
|
||||
find_package_handle_standard_args(VALGRIND DEFAULT_MSG
|
||||
VALGRIND_INCLUDE_DIR
|
||||
VALGRIND_PROGRAM)
|
||||
|
||||
mark_as_advanced(VALGRIND_ROOT VALGRIND_INCLUDE_DIR VALGRIND_PROGRAM)
|
||||
64
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindZOLTAN.cmake
vendored
Normal file
64
ThirdParty/custom-opm-common/opm-common/cmake/Modules/FindZOLTAN.cmake
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# -*-cmake-*-
|
||||
#
|
||||
# Try to find the libzoltan graph partioning library
|
||||
#
|
||||
# Once done, this will define:
|
||||
#
|
||||
# ZOLTAN_FOUND - system has the libzoltan graph partioning library
|
||||
# HAVE_ZOLTAN - like ZOLTAN_FOUND, but for the inclusion in config.h
|
||||
# ZOLTAN_INCLUDE_DIR - incude paths to use libzoltan
|
||||
# ZOLTAN_LIBRARIES - Link these to use libzoltan
|
||||
|
||||
set(ZOLTAN_SEARCH_PATH "/usr" "/usr/local" "/opt" "/opt/local")
|
||||
set(ZOLTAN_NO_DEFAULT_PATH "")
|
||||
if(ZOLTAN_ROOT)
|
||||
set(ZOLTAN_SEARCH_PATH "${ZOLTAN_ROOT}")
|
||||
set(ZOLTAN_NO_DEFAULT_PATH "NO_DEFAULT_PATH")
|
||||
endif()
|
||||
|
||||
# We only need zoltan with MPI. Otherwise usage of alugrid is broken.
|
||||
find_package(MPI)
|
||||
|
||||
# Make sure we have checked for the underlying partitioners.
|
||||
find_package(PTScotch)
|
||||
#find_package(ParMETIS)
|
||||
|
||||
# search for files which implements this module
|
||||
find_path (ZOLTAN_INCLUDE_DIRS
|
||||
NAMES "zoltan.h"
|
||||
PATHS ${ZOLTAN_SEARCH_PATH}
|
||||
PATH_SUFFIXES include trilinos
|
||||
${ZOLTAN_NO_DEFAULT_PATH})
|
||||
|
||||
# only search in architecture-relevant directory
|
||||
if (CMAKE_SIZEOF_VOID_P)
|
||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||
endif (CMAKE_SIZEOF_VOID_P)
|
||||
|
||||
find_library(ZOLTAN_LIBRARIES
|
||||
NAMES zoltan trilinos_zoltan
|
||||
PATHS ${ZOLTAN_SEARCH_PATH}
|
||||
PATH_SUFFIXES "lib/.libs" "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
${ZOLTAN_NO_DEFAULT_PATH})
|
||||
|
||||
set (ZOLTAN_FOUND FALSE)
|
||||
|
||||
set (ZOLTAN_CONFIG_VAR HAVE_ZOLTAN)
|
||||
|
||||
# print a message to indicate status of this package
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(ZOLTAN
|
||||
DEFAULT_MSG
|
||||
ZOLTAN_LIBRARIES
|
||||
ZOLTAN_INCLUDE_DIRS
|
||||
MPI_FOUND
|
||||
)
|
||||
|
||||
if (ZOLTAN_FOUND)
|
||||
set(HAVE_ZOLTAN 1)
|
||||
set(ZOLTAN_LIBRARIES ${ZOLTAN_LIBRARIES} ${PARMETIS_LIBRARIES} ${PTSCOTCH_LIBRARIES})
|
||||
set(ZOLTAN_INCLUDE_DIRS ${ZOLTAN_INCLUDE_DIRS} ${PARMETIS_INCLUDE_DIRS}
|
||||
${PTSCOTCH_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
90
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findcjson.cmake
vendored
Normal file
90
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findcjson.cmake
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
# Look for the cjson library; will probably newer be found.
|
||||
# If found, it sets these variables:
|
||||
#
|
||||
# CJSON_INCLUDE_DIRS Header file directories
|
||||
# CJSON_LIBRARIES Archive/shared objects
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
if ((NOT CJSON_ROOT) AND OPM_PARSER_ROOT)
|
||||
set( CJSON_ROOT ${OPM_PARSER_ROOT})
|
||||
endif()
|
||||
|
||||
if (CJSON_ROOT)
|
||||
set (_no_default_path "NO_DEFAULT_PATH")
|
||||
else (CJSON_ROOT)
|
||||
set (_no_default_path "")
|
||||
endif (CJSON_ROOT)
|
||||
|
||||
|
||||
find_path (CJSON_INCLUDE_DIR
|
||||
NAMES "cjson/cJSON.h"
|
||||
HINTS "${CJSON_ROOT}"
|
||||
PATHS "${PROJECT_SOURCE_DIR}"
|
||||
PATH_SUFFIXES "include" "external"
|
||||
DOC "Path to cjson library header files"
|
||||
${_no_default_path} )
|
||||
|
||||
# find out the size of a pointer. this is required to only search for
|
||||
# libraries in the directories relevant for the architecture
|
||||
if (CMAKE_SIZEOF_VOID_P)
|
||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||
endif (CMAKE_SIZEOF_VOID_P)
|
||||
|
||||
string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/?(.*)" "\\1" BUILD_DIR_SUFFIX "${PROJECT_BINARY_DIR}")
|
||||
|
||||
find_library (CJSON_LIBRARY
|
||||
NAMES "cjson"
|
||||
HINTS "${CJSON_ROOT}"
|
||||
PATHS "${PROJECT_BINARY_DIR}/../opm-parser"
|
||||
"${PROJECT_BINARY_DIR}/../opm-parser${BUILD_DIR_SUFFIX}"
|
||||
"${PROJECT_BINARY_DIR}/../../opm-parser/${BUILD_DIR_SUFFIX}"
|
||||
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
"opm/json"
|
||||
DOC "Path to cjson library archive/shared object files"
|
||||
${_no_default_path} )
|
||||
|
||||
# setup list of all required libraries to link with cjson
|
||||
set (CJSON_INCLUDE_DIRS ${CJSON_INCLUDE_DIR})
|
||||
set (CJSON_LIBRARIES ${CJSON_LIBRARY})
|
||||
|
||||
# math library (should exist on all unices; automatically linked on Windows)
|
||||
if (UNIX)
|
||||
find_library (MATH_LIBRARY NAMES "m")
|
||||
list (APPEND CJSON_LIBRARIES ${MATH_LIBRARY})
|
||||
endif (UNIX)
|
||||
|
||||
# see if we can compile a minimum example
|
||||
# CMake logical test doesn't handle lists (sic)
|
||||
if (NOT (CJSON_INCLUDE_DIRS MATCHES "-NOTFOUND" OR CJSON_LIBRARIES MATCHES "-NOTFOUND"))
|
||||
include (CMakePushCheckState)
|
||||
include (CheckCSourceCompiles)
|
||||
cmake_push_check_state ()
|
||||
set (CMAKE_REQUIRED_INCLUDES ${CJSON_INCLUDE_DIRS})
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${CJSON_LIBRARIES})
|
||||
|
||||
check_c_source_compiles (
|
||||
"#include <stdlib.h>
|
||||
#include <cjson/cJSON.h>
|
||||
int main (void) {
|
||||
cJSON root;
|
||||
return 0;
|
||||
}" HAVE_CJSON)
|
||||
cmake_pop_check_state ()
|
||||
else ()
|
||||
# clear the cache so the find probe is attempted again if files becomes
|
||||
# available (only upon a unsuccessful *compile* should we disable further
|
||||
# probing)
|
||||
set (HAVE_CJSON)
|
||||
unset (HAVE_CJSON CACHE)
|
||||
endif ()
|
||||
|
||||
# if the test program didn't compile, but was required to do so, bail
|
||||
# out now and display an error; otherwise limp on
|
||||
set (CJSON_FIND_REQUIRED ${cjson_FIND_REQUIRED})
|
||||
set (CJSON_FIND_QUIETLY ${cjson_FIND_QUIETLY})
|
||||
find_package_handle_standard_args (CJSON
|
||||
DEFAULT_MSG
|
||||
CJSON_INCLUDE_DIRS CJSON_LIBRARIES HAVE_CJSON
|
||||
)
|
||||
set (cjson_FOUND ${CJSON_FOUND})
|
||||
85
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-alugrid.cmake
vendored
Normal file
85
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-alugrid.cmake
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
# - Find DUNE ALUgrid library
|
||||
#
|
||||
# Defines the following variables:
|
||||
# dune-alugrid_INCLUDE_DIRS Directory of header files
|
||||
# dune-alugrid_LIBRARIES Directory of shared object files
|
||||
# dune-alugrid_DEFINITIONS Defines that must be set to compile
|
||||
# dune-alugrid_CONFIG_VARS List of defines that should be in config.h
|
||||
# HAVE_DUNE_ALUGRID Binary value to use in config.h
|
||||
|
||||
# Copyright (C) 2013 Uni Research AS
|
||||
# This code is licensed under The GNU General Public License v3.0
|
||||
|
||||
include (OpmPackage)
|
||||
# find dune-alugrid when build with autotools (deprecated in dune 2.4 and removed after dune 3.0
|
||||
find_opm_package (
|
||||
# module name
|
||||
"dune-alugrid"
|
||||
|
||||
# dependencies
|
||||
# TODO: we should probe for all the HAVE_* values listed below;
|
||||
# however, we don't actually use them in our implementation, so
|
||||
# we just include them to forward here in case anyone else does
|
||||
"dune-grid REQUIRED;
|
||||
ZLIB;
|
||||
ZOLTAN;
|
||||
METIS
|
||||
"
|
||||
# header to search for
|
||||
"dune/alugrid/grid.hh"
|
||||
|
||||
# library to search for
|
||||
"dunealugrid;alugrid_parallel;alugrid_serial"
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
"#include <dune/alugrid/common/interfaces.hh>
|
||||
int main (void) {
|
||||
return 0;
|
||||
}
|
||||
"
|
||||
# config variables
|
||||
"HAVE_DUNE_ALUGRID
|
||||
")
|
||||
|
||||
# find dune-alugrid when build with cmake
|
||||
find_opm_package (
|
||||
# module name
|
||||
"dune-alugrid"
|
||||
|
||||
# dependencies
|
||||
# TODO: we should probe for all the HAVE_* values listed below;
|
||||
# however, we don't actually use them in our implementation, so
|
||||
# we just include them to forward here in case anyone else does
|
||||
"CXX11Features REQUIRED;
|
||||
dune-grid REQUIRED;
|
||||
ZLIB;
|
||||
ZOLTAN;
|
||||
METIS
|
||||
"
|
||||
# header to search for
|
||||
"dune/alugrid/grid.hh"
|
||||
|
||||
# library to search for
|
||||
"dunealugrid"
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
"#include <dune/alugrid/common/interfaces.hh>
|
||||
int main (void) {
|
||||
return 0;
|
||||
}
|
||||
"
|
||||
# config variables
|
||||
"HAVE_DUNE_ALUGRID
|
||||
")
|
||||
|
||||
#debug_find_vars ("dune-grid")
|
||||
|
||||
# make version number available in config.h
|
||||
include (UseDuneVer)
|
||||
find_dune_version ("dune" "alugrid")
|
||||
82
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-common.cmake
vendored
Normal file
82
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-common.cmake
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
# - 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
|
||||
"BLAS REQUIRED;
|
||||
LAPACK REQUIRED;
|
||||
CxaDemangle;
|
||||
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
|
||||
"HAS_ATTRIBUTE_UNUSED;
|
||||
HAS_ATTRIBUTE_DEPRECATED;
|
||||
HAS_ATTRIBUTE_DEPRECATED_MSG;
|
||||
HAVE_ARRAY;
|
||||
HAVE_BOOST_MAKE_SHARED_HPP;
|
||||
HAVE_BOOST_SHARED_PTR_HPP;
|
||||
HAVE_DUNE_BOOST;
|
||||
HAVE_GMP;
|
||||
HAVE_MAKE_SHARED;
|
||||
HAVE_MPI;
|
||||
HAVE_NULLPTR;
|
||||
HAVE_STATIC_ASSERT;
|
||||
HAVE_SHARED_PTR;
|
||||
MPI_2;
|
||||
SHARED_PTR_HEADER;
|
||||
SHARED_PTR_NAMESPACE;
|
||||
HAVE_TYPE_TRAITS;
|
||||
HAVE_TR1_TUPLE;
|
||||
HAVE_TUPLE;
|
||||
HAVE_CXA_DEMANGLE
|
||||
")
|
||||
#debug_find_vars ("dune-common")
|
||||
|
||||
if(MPI_C_FOUND)
|
||||
# check for MPI version 2
|
||||
include(CMakePushCheckState)
|
||||
include(CheckFunctionExists)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES};${MPI_C_LIBRARIES})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${MPI_C_INCLUDES})
|
||||
check_function_exists(MPI_Finalized MPI_2)
|
||||
cmake_pop_check_state()
|
||||
endif(MPI_C_FOUND)
|
||||
|
||||
# make version number available in config.h
|
||||
include (UseDuneVer)
|
||||
find_dune_version ("dune" "common")
|
||||
56
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-fem.cmake
vendored
Normal file
56
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-fem.cmake
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
# - Find DUNE Fem library
|
||||
#
|
||||
# Defines the following variables:
|
||||
# dune-alugrid_INCLUDE_DIRS Directory of header files
|
||||
# dune-alugrid_LIBRARIES Directory of shared object files
|
||||
# dune-alugrid_DEFINITIONS Defines that must be set to compile
|
||||
# dune-alugrid_CONFIG_VARS List of defines that should be in config.h
|
||||
# HAVE_DUNE_FEM Binary value to use in config.h
|
||||
|
||||
# Copyright (C) 2015 IRIS AS
|
||||
# This code is licensed under The GNU General Public License v3.0
|
||||
|
||||
include (OpmPackage)
|
||||
find_opm_package (
|
||||
# module name
|
||||
"dune-fem"
|
||||
|
||||
# dependencies
|
||||
# TODO: we should probe for all the HAVE_* values listed below;
|
||||
# however, we don't actually use them in our implementation, so
|
||||
# we just include them to forward here in case anyone else does
|
||||
"dune-common REQUIRED;
|
||||
dune-grid REQUIRED;
|
||||
dune-alugrid;
|
||||
ZLIB;
|
||||
ZOLTAN;
|
||||
METIS
|
||||
"
|
||||
# header to search for
|
||||
"dune/fem/space/shapefunctionset/legendre.hh"
|
||||
|
||||
# library to search for
|
||||
"dunefem"
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
"#include <dune/fem/space/shapefunctionset/legendre.hh>
|
||||
int main (void) {
|
||||
//Dune::Fem::LegendrePolynomials::weight();
|
||||
return 0;
|
||||
}
|
||||
"
|
||||
# config variables
|
||||
"HAVE_DUNE_FEM;
|
||||
HAVE_METIS;
|
||||
HAVE_ZLIB;
|
||||
HAVE_ZOLTAN
|
||||
")
|
||||
|
||||
#debug_find_vars ("dune-grid")
|
||||
|
||||
# make version number available in config.h
|
||||
include (UseDuneVer)
|
||||
find_dune_version ("dune" "fem")
|
||||
49
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-geometry.cmake
vendored
Normal file
49
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-geometry.cmake
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# - Find DUNE geometry library
|
||||
#
|
||||
# Defines the following variables:
|
||||
# dune-geometry_INCLUDE_DIRS Directory of header files
|
||||
# dune-geometry_LIBRARIES Directory of shared object files
|
||||
# dune-geometry_DEFINITIONS Defines that must be set to compile
|
||||
# dune-geometry_CONFIG_VARS List of defines that should be in config.h
|
||||
# HAVE_DUNE_GEOMETRY Binary value to use in config.h
|
||||
|
||||
# Copyright (C) 2013 Uni Research AS
|
||||
# This code is licensed under The GNU General Public License v3.0
|
||||
|
||||
include (OpmPackage)
|
||||
find_opm_package (
|
||||
# module name
|
||||
"dune-geometry"
|
||||
|
||||
# dependencies
|
||||
# TODO: we should probe for all the HAVE_* values listed below;
|
||||
# however, we don't actually use them in our implementation, so
|
||||
# we just include them to forward here in case anyone else does
|
||||
"dune-common REQUIRED
|
||||
"
|
||||
# header to search for
|
||||
"dune/geometry/quadraturerules.hh"
|
||||
|
||||
# library to search for
|
||||
"dunegeometry"
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
"#include <dune/geometry/quadraturerules.hh>
|
||||
int main (void) {
|
||||
Dune::GeometryType gt = Dune::GeometryTypes::quadrilateral;
|
||||
Dune::QuadratureRules<double, 2>::rule(gt, 2).size();
|
||||
return 0;
|
||||
}
|
||||
"
|
||||
# config variables
|
||||
"HAVE_ALGLIB
|
||||
")
|
||||
|
||||
#debug_find_vars ("dune-geometry")
|
||||
|
||||
# make version number available in config.h
|
||||
include (UseDuneVer)
|
||||
find_dune_version ("dune" "geometry")
|
||||
66
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-grid.cmake
vendored
Normal file
66
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-grid.cmake
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
# - Find DUNE grid library
|
||||
#
|
||||
# Defines the following variables:
|
||||
# dune-grid_INCLUDE_DIRS Directory of header files
|
||||
# dune-grid_LIBRARIES Directory of shared object files
|
||||
# dune-grid_DEFINITIONS Defines that must be set to compile
|
||||
# dune-grid_CONFIG_VARS List of defines that should be in config.h
|
||||
# HAVE_DUNE_GRID Binary value to use in config.h
|
||||
|
||||
# Copyright (C) 2013 Uni Research AS
|
||||
# This code is licensed under The GNU General Public License v3.0
|
||||
|
||||
include (OpmPackage)
|
||||
|
||||
set(DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS 1)
|
||||
|
||||
find_opm_package (
|
||||
# module name
|
||||
"dune-grid"
|
||||
|
||||
# dependencies
|
||||
# TODO: we should probe for all the HAVE_* values listed below;
|
||||
# however, we don't actually use them in our implementation, so
|
||||
# we just include them to forward here in case anyone else does
|
||||
"dune-common REQUIRED;
|
||||
dune-geometry REQUIRED;
|
||||
dune-uggrid;
|
||||
MPI;
|
||||
UG;
|
||||
Alberta
|
||||
"
|
||||
# header to search for
|
||||
"dune/grid/onedgrid.hh"
|
||||
|
||||
# library to search for
|
||||
"dunegrid"
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
"#include <dune/grid/onedgrid.hh>
|
||||
int main (void) {
|
||||
Dune::OneDGrid grid(1, 0., 1.);
|
||||
return grid.size(0);
|
||||
}
|
||||
"
|
||||
# config variables
|
||||
"HAVE_MPI;
|
||||
HAVE_UG;
|
||||
HAVE_DUNE_FEM;
|
||||
HAVE_GRIDTYPE;
|
||||
HAVE_GRAPE;
|
||||
HAVE_PSURFACE;
|
||||
HAVE_AMIRAMESH;
|
||||
HAVE_ALBERTA;
|
||||
HAVE_STDINT_H;
|
||||
DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS;
|
||||
DUNE_ALBERTA_VERSION
|
||||
")
|
||||
|
||||
#debug_find_vars ("dune-grid")
|
||||
|
||||
# make version number available in config.h
|
||||
include (UseDuneVer)
|
||||
find_dune_version ("dune" "grid")
|
||||
69
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-istl.cmake
vendored
Normal file
69
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-istl.cmake
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
# - Find DUNE ISTL library
|
||||
#
|
||||
# Defines the following variables:
|
||||
# dune-istl_INCLUDE_DIRS Directory of header files
|
||||
# dune-istl_LIBRARIES Directory of shared object files
|
||||
# dune-istl_DEFINITIONS Defines that must be set to compile
|
||||
# dune-istl_CONFIG_VARS List of defines that should be in config.h
|
||||
# HAVE_DUNE_ISTL 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-istl"
|
||||
|
||||
# required dependencies
|
||||
"dune-common REQUIRED;
|
||||
ParMETIS;
|
||||
SuperLU;
|
||||
SuiteSparse COMPONENTS umfpack
|
||||
"
|
||||
# header to search for
|
||||
"dune/istl/bcrsmatrix.hh"
|
||||
|
||||
# library to search for
|
||||
""
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
"#include <dune/common/deprecated.hh>
|
||||
#include <dune/istl/bcrsmatrix.hh>
|
||||
#include <dune/common/fmatrix.hh>
|
||||
|
||||
int main (void) {
|
||||
typedef Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> > Matrix;
|
||||
Matrix matrix( 3, 3, Matrix::random );
|
||||
for (int i = 0; i < 3; ++i) matrix.setrowsize(i, 2);
|
||||
matrix.endrowsizes();
|
||||
return 0;
|
||||
}
|
||||
"
|
||||
# config variables
|
||||
"HAVE_BOOST_FUSION;
|
||||
HAVE_MEM_USAGE_T_EXPANSIONS;
|
||||
HAVE_PARDISO;
|
||||
HAVE_BOOST;
|
||||
HAVE_MPI;
|
||||
HAVE_PARMETIS;
|
||||
HAVE_SUPERLU;
|
||||
HAVE_UMFPACK;
|
||||
HAVE_SUITESPARSE_UMFPACK;
|
||||
SUPERLU_INT_TYPE;
|
||||
HAVE_SLU_CDEFS_H;
|
||||
HAVE_SLU_DDEFS_H;
|
||||
HAVE_SLU_SDEFS_H;
|
||||
HAVE_SLU_ZDEFS_H;
|
||||
SUPERLU_MIN_VERSION_4_3;
|
||||
SUPERLU_MIN_VERSION_5;
|
||||
SUPERLU_POST_2005_VERSION
|
||||
")
|
||||
#debug_find_vars ("dune-istl")
|
||||
|
||||
# make version number available in config.h
|
||||
include (UseDuneVer)
|
||||
find_dune_version ("dune" "istl")
|
||||
42
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-localfunctions.cmake
vendored
Normal file
42
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-localfunctions.cmake
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
# - Find DUNE localfunctions library
|
||||
#
|
||||
# Defines the following variables:
|
||||
# dune-localfunctions_INCLUDE_DIRS Directory of header files
|
||||
# dune-localfunctions_LIBRARIES Directory of shared object files
|
||||
# dune-localfunctions_DEFINITIONS Defines that must be set to compile
|
||||
# dune-localfunctions_CONFIG_VARS List of defines that should be in config.h
|
||||
# HAVE_DUNE_LOCALFUNCTIONS 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-localfunctions"
|
||||
|
||||
# required dependencies
|
||||
"dune-common REQUIRED"
|
||||
# header to search for
|
||||
"dune/localfunctions/common/localbasis.hh"
|
||||
|
||||
# library to search for
|
||||
""
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
"#include <dune/localfunctions/common/localbasis.hh>
|
||||
|
||||
int main (void) {
|
||||
return 0;
|
||||
}
|
||||
"
|
||||
# config variables
|
||||
"")
|
||||
#debug_find_vars ("dune-localfunctions")
|
||||
|
||||
# make version number available in config.h
|
||||
include (UseDuneVer)
|
||||
find_dune_version ("dune" "localfunctions")
|
||||
33
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-uggrid.cmake
vendored
Normal file
33
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Finddune-uggrid.cmake
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
include (OpmPackage)
|
||||
|
||||
find_opm_package (
|
||||
# module name
|
||||
"dune-uggrid"
|
||||
|
||||
# dependencies
|
||||
# TODO: we should probe for all the HAVE_* values listed below;
|
||||
# however, we don't actually use them in our implementation, so
|
||||
"dune-common REQUIRED
|
||||
"
|
||||
# header to search for
|
||||
""
|
||||
|
||||
# library to search for
|
||||
"duneuggrid"
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
""
|
||||
# config variable
|
||||
"")
|
||||
|
||||
#debug_find_vars ("dune-uggrid")
|
||||
|
||||
# make version number available in config.h
|
||||
include (UseDuneVer)
|
||||
find_dune_version ("dune" "uggrid")
|
||||
|
||||
# deactivate search for UG
|
||||
set(UG_FOUND ${dune-uggrid_FOUND})
|
||||
51
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findlibrt.cmake
vendored
Normal file
51
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findlibrt.cmake
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# Module that makes the clock_gettime() function available
|
||||
#
|
||||
# Sets the following variables:
|
||||
# HAVE_LIBRT
|
||||
# LIBRT_LIBRARIES
|
||||
#
|
||||
# perform tests
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
# first check if we need to add anything at all to be able to use
|
||||
# clock_gettime()
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <time.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
timespec time1;
|
||||
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1);
|
||||
};
|
||||
" HAVE_LIBRT)
|
||||
cmake_pop_check_state()
|
||||
|
||||
if (HAVE_LIBRT)
|
||||
# if this worked, we're already happy
|
||||
set(LIBRT_LIBRARIES "")
|
||||
else()
|
||||
# if not, let's try the same program with linking to librt (required
|
||||
# on some systems)
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "rt")
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <time.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
timespec time1;
|
||||
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1);
|
||||
};
|
||||
" HAVE_LIBRT2)
|
||||
cmake_pop_check_state()
|
||||
set(HAVE_LIBRT "${HAVE_LIBRT2}")
|
||||
if (HAVE_LIBRT)
|
||||
set(LIBRT_LIBRARIES "rt")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibRT
|
||||
DEFAULT_MSG
|
||||
HAVE_LIBRT
|
||||
)
|
||||
48
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findopm-flowdiagnostics.cmake
vendored
Normal file
48
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findopm-flowdiagnostics.cmake
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
# - Find OPM Flow Diagnostics Library
|
||||
#
|
||||
# Defines the following variables:
|
||||
# opm-flowdiagnostics_INCLUDE_DIRS Directory of header files
|
||||
# opm-flowdiagnostics_LIBRARIES Directory of shared object files
|
||||
# opm-flowdiagnostics_DEFINITIONS Defines that must be set to compile
|
||||
# opm-flowdiagnostics_CONFIG_VARS List of defines that should be in config.h
|
||||
# HAVE_OPM_FLOWDIAGNOSTICS 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-flowdiagnostics-prereqs)
|
||||
|
||||
include (OpmPackage)
|
||||
|
||||
find_opm_package (
|
||||
# module name
|
||||
"opm-flowdiagnostics"
|
||||
|
||||
# dependencies
|
||||
"${opm-flowdiagnostics_DEPS}"
|
||||
|
||||
# header to search for
|
||||
"opm/flowdiagnostics/Toolbox.hpp"
|
||||
|
||||
# library to search for
|
||||
"opmflowdiagnostics"
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
"#include <opm/flowdiagnostics/Toolbox.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
int main()
|
||||
{
|
||||
using FDT = Opm::FlowDiagnostics::Toolbox;
|
||||
|
||||
const auto pv = std::vector<double>(10, 0.3);
|
||||
}
|
||||
"
|
||||
# config variables
|
||||
"${opm-flowdiagnostics_CONFIG_VAR}"
|
||||
)
|
||||
27
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findopm-tests.cmake
vendored
Normal file
27
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findopm-tests.cmake
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
# This module searches for the opm-tests repository. Since opm-tests
|
||||
# has no libraries or header files the find implementation is quite
|
||||
# naive.
|
||||
#
|
||||
# If the opm-tests repository is found, the following variables are set:
|
||||
#
|
||||
# HAVE_OPM_TESTS
|
||||
# OPM_TESTS_ROOT
|
||||
|
||||
if (OPM_TESTS_ROOT)
|
||||
set( _opm_tests_root ${OPM_TESTS_ROOT})
|
||||
else()
|
||||
set( _opm_tests_root "${PROJECT_SOURCE_DIR}/../opm-tests")
|
||||
endif()
|
||||
|
||||
|
||||
if (EXISTS "${_opm_tests_root}/norne/NORNE_ATW2013.DATA")
|
||||
set( HAVE_OPM_DATA True )
|
||||
set( HAVE_OPM_TESTS True )
|
||||
set( OPM_TESTS_ROOT ${_opm_tests_root} )
|
||||
set( OPM_DATA_ROOT ${_opm_tests_root} )
|
||||
message(STATUS "Setting OPM_TESTS_ROOT: ${OPM_TESTS_ROOT}")
|
||||
else()
|
||||
set( HAVE_OPM_TESTS False )
|
||||
set( HAVE_OPM_DATA False )
|
||||
message(WARNING "opm-tests not found - integration tests using opm-tests will be skipped.")
|
||||
endif()
|
||||
41
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findopm-upscaling.cmake
vendored
Normal file
41
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findopm-upscaling.cmake
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# - Find OPM upscaling grid library
|
||||
#
|
||||
# Defines the following variables:
|
||||
# opm-upscaling_INCLUDE_DIRS Directory of header files
|
||||
# opm-upscaling_LIBRARIES Directory of shared object files
|
||||
# opm-upscaling_DEFINITIONS Defines that must be set to compile
|
||||
# opm-upscaling_CONFIG_VARS List of defines that should be in config.h
|
||||
# HAVE_OPM_UPSCALING Binary value to use in config.h
|
||||
|
||||
# Copyright (C) 2013 Uni Research AS
|
||||
# This code is licensed under The GNU General Public License v3.0
|
||||
|
||||
include (opm-upscaling-prereqs)
|
||||
include (OpmPackage)
|
||||
find_opm_package (
|
||||
# module name
|
||||
"opm-upscaling"
|
||||
|
||||
# dependencies
|
||||
"${opm-upscaling_DEPS}"
|
||||
|
||||
# header to search for
|
||||
"opm/upscaling/SinglePhaseUpscaler.hpp"
|
||||
|
||||
# library to search for
|
||||
"opmupscaling"
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
"#include <opm/upscaling/SinglePhaseUpscaler.hpp>
|
||||
int main (void) {
|
||||
return 0;
|
||||
}
|
||||
"
|
||||
# config variables
|
||||
"${opm-upscaling_CONFIG_VAR}"
|
||||
)
|
||||
|
||||
#debug_find_vars ("opm-upscaling")
|
||||
41
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findopm-verteq.cmake
vendored
Normal file
41
ThirdParty/custom-opm-common/opm-common/cmake/Modules/Findopm-verteq.cmake
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# - Find OPM vertical equilibrium library
|
||||
#
|
||||
# Defines the following variables:
|
||||
# opm-verteq_INCLUDE_DIRS Directory of header files
|
||||
# opm-verteq_LIBRARIES Directory of shared object files
|
||||
# opm-verteq_DEFINITIONS Defines that must be set to compile
|
||||
# opm-verteq_CONFIG_VARS List of defines that should be in config.h
|
||||
# HAVE_OPM_VERTEQ Binary value to use in config.h
|
||||
|
||||
# Copyright (C) 2013 Uni Research AS
|
||||
# This code is licensed under The GNU General Public License v3.0
|
||||
|
||||
# use the generic find routine
|
||||
include (opm-verteq-prereqs)
|
||||
include (OpmPackage)
|
||||
find_opm_package (
|
||||
# module name
|
||||
"opm-verteq"
|
||||
|
||||
# dependencies
|
||||
"${opm-verteq_DEPS}"
|
||||
|
||||
# header to search for
|
||||
"opm/verteq/verteq.hpp"
|
||||
|
||||
# library to search for
|
||||
"opmverteq"
|
||||
|
||||
# defines to be added to compilations
|
||||
""
|
||||
|
||||
# test program
|
||||
"#include <opm/verteq/verteq.hpp>
|
||||
int main (void) {
|
||||
return 0;
|
||||
}
|
||||
"
|
||||
# config variables
|
||||
"")
|
||||
include (UseDynamicBoost)
|
||||
#debug_find_vars ("opm-verteq")
|
||||
169
ThirdParty/custom-opm-common/opm-common/cmake/Modules/LibtoolArchives.cmake
vendored
Normal file
169
ThirdParty/custom-opm-common/opm-common/cmake/Modules/LibtoolArchives.cmake
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
# translate a list of libraries into a command-line that can be passed to the
|
||||
# compiler/linker. first parameter is the name of the variable that will
|
||||
# receive this list, the rest is considered the list of libraries
|
||||
function (linker_cmdline what INTO outvar FROM)
|
||||
if (NOT (UNIX OR MSYS OR MINGW))
|
||||
return ()
|
||||
endif (NOT (UNIX OR MSYS OR MINGW))
|
||||
|
||||
# if we are going to put these in regexps, we must escape period
|
||||
string (REPLACE "." "\\." esc_dl_pref "${CMAKE_SHARED_LIBRARY_PREFIX}")
|
||||
string (REPLACE "." "\\." esc_dl_suff "${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
string (REPLACE "." "\\." esc_ar_pref "${CMAKE_STATIC_LIBRARY_PREFIX}")
|
||||
string (REPLACE "." "\\." esc_ar_suff "${CMAKE_STATIC_LIBRARY_PREFIX}")
|
||||
|
||||
# CMake loves absolute paths, whereas libtool won't have any of it!
|
||||
# (you get an error message about argument not parsed). translate each
|
||||
# of the libraries into a linker option
|
||||
set (deplib_list "")
|
||||
foreach (deplib IN LISTS ARGN)
|
||||
# starts with a hyphen already? then just add it
|
||||
string (SUBSTRING ${deplib} 0 1 dash)
|
||||
if (${dash} STREQUAL "-")
|
||||
list (APPEND deplib_list ${deplib})
|
||||
else (${dash} STREQUAL "-")
|
||||
# otherwise, parse the name into a directory and a name
|
||||
get_filename_component (deplib_dir ${deplib} PATH)
|
||||
get_filename_component (deplib_orig ${deplib} NAME)
|
||||
string (REGEX REPLACE
|
||||
"^${esc_dl_pref}(.*)${esc_dl_suff}$"
|
||||
"\\1"
|
||||
deplib_name
|
||||
${deplib_orig}
|
||||
)
|
||||
string (REGEX REPLACE
|
||||
"^${esc_ar_pref}(.*)${esc_ar_suff}$"
|
||||
"\\1"
|
||||
deplib_name
|
||||
${deplib_name}
|
||||
)
|
||||
# directory and name each on their own; this is somewhat
|
||||
# unsatisfactory because it may be that a system dir is specified
|
||||
# by an earlier directory and you start picking up libraries from
|
||||
# there instead of the "closest" path here. also, the soversion
|
||||
# is more or less lost. remove system default path, to lessen the
|
||||
# chance that we pick the wrong library
|
||||
if (NOT ((deplib_dir STREQUAL "/usr/lib") OR
|
||||
(deplib_dir STREQUAL "/usr/${CMAKE_INSTALL_LIBDIR}")))
|
||||
list (APPEND deplib_list "-L${deplib_dir}")
|
||||
endif (NOT ((deplib_dir STREQUAL "/usr/lib") OR
|
||||
(deplib_dir STREQUAL "/usr/${CMAKE_INSTALL_LIBDIR}")))
|
||||
# if there was no translation of the name, the library is named
|
||||
# unconventionally (.so.3gf, I'm looking at you), so pass this
|
||||
# name unmodified to the linker switch
|
||||
if (deplib_orig STREQUAL deplib_name)
|
||||
list (APPEND deplib_list "-l:${deplib_orig}")
|
||||
else (deplib_orig STREQUAL deplib_name)
|
||||
list (APPEND deplib_list "-l${deplib_name}")
|
||||
endif (deplib_orig STREQUAL deplib_name)
|
||||
endif (${dash} STREQUAL "-")
|
||||
endforeach (deplib)
|
||||
# caller determines whether we want it returned as a list or a string
|
||||
if ("${what}" STREQUAL "LIST")
|
||||
set (${outvar} ${deplib_list})
|
||||
else ("${what}" STREQUAL "LIST")
|
||||
set (${outvar} "${deplib_list}")
|
||||
string (REPLACE ";" " " ${outvar} "${${outvar}}")
|
||||
endif ("${what}" STREQUAL "LIST")
|
||||
set (${outvar} "${${outvar}}" PARENT_SCOPE)
|
||||
endfunction (linker_cmdline what INTO outvar FROM)
|
||||
|
||||
function (configure_la name target)
|
||||
if (NOT (UNIX OR MSYS OR MINGW))
|
||||
return ()
|
||||
endif (NOT (UNIX OR MSYS OR MINGW))
|
||||
|
||||
# these generic variables are initialized from the project info
|
||||
set (current "${${name}_VERSION_MAJOR}")
|
||||
set (age "${${name}_VERSION_MINOR}")
|
||||
set (inherited_linker_flags "${${name}_LINKER_FLAGS}")
|
||||
set (dependency_libs "${${name}_LIBRARIES}")
|
||||
|
||||
# translate list of libraries to command line
|
||||
linker_cmdline (LIST INTO dependency_libs FROM ${dependency_libs})
|
||||
|
||||
# convert from CMake list (i.e. semi-colon separated)
|
||||
string (REPLACE ";" " " inherited_linker_flags "${inherited_linker_flags}")
|
||||
string (REPLACE ";" " " dependency_libs "${dependency_libs}")
|
||||
|
||||
# this is the preferred installation path
|
||||
set (libdir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
# ${name}_LIBRARY_TYPE is either SHARED or STATIC
|
||||
if (${name}_LIBRARY_TYPE STREQUAL "SHARED")
|
||||
set (libprefix "${CMAKE_SHARED_LIBRARY_PREFIX}")
|
||||
set (libsuffix "${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
set (libname "${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
# only Unix has soversion in library names
|
||||
if (UNIX)
|
||||
set (dlname "${libname}.${current}")
|
||||
set (library_names "${libname}.${current}.${age} ${libname}.${current} ${libname}")
|
||||
else (UNIX)
|
||||
set (dlname "${libname}")
|
||||
set (library_names "${libname}")
|
||||
endif (UNIX)
|
||||
set (old_library "")
|
||||
else (${name}_LIBRARY_TYPE STREQUAL "SHARED")
|
||||
set (dlname "")
|
||||
set (library_names "")
|
||||
set (old_library "${CMAKE_STATIC_LIBRARY_PREFIX}${target}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif (${name}_LIBRARY_TYPE STREQUAL "SHARED")
|
||||
|
||||
# get the version of libtool installed on the system; this is
|
||||
# necessary because libtool checks that the file contains its own
|
||||
# signature(!)
|
||||
if (NOT libtool_MAIN)
|
||||
find_file (
|
||||
libtool_MAIN
|
||||
ltmain.sh
|
||||
PATHS /usr
|
||||
PATH_SUFFIXES share/libtool/config/
|
||||
DOC "Location of libtool"
|
||||
)
|
||||
mark_as_advanced (libtool_MAIN)
|
||||
# notify the user if it not found after we explicitly searched
|
||||
if (NOT libtool_MAIN)
|
||||
message (STATUS "Not generating libtool archive (.la) since libtool was not found")
|
||||
endif (NOT libtool_MAIN)
|
||||
endif (NOT libtool_MAIN)
|
||||
if (libtool_MAIN)
|
||||
file (STRINGS
|
||||
${libtool_MAIN}
|
||||
ltversion_STRING
|
||||
REGEX "^VERSION=\".*\""
|
||||
)
|
||||
endif (libtool_MAIN)
|
||||
if (ltversion_STRING)
|
||||
string (REGEX REPLACE
|
||||
"^VERSION=\"?(.*)\"?"
|
||||
"\\1"
|
||||
ltversion
|
||||
${ltversion_STRING}
|
||||
)
|
||||
endif (ltversion_STRING)
|
||||
|
||||
# assume that we are in cmake/Modules, and that the template have been
|
||||
# put in cmake/Templates. we cannot use CMAKE_CURRENT_LIST_DIR because
|
||||
# this is in a function, and we cannot know who's calling us
|
||||
set (templ_dir "${OPM_MACROS_ROOT}/cmake/Templates")
|
||||
|
||||
|
||||
# only write an .la if libtool is found; otherwise we have no use
|
||||
# for it.
|
||||
if (ltversion)
|
||||
set (la_file "lib${target}.la")
|
||||
message (STATUS "Writing libtool archive for ${target}")
|
||||
configure_file (
|
||||
${templ_dir}/la.in
|
||||
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${la_file}
|
||||
@ONLY@
|
||||
)
|
||||
else (ltversion)
|
||||
set (la_file "")
|
||||
endif (ltversion)
|
||||
|
||||
# return this variable to the caller
|
||||
if (ARGV2)
|
||||
set (${ARGV2} "${la_file}" PARENT_SCOPE)
|
||||
endif (ARGV2)
|
||||
endfunction (configure_la target)
|
||||
27
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmAliases.cmake
vendored
Normal file
27
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmAliases.cmake
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
# - Alias probed variables for compatibility with DUNE buildsystem
|
||||
#
|
||||
# DUNE build system sets some variables which have different names
|
||||
# in the CMake modules we are using; this module set those variable
|
||||
# so they can be exported to config.h visible to DUNE headers
|
||||
|
||||
function (set_aliases)
|
||||
# hardcoded list of "dune-var opm-var" pairs, where the components
|
||||
# are separated by space
|
||||
set (aliases
|
||||
"HAVE_UMFPACK HAVE_SUITESPARSE_UMFPACK_H"
|
||||
"HAVE_SUITESPARSE_UMFPACK HAVE_SUITESPARSE_UMFPACK_H"
|
||||
"HAVE_DUNE_BOOST HAVE_BOOST"
|
||||
)
|
||||
foreach (alias IN LISTS aliases)
|
||||
# convert entry "X Y" into a list "X;Y", then pick apart
|
||||
string (REGEX REPLACE "\ +" ";" tuple "${alias}")
|
||||
list (GET tuple 0 var)
|
||||
list (GET tuple 1 name)
|
||||
|
||||
# write this alias to cache
|
||||
set (${var} ${${name}} PARENT_SCOPE)
|
||||
endforeach (alias)
|
||||
endfunction (set_aliases)
|
||||
|
||||
# always call this when the module is imported
|
||||
set_aliases ()
|
||||
6
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmBashCompletion.cmake
vendored
Normal file
6
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmBashCompletion.cmake
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# Installs bash tab completion for a product
|
||||
macro(opm_add_bash_completion binary)
|
||||
set(PRODUCT ${binary})
|
||||
configure_file(${OPM_MACROS_ROOT}/etc/opm_bash_completion.sh.in ${binary}_bash_completion.sh @ONLY)
|
||||
install(FILES ${PROJECT_BINARY_DIR}/${binary}_bash_completion.sh DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/bash_completion.d)
|
||||
endmacro()
|
||||
97
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmCompile.cmake
vendored
Normal file
97
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmCompile.cmake
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
# - Compile main library target
|
||||
|
||||
option (STRIP_DEBUGGING_SYMBOLS "use separate files for the executable code and the debugging symbols" OFF)
|
||||
|
||||
macro (opm_compile opm)
|
||||
# some CMake properties do not do list expansion
|
||||
string (REPLACE ";" " " ${opm}_LINKER_FLAGS_STR "${${opm}_LINKER_FLAGS}")
|
||||
|
||||
# name of the library should not contain dashes, as CMake will
|
||||
# define a symbol with that name, and those cannot contain dashes
|
||||
string (REPLACE "-" "" ${opm}_TARGET "${${opm}_NAME}")
|
||||
|
||||
# all public header files are together with the source. prepend our own
|
||||
# source path to the one of the dependencies so that our version of any
|
||||
# ambigious paths are used.
|
||||
|
||||
option(SILENCE_CROSSMODULE_WARNINGS "Disable warnings from cross-module includes" OFF)
|
||||
if (SILENCE_CROSSMODULE_WARNINGS)
|
||||
include_directories("${PROJECT_SOURCE_DIR}")
|
||||
include_directories (SYSTEM ${${opm}_INCLUDE_DIRS})
|
||||
set (${opm}_INCLUDE_DIR "${PROJECT_SOURCE_DIR}")
|
||||
set (${opm}_INCLUDE_DIRS ${${opm}_INCLUDE_DIR} ${${opm}_INCLUDE_DIRS})
|
||||
else()
|
||||
set (${opm}_INCLUDE_DIR "${PROJECT_SOURCE_DIR}")
|
||||
set (${opm}_INCLUDE_DIRS ${${opm}_INCLUDE_DIR} ${${opm}_INCLUDE_DIRS})
|
||||
include_directories (${${opm}_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
|
||||
# create this library, if there are any compilation units
|
||||
link_directories (${${opm}_LIBRARY_DIRS})
|
||||
add_definitions (${${opm}_DEFINITIONS})
|
||||
set (${opm}_VERSION "${${opm}_VERSION_MAJOR}.${${opm}_VERSION_MINOR}")
|
||||
if (${opm}_SOURCES)
|
||||
add_library (${${opm}_TARGET} ${${opm}_LIBRARY_TYPE} ${${opm}_SOURCES})
|
||||
set_target_properties (${${opm}_TARGET} PROPERTIES
|
||||
SOVERSION ${${opm}_VERSION_MAJOR}
|
||||
VERSION ${${opm}_VERSION}
|
||||
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}"
|
||||
POSITION_INDEPENDENT_CODE TRUE
|
||||
)
|
||||
if (${${opm}_LIBRARY_TYPE} STREQUAL "SHARED")
|
||||
# libs that will be linked with the main lib
|
||||
string(REGEX REPLACE "([;^])[^;]+\\.a[;$]" "\\1" _public_libs
|
||||
"${${opm}_LIBRARIES}")
|
||||
# libs that will not actually linked to the library but
|
||||
# transitively linked to binaries that link to the main library
|
||||
string(REGEX REPLACE "([^;]+\\.[^a][a-zA-Z0-9]*|-[a-z]*)[;$]" "" _interface_libs
|
||||
"${${opm}_LIBRARIES}")
|
||||
else()
|
||||
# Use all libs for real and transitive linking
|
||||
set(_public_libs ${${opm}_LIBRARIES})
|
||||
unset(_interface)
|
||||
endif()
|
||||
target_link_libraries (${${opm}_TARGET} PUBLIC ${_public_libs}
|
||||
INTERFACE ${_interface_libs})
|
||||
|
||||
if (STRIP_DEBUGGING_SYMBOLS)
|
||||
# queue this executable to be stripped
|
||||
strip_debug_symbols (${${opm}_TARGET} ${opm}_DEBUG)
|
||||
endif()
|
||||
add_static_analysis_tests(${opm}_SOURCES ${opm}_INCLUDE_DIRS)
|
||||
else (${opm}_SOURCES)
|
||||
# unset this variable to signal that no library is generated
|
||||
set (${opm}_TARGET)
|
||||
endif (${opm}_SOURCES)
|
||||
|
||||
# pre-compile common headers; this is setup *after* the library to pick
|
||||
# up extra options set there
|
||||
if (PRECOMPILE_HEADERS)
|
||||
# if we have no library, then use the static setting as this will
|
||||
# build the same way as any test programs (no -fPIC option)
|
||||
if (${opm}_TARGET)
|
||||
get_target_property (_type ${${opm}_TARGET} TYPE)
|
||||
else ()
|
||||
set (_type "STATIC")
|
||||
endif ()
|
||||
precompile_header (CXX ${_type}
|
||||
HEADER "${${opm}_PRECOMP_CXX_HEADER}"
|
||||
TARGET ${opm}_CXX_pch
|
||||
FLAGS ${opm}_PRECOMP_CXX_FLAGS
|
||||
)
|
||||
# must set property on source files instead of entire target, because
|
||||
# it only applies to C++ modules (and cannot be used for C)
|
||||
set_source_files_properties (${${opm}_CXX_SOURCES} PROPERTIES
|
||||
OBJECT_DEPENDS "${${opm}_CXX_pch}"
|
||||
COMPILE_FLAGS "${${opm}_PRECOMP_CXX_FLAGS}"
|
||||
)
|
||||
message (STATUS "Precompiled headers: ${${opm}_CXX_pch}")
|
||||
endif (PRECOMPILE_HEADERS)
|
||||
|
||||
# we need to know the name of the library which is generated
|
||||
if (${opm}_TARGET)
|
||||
get_target_property (${opm}_LIBRARY ${${opm}_TARGET} LOCATION)
|
||||
endif (${opm}_TARGET)
|
||||
|
||||
endmacro (opm_compile opm)
|
||||
104
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmCompilerChecks.cmake
vendored
Normal file
104
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmCompilerChecks.cmake
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
# Check for various compiler extensions
|
||||
|
||||
# HAVE_ATTRIBUTE_ALWAYS_INLINE True if attribute always inline is supported
|
||||
# HAS_ATTRIBUTE_UNUSED True if attribute unused is supported
|
||||
# HAS_ATTRIBUTE_DEPRECATED True if attribute deprecated is supported
|
||||
# HAS_ATTRIBUTE_DEPRECATED_MSG True if attribute deprecated("msg") is supported
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
# __attribute__((always_inline))
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
void __attribute__((always_inline)) foo(void) {}
|
||||
int main(void)
|
||||
{
|
||||
foo();
|
||||
return 0;
|
||||
};
|
||||
" HAVE_ATTRIBUTE_ALWAYS_INLINE
|
||||
)
|
||||
|
||||
# __attribute__((unused))
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
int main(void)
|
||||
{
|
||||
int __attribute__((unused)) foo;
|
||||
return 0;
|
||||
};
|
||||
" HAS_ATTRIBUTE_UNUSED
|
||||
)
|
||||
|
||||
# __attribute__((deprecated))
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#define DEP __attribute__((deprecated))
|
||||
class bar
|
||||
{
|
||||
bar() DEP;
|
||||
};
|
||||
|
||||
class peng { } DEP;
|
||||
|
||||
template <class T>
|
||||
class t_bar
|
||||
{
|
||||
t_bar() DEP;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class t_peng {
|
||||
t_peng() {};
|
||||
} DEP;
|
||||
|
||||
void foo() DEP;
|
||||
|
||||
void foo() {};
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
" HAS_ATTRIBUTE_DEPRECATED
|
||||
)
|
||||
|
||||
# __attribute__((deprecated("msg")))
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#define DEP __attribute__((deprecated(\"message\")))
|
||||
class bar {
|
||||
bar() DEP;
|
||||
};
|
||||
|
||||
class peng { } DEP;
|
||||
|
||||
template <class T>
|
||||
class t_bar
|
||||
{
|
||||
t_bar() DEP;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class t_peng
|
||||
{
|
||||
t_peng() {};
|
||||
} DEP;
|
||||
|
||||
void foo() DEP;
|
||||
|
||||
void foo() {};
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
" HAS_ATTRIBUTE_DEPRECATED_MSG
|
||||
)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
|
||||
list(APPEND ${project}_LIBRARIES stdc++fs)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(OPM_CLANG_WITH_STDC++FS "Using libstdc++ with clang and we want to link to stdc++fs" OFF)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND OPM_CLANG_WITH_STDC++FS)
|
||||
list(APPEND ${project}_LIBRARIES stdc++fs)
|
||||
endif()
|
||||
101
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmDefaults.cmake
vendored
Normal file
101
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmDefaults.cmake
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
# - Default settings for the build
|
||||
|
||||
include (UseCompVer)
|
||||
is_compiler_gcc_compatible ()
|
||||
include(TestCXXAcceptsFlag)
|
||||
|
||||
macro (opm_defaults opm)
|
||||
|
||||
message("Processing opm_defaults ${opm}")
|
||||
# if we are installing a development version (default when checking out of
|
||||
# VCS), then remember which directories were used when configuring. package
|
||||
# distribution should disable this option.
|
||||
option (USE_RUNPATH "Embed original dependency paths in installed library" ON)
|
||||
if (USE_RUNPATH)
|
||||
if (CXX_COMPAT_GCC)
|
||||
check_cxx_accepts_flag ("-Wl,--enable-new-dtags" HAVE_RUNPATH)
|
||||
if (HAVE_RUNPATH)
|
||||
list (APPEND ${opm}_LINKER_FLAGS "-Wl,--enable-new-dtags")
|
||||
endif (HAVE_RUNPATH)
|
||||
endif ()
|
||||
# set this to avoid CMake stripping it off again
|
||||
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
endif (USE_RUNPATH)
|
||||
|
||||
# build release by default
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||
set (CMAKE_BUILD_TYPE "Release")
|
||||
endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
# default to building a static library, but let user override
|
||||
if (DEFINED BUILD_SHARED_LIBS)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set (${opm}_LIBRARY_TYPE SHARED)
|
||||
else (BUILD_SHARED_LIBS)
|
||||
set (${opm}_LIBRARY_TYPE STATIC)
|
||||
endif (BUILD_SHARED_LIBS)
|
||||
else (DEFINED BUILD_SHARED_LIBS)
|
||||
set (${opm}_LIBRARY_TYPE STATIC)
|
||||
endif (DEFINED BUILD_SHARED_LIBS)
|
||||
|
||||
# precompile standard headers to speed up compilation
|
||||
# unfortunately, this functionality is buggy and tends to segfault at
|
||||
# least up to version 4.7.2, so it should be disabled by default there
|
||||
set (_precomp_def OFF)
|
||||
option (PRECOMPILE_HEADERS "Precompile common headers for speed." ${_precomp_def})
|
||||
mark_as_advanced (PRECOMPILE_HEADERS)
|
||||
if (NOT PRECOMPILE_HEADERS)
|
||||
message (STATUS "Precompiled headers: disabled")
|
||||
endif(NOT PRECOMPILE_HEADERS)
|
||||
|
||||
# Use of OpenMP is considered experimental
|
||||
set (USE_OPENMP_DEFAULT ON)
|
||||
|
||||
# if we are on a system where CMake 2.6 is the default (Hi RHEL 6!),
|
||||
# the configuration files for Boost will trip up the library paths
|
||||
# (look for /usr/lib64/lib64/ in the log) when used with FindBoost
|
||||
# module bundled with CMake 2.8. this can be circumvented by turning
|
||||
# off config mode probing if we have not explicitly specified a
|
||||
# directory to look for it. for more details, see
|
||||
# <http://stackoverflow.com/questions/9948375/cmake-find-package-succeeds-but-returns-wrong-path>
|
||||
if (NOT BOOST_ROOT)
|
||||
set (Boost_NO_BOOST_CMAKE ON)
|
||||
endif (NOT BOOST_ROOT)
|
||||
endmacro (opm_defaults opm)
|
||||
|
||||
# overwrite a cache entry's value, but keep docstring and type
|
||||
# if not already in cache, then does nothing
|
||||
function (update_cache name)
|
||||
get_property (_help CACHE "${name}" PROPERTY HELPSTRING)
|
||||
get_property (_type CACHE "${name}" PROPERTY TYPE)
|
||||
if (NOT "${_type}" STREQUAL "")
|
||||
#message ("Setting ${name} to \"${${name}}\" in cache.")
|
||||
set ("${name}" "${${name}}" CACHE ${_type} "${_help}" FORCE)
|
||||
endif ()
|
||||
endfunction (update_cache name)
|
||||
|
||||
# put all compiler options currently set back into the cache, so that
|
||||
# they can be queried from there (using ccmake for instance)
|
||||
function (write_back_options)
|
||||
# build type
|
||||
update_cache (CMAKE_BUILD_TYPE)
|
||||
|
||||
# compilers
|
||||
set (languages C CXX Fortran)
|
||||
foreach (language IN LISTS _languages)
|
||||
if (CMAKE_${language}_COMPILER)
|
||||
update_cache (CMAKE_${language}_COMPILER)
|
||||
endif ()
|
||||
endforeach (language)
|
||||
|
||||
# flags (notice use of IN LISTS to get the empty variant)
|
||||
set (buildtypes "" "_DEBUG" "_RELEASE" "_MINSIZEREL" "_RELWITHDEBINFO")
|
||||
set (processors "C" "CXX" "Fortran" "EXE_LINKER" "MODULE_LINKER" "SHARED_LINKER")
|
||||
foreach (processor IN LISTS processors)
|
||||
foreach (buildtype IN LISTS buildtypes)
|
||||
if (CMAKE_${processor}_FLAGS${buildtype})
|
||||
update_cache (CMAKE_${processor}_FLAGS${buildtype})
|
||||
endif ()
|
||||
endforeach (buildtype)
|
||||
endforeach (processor)
|
||||
endfunction (write_back_options)
|
||||
89
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmDistClean.cmake
vendored
Normal file
89
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmDistClean.cmake
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
# - Cleanup configuration files
|
||||
#
|
||||
# Remove files generated by the configuration (not by the build); the
|
||||
# purpose is to get back a clean directory with no build artifacts
|
||||
# (some empty directories may be left behind, though)
|
||||
#
|
||||
# The following suffices are supported:
|
||||
# _NAME Name of the project
|
||||
# _STYLESHEET_COPIED Stylesheet that was copied for the documentation
|
||||
# _LIBTOOL_ARCHIVE Libtool archive file generated for library
|
||||
# _DEBUG Debug information extracted from library
|
||||
|
||||
macro (opm_dist_clean opm)
|
||||
# which generator have we been using
|
||||
string (TOUPPER "${CMAKE_GENERATOR}" _gen)
|
||||
if (_gen MATCHES "UNIX MAKEFILES")
|
||||
set (_gen_is_makefiles TRUE)
|
||||
set (_gen_is_ninja FALSE)
|
||||
elseif (_gen MATCHES "NINJA")
|
||||
set (_gen_is_makefiles FALSE)
|
||||
set (_gen_is_ninja TRUE)
|
||||
else ()
|
||||
set (_gen_is_makefiles FALSE)
|
||||
set (_gen_is_ninja FALSE)
|
||||
endif ()
|
||||
|
||||
set (DISTCLEAN_FILES
|
||||
CMakeCache.txt
|
||||
cmake_install.cmake
|
||||
config.h
|
||||
config.h.tmp
|
||||
${${opm}_NAME}-config.cmake
|
||||
${${opm}_NAME}-config-version.cmake
|
||||
${${opm}_NAME}-install.cmake
|
||||
${${opm}_NAME}.pc
|
||||
${${opm}_NAME}-install.pc
|
||||
${doxy_dir}/Doxyfile
|
||||
${doxy_dir}/Doxyfile.in
|
||||
CTestTestfile.cmake
|
||||
DartConfiguration.tcl
|
||||
lib/${${opm}_LIBTOOL_ARCHIVE}
|
||||
${${opm}_DEBUG}
|
||||
${tests_DEBUG}
|
||||
${examples_DEBUG}
|
||||
${tutorial_DEBUG}
|
||||
install_manifest.txt
|
||||
${${opm}_STYLESHEET_COPIED}
|
||||
${tests_INPUT_FILES}
|
||||
project-version.h
|
||||
project-version.tmp
|
||||
)
|
||||
if (_gen_is_makefiles)
|
||||
list (APPEND DISTCLEAN_FILES
|
||||
Makefile)
|
||||
endif ()
|
||||
if (_gen_is_ninja)
|
||||
list (APPEND DISTCLEAN_FILES
|
||||
build.ninja
|
||||
rules.ninja
|
||||
)
|
||||
endif ()
|
||||
|
||||
# only remove these files if they were actually copied
|
||||
if (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||
list (APPEND DISTCLEAN_FILES
|
||||
dune.module
|
||||
dunemod.tmp
|
||||
)
|
||||
endif (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||
# script to remove empty directories (can't believe this isn't included!)
|
||||
set (rmdir "${OPM_MACROS_ROOT}/cmake/Scripts/RemoveEmptyDir.cmake")
|
||||
add_custom_target (distclean
|
||||
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} -- clean
|
||||
COMMAND ${CMAKE_COMMAND} -E remove -f ${DISTCLEAN_FILES}
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory CMakeFiles/
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory Testing/
|
||||
COMMAND ${CMAKE_COMMAND} -DDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -P ${rmdir}
|
||||
COMMAND ${CMAKE_COMMAND} -DDIR=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -P ${rmdir}
|
||||
COMMAND ${CMAKE_COMMAND} -DDIR:LOCATION=${doxy_dir} -P ${rmdir}
|
||||
COMMAND ${CMAKE_COMMAND} -DDIR:LOCATION=${tests_DIR} -P ${rmdir}
|
||||
# cannot depend on clean because it is only defined in the master Makefile
|
||||
# not in CMakeFiles/Makefile where this target will end up
|
||||
# DEPENDS clean
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMENT Removing CMake-generated files
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
endmacro (opm_dist_clean opm)
|
||||
91
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmDoc.cmake
vendored
Normal file
91
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmDoc.cmake
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
# - Setup documentation
|
||||
#
|
||||
# Assumes that a Doxyfile template is located in the project root
|
||||
# directory, and that all documentation is going to be generated
|
||||
# into its own Documentation/ directory. It will also generate an
|
||||
# installation target for the documentation (not built by default)
|
||||
#
|
||||
# Requires the following variables to be set:
|
||||
# ${opm}_NAME Name of the project
|
||||
#
|
||||
# Output the following variables:
|
||||
# ${opm}_STYLESHEET_COPIED Location of stylesheet to be removed in distclean
|
||||
|
||||
macro (opm_doc opm doxy_dir)
|
||||
# combine the template with local customization
|
||||
file (READ ${OPM_MACROS_ROOT}/cmake/Templates/Doxyfile _doxy_templ)
|
||||
string (REPLACE ";" "\\;" _doxy_templ "${_doxy_templ}")
|
||||
if (EXISTS ${PROJECT_SOURCE_DIR}/${doxy_dir}/Doxylocal)
|
||||
file (READ ${PROJECT_SOURCE_DIR}/${doxy_dir}/Doxylocal _doxy_local)
|
||||
string (REPLACE ";" "\\;" _doxy_local "${_doxy_local}")
|
||||
else (EXISTS ${PROJECT_SOURCE_DIR}/${doxy_dir}/Doxylocal)
|
||||
set (_doxy_local)
|
||||
endif (EXISTS ${PROJECT_SOURCE_DIR}/${doxy_dir}/Doxylocal)
|
||||
file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/${doxy_dir})
|
||||
file (WRITE ${PROJECT_BINARY_DIR}/${doxy_dir}/Doxyfile.in ${_doxy_templ} ${_doxy_local})
|
||||
# set this generically named variable so even the custom file can be shared
|
||||
set (src_DIR "${${opm}_DIR}")
|
||||
|
||||
# copy the doxygen layout XML file to the build directorie's doxygen
|
||||
# directory. if the source module ships with such a file it takes
|
||||
# precedence over the one shipped with the build system.
|
||||
if (EXISTS ${PROJECT_SOURCE_DIR}/${doxy_dir}/DoxygenLayout.xml)
|
||||
file(COPY ${PROJECT_SOURCE_DIR}/${doxy_dir}/DoxygenLayout.xml DESTINATION ${PROJECT_BINARY_DIR}/${doxy_dir})
|
||||
else()
|
||||
file(COPY ${OPM_MACROS_ROOT}/cmake/Templates/DoxygenLayout.xml DESTINATION ${PROJECT_BINARY_DIR}/${doxy_dir})
|
||||
endif()
|
||||
|
||||
# replace variables in this combined file
|
||||
configure_file (
|
||||
${PROJECT_BINARY_DIR}/${doxy_dir}/Doxyfile.in
|
||||
${PROJECT_BINARY_DIR}/${doxy_dir}/Doxyfile
|
||||
@ONLY
|
||||
)
|
||||
find_package (Doxygen)
|
||||
if (DOXYGEN_FOUND)
|
||||
add_custom_target (doc
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/${doxy_dir}/Doxyfile
|
||||
SOURCES ${PROJECT_BINARY_DIR}/${doxy_dir}/Doxyfile
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${doxy_dir}
|
||||
COMMENT "Generating API documentation with Doxygen"
|
||||
VERBATIM
|
||||
)
|
||||
# distributions have various naming conventions; this enables the packager
|
||||
# to direct where the install target should put the documentation. the names
|
||||
# here are taken from GNUInstallDirs.cmake
|
||||
set (CMAKE_INSTALL_DATAROOTDIR "share" CACHE STRING "Read-only arch.-indep. data root")
|
||||
set (CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc${${opm}_VER_DIR}/${${opm}_NAME}" CACHE STRING "Documentation root")
|
||||
set (_formats html)
|
||||
foreach (format IN LISTS _formats)
|
||||
string (TOUPPER ${format} FORMAT)
|
||||
install (
|
||||
DIRECTORY ${PROJECT_BINARY_DIR}/${doxy_dir}/${format}
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||
COMPONENT ${format}
|
||||
OPTIONAL
|
||||
)
|
||||
# target to install just HTML documentation
|
||||
add_custom_target (install-${format}
|
||||
COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${format} -P cmake_install.cmake
|
||||
COMMENT Installing ${FORMAT} documentation
|
||||
VERBATIM
|
||||
)
|
||||
# since the documentation is optional, it is not automatically built
|
||||
add_dependencies (install-${format} doc)
|
||||
endforeach (format)
|
||||
endif (DOXYGEN_FOUND)
|
||||
|
||||
# stylesheets must be specified with relative path in Doxyfile, or the
|
||||
# full path (to the source directory!) will be put in the output HTML.
|
||||
# thus, we'll need to copy the stylesheet to this path relative to where
|
||||
# Doxygen will be run (in the output tree)
|
||||
if ((NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) AND (EXISTS ${PROJECT_SOURCE_DIR}/${doxy_dir}/style.css))
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/${doxy_dir}/style.css
|
||||
DESTINATION ${PROJECT_BINARY_DIR}/${doxy_dir}
|
||||
)
|
||||
set (${opm}_STYLESHEET_COPIED "${doxy_dir}/style.css")
|
||||
else ((NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) AND (EXISTS ${PROJECT_SOURCE_DIR}/${doxy_dir}/style.css))
|
||||
set (${opm}_STYLESHEET_COPIED "")
|
||||
endif ((NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) AND (EXISTS ${PROJECT_SOURCE_DIR}/${doxy_dir}/style.css))
|
||||
|
||||
endmacro (opm_doc opm)
|
||||
106
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmFiles.cmake
vendored
Normal file
106
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmFiles.cmake
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
# - Identify source code
|
||||
|
||||
macro (opm_out_dirs)
|
||||
# put libraries in lib/ (no multi-arch support in build tree)
|
||||
if(MAIN_SOURCE_FILES)
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
|
||||
endif()
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
|
||||
set (CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles")
|
||||
endmacro (opm_out_dirs)
|
||||
|
||||
# support for some of the variables that are used in Autotools
|
||||
# template files
|
||||
macro (opm_auto_dirs)
|
||||
set (abs_top_builddir "${PROJECT_BINARY_DIR}")
|
||||
set (abs_top_srcdir "${PROJECT_SOURCE_DIR}")
|
||||
endmacro (opm_auto_dirs)
|
||||
|
||||
macro (opm_sources opm)
|
||||
# this is necessary to set so that we know where we are going to
|
||||
# execute the test programs (and make datafiles available)
|
||||
set (tests_DIR "tests")
|
||||
|
||||
# how to retrieve the "fancy" name from the filename
|
||||
set (tests_REGEXP
|
||||
"^test_([^/]*)$"
|
||||
"^([^/]*)_test$"
|
||||
)
|
||||
|
||||
# these are the lists that must be defined in CMakeLists_files
|
||||
# - MAIN_SOURCE_FILES
|
||||
# - EXAMPLE_SOURCE_FILES
|
||||
# - TEST_SOURCE_FILES
|
||||
# - TEST_DATA_FILES
|
||||
# - PUBLIC_HEADER_FILES
|
||||
# - PROGRAM_SOURCE_FILES
|
||||
# - ADDITIONAL_SOURCE_FILES
|
||||
|
||||
# rename from "friendly" names to ones that fit the "almost-structural"
|
||||
# scheme used in the .cmake modules, converting them to absolute file
|
||||
# names in the process
|
||||
foreach (_file IN LISTS MAIN_SOURCE_FILES)
|
||||
list (APPEND ${opm}_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
|
||||
# further classify into language if some other modules need to add props
|
||||
if (_file MATCHES ".*\\.[cC][a-zA-Z]*$")
|
||||
if (_file MATCHES ".*\\.c$")
|
||||
list (APPEND ${opm}_C_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
|
||||
else (_file MATCHES ".*\\.c$")
|
||||
list (APPEND ${opm}_CXX_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
|
||||
endif (_file MATCHES ".*\\.c$")
|
||||
elseif (_file MATCHES ".*\\.[fF][a-zA-Z]*$")
|
||||
list (APPEND ${opm}_Fortran_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
|
||||
endif (_file MATCHES ".*\\.[cC][a-zA-Z]*$")
|
||||
endforeach (_file)
|
||||
foreach (_file IN LISTS PUBLIC_HEADER_FILES)
|
||||
list (APPEND ${opm}_HEADERS ${PROJECT_SOURCE_DIR}/${_file})
|
||||
endforeach (_file)
|
||||
foreach (_file IN LISTS TEST_SOURCE_FILES)
|
||||
list (APPEND tests_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
|
||||
endforeach (_file)
|
||||
foreach (_file IN LISTS TEST_DATA_FILES)
|
||||
list (APPEND tests_DATA ${PROJECT_SOURCE_DIR}/${_file})
|
||||
endforeach (_file)
|
||||
foreach (_file IN LISTS EXAMPLE_SOURCE_FILES)
|
||||
list (APPEND examples_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
|
||||
endforeach (_file)
|
||||
foreach (_file IN LISTS ADDITIONAL_SOURCE_FILES)
|
||||
list (APPEND additionals_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
|
||||
endforeach (_file)
|
||||
foreach (_file IN LISTS PROGRAM_SOURCE_FILES)
|
||||
list (APPEND examples_SOURCES_DIST ${PROJECT_SOURCE_DIR}/${_file})
|
||||
endforeach (_file)
|
||||
foreach (_file IN LISTS ATTIC_FILES)
|
||||
list (APPEND attic_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
|
||||
endforeach (_file)
|
||||
|
||||
# identify pre-compile header; if the project is called opm-foobar,
|
||||
# then it should be in opm/foobar/opm-foobar-pch.hpp
|
||||
string (REPLACE "-" "/" opm_NAME_AS_DIR ${${opm}_NAME})
|
||||
set (${opm}_PRECOMP_CXX_HEADER "${opm_NAME_AS_DIR}/${${opm}_NAME}-pch.hpp")
|
||||
if (NOT EXISTS ${PROJECT_SOURCE_DIR}/${${opm}_PRECOMP_CXX_HEADER})
|
||||
set (${opm}_PRECOMP_CXX_HEADER "")
|
||||
endif (NOT EXISTS ${PROJECT_SOURCE_DIR}/${${opm}_PRECOMP_CXX_HEADER})
|
||||
endmacro (opm_sources opm)
|
||||
|
||||
# disable an entire directory from sources
|
||||
macro (opm_disable_source opm)
|
||||
foreach (_exp IN ITEMS ${ARGN})
|
||||
# regexp or directory?
|
||||
if (IS_ABSOLUTE "${_exp}")
|
||||
set (_prefix "")
|
||||
else (IS_ABSOLUTE "${_exp}")
|
||||
set (_prefix "${PROJECT_SOURCE_DIR}/")
|
||||
endif (IS_ABSOLUTE "${_exp}")
|
||||
if (IS_DIRECTORY "${_prefix}${_exp}")
|
||||
set (_glob "/*")
|
||||
else (IS_DIRECTORY "${_prefix}${_exp}")
|
||||
set (_glob "")
|
||||
endif (IS_DIRECTORY "${_prefix}${_exp}")
|
||||
file (GLOB_RECURSE _disabled RELATIVE ${PROJECT_SOURCE_DIR} "${_prefix}${_exp}${_glob}")
|
||||
foreach (_file IN ITEMS ${_disabled})
|
||||
list (REMOVE_ITEM ${opm}_SOURCES "${PROJECT_SOURCE_DIR}/${_file}")
|
||||
endforeach (_file)
|
||||
endforeach (_exp)
|
||||
endmacro (opm_disable_source opm reldir)
|
||||
220
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmFind.cmake
vendored
Normal file
220
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmFind.cmake
vendored
Normal file
@@ -0,0 +1,220 @@
|
||||
# - Generic inclusion of packages
|
||||
#
|
||||
# Synopsis:
|
||||
#
|
||||
# find_and_append_package (name args)
|
||||
#
|
||||
# where
|
||||
#
|
||||
# name Name of the package, e.g. Boost
|
||||
# args Other arguments, e.g. COMPONENTS, REQUIRED, QUIET etc.
|
||||
#
|
||||
# This macro will append the list of standard variables found by the
|
||||
# package to this project's standard variables
|
||||
#
|
||||
########################################################################
|
||||
#
|
||||
# - Generic inclusion of a list of packages
|
||||
#
|
||||
# Synopsis:
|
||||
#
|
||||
# find_and_append_package_list (args)
|
||||
#
|
||||
# where
|
||||
#
|
||||
# args List of package strings. Each string must be quoted if
|
||||
# it contains more than one word.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# find_and_append_package_list (
|
||||
# "Boost COMPONENTS filesystem REQUIRED"
|
||||
# SUPERLU
|
||||
# )
|
||||
|
||||
include (Duplicates)
|
||||
include (OpmSiblingSearch)
|
||||
|
||||
# list of suffixes for all the project variables
|
||||
set (_opm_proj_vars
|
||||
SOURCES
|
||||
LINKER_FLAGS
|
||||
LIBRARIES
|
||||
DEFINITIONS
|
||||
INCLUDE_DIRS
|
||||
LIBRARY_DIRS
|
||||
CONFIG_VARS
|
||||
CONFIG_IMPL_VARS
|
||||
)
|
||||
|
||||
# ensure that they are at least the empty list after we're done
|
||||
foreach (name IN LISTS _opm_proj_vars)
|
||||
if (NOT DEFINED ${CMAKE_PROJECT_NAME}_${name})
|
||||
set (${CMAKE_PROJECT_NAME}_${name} "")
|
||||
endif (NOT DEFINED ${CMAKE_PROJECT_NAME}_${name})
|
||||
endforeach (name)
|
||||
|
||||
|
||||
# insert this boilerplate whenever we are going to find a new package
|
||||
macro (find_and_append_package_to prefix name)
|
||||
# special handling for Boost to avoid inadvertedly picking up system
|
||||
# libraries when we want our own version. this is done here because
|
||||
# having a custom Boost is common, but the logic to search only there
|
||||
# does not follow any particular convention.
|
||||
if (BOOST_ROOT AND NOT DEFINED Boost_NO_SYSTEM_PATHS)
|
||||
set (Boost_NO_SYSTEM_PATHS TRUE)
|
||||
endif (BOOST_ROOT AND NOT DEFINED Boost_NO_SYSTEM_PATHS)
|
||||
|
||||
# if we have specified a directory, don't revert to searching the
|
||||
# system default paths afterwards
|
||||
string (TOUPPER "${name}" NAME)
|
||||
string (REPLACE "-" "_" NAME "${NAME}")
|
||||
|
||||
# only use suite if module-specific variable is not set. this allows
|
||||
# us to override one dir in a suite
|
||||
if (NOT (${name}_DIR OR ${name}_ROOT OR ${NAME}_ROOT))
|
||||
# module is part of a suite if it has name with the pattern xxx-yyy
|
||||
if (("${name}" MATCHES "[^-]+-.+") OR ${name}_SUITE)
|
||||
# allow to override if the module doesn't quite fit the convention
|
||||
# e.g. dune-cornerpoint (since renamed to opm-grid)
|
||||
if (NOT DEFINED ${name}_SUITE)
|
||||
# extract suite name from module
|
||||
string (REGEX REPLACE "([^-]+)-.+" "\\1" ${name}_SUITE "${name}")
|
||||
endif (NOT DEFINED ${name}_SUITE)
|
||||
# assume that each module has its own subdir directly under suite dir
|
||||
string (TOUPPER "${${name}_SUITE}" ${name}_SUITE_UPPER)
|
||||
if (DEFINED ${${name}_SUITE_UPPER}_ROOT)
|
||||
set (${NAME}_ROOT ${${${name}_SUITE_UPPER}_ROOT}/${name})
|
||||
endif (DEFINED ${${name}_SUITE_UPPER}_ROOT)
|
||||
endif (("${name}" MATCHES "[^-]+-.+") OR ${name}_SUITE)
|
||||
endif (NOT (${name}_DIR OR ${name}_ROOT OR ${NAME}_ROOT))
|
||||
|
||||
# the documentation says that if *-config.cmake files are not found,
|
||||
# find_package will revert to doing a full search, but that is not
|
||||
# true, so unconditionally setting ${name}_DIR is not safe. however,
|
||||
# if the directory given to us contains a config file, then copy the
|
||||
# value over to this variable to switch to config mode (CMake will
|
||||
# always use config mode if *_DIR is defined)
|
||||
if (NOT DEFINED ${name}_DIR AND (DEFINED ${name}_ROOT OR DEFINED ${NAME}_ROOT))
|
||||
if (EXISTS ${${name}_ROOT}/${name}-config.cmake OR EXISTS ${${name}_ROOT}/${name}Config.cmake)
|
||||
set (${name}_DIR "${${name}_ROOT}")
|
||||
endif (EXISTS ${${name}_ROOT}/${name}-config.cmake OR EXISTS ${${name}_ROOT}/${name}Config.cmake)
|
||||
if (EXISTS ${${NAME}_ROOT}/${name}-config.cmake OR EXISTS ${${NAME}_ROOT}/${name}Config.cmake)
|
||||
set (${name}_DIR "${${NAME}_ROOT}")
|
||||
endif (EXISTS ${${NAME}_ROOT}/${name}-config.cmake OR EXISTS ${${NAME}_ROOT}/${name}Config.cmake)
|
||||
endif (NOT DEFINED ${name}_DIR AND (DEFINED ${name}_ROOT OR DEFINED ${NAME}_ROOT))
|
||||
|
||||
# if we're told not to look for the package, pretend it was never found
|
||||
if (CMAKE_DISABLE_FIND_PACKAGE_${name})
|
||||
# If required send an error
|
||||
cmake_parse_arguments(FIND "REQUIRED" "" "" ${ARGN} )
|
||||
set (${name}_FOUND FALSE)
|
||||
set (${NAME}_FOUND FALSE)
|
||||
if (FIND_REQUIRED)
|
||||
message(SEND_ERROR "package ${name} but disable with CMAKE_DISABLE_FIND_PACKAGE_${name}")
|
||||
endif ()
|
||||
else ()
|
||||
# List of components might differ for every module. Therefore we will
|
||||
# need to research for a library multiple times. _search_components
|
||||
# will hold the index of the string COMPONENTS in the list
|
||||
set(_ARGN_LIST ${ARGN}) # Create a real list to use with list commands
|
||||
list(FIND _ARGN_LIST "COMPONENTS" _search_components)
|
||||
|
||||
# using config mode is better than using module (aka. find) mode
|
||||
# because then the package has already done all its probes and
|
||||
# stored them in the config file for us
|
||||
# For dune and opm modules and exempted packages we force module mode.
|
||||
# For dune and opm it will use config mode underneath.
|
||||
# We even need to repeat the search for opm-common once as this is done
|
||||
# in the top most CMakeLists.txt without querying defines, setting dependencies
|
||||
# and the likes which is only done via opm_find_package
|
||||
if ( (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND )
|
||||
OR _search_components GREATER -1)
|
||||
string(REGEX MATCH "(opm)-.*" _is_opm ${name})
|
||||
if(NOT _is_opm)
|
||||
find_package (${name} ${ARGN})
|
||||
else()
|
||||
if(${name}_DIR)
|
||||
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE)
|
||||
endif()
|
||||
include(FindPackageHandleStandardArgs)
|
||||
if(${name}_FOUND AND ${name}_LIBRARY STREQUAL "")
|
||||
find_package_handle_standard_args(${name}
|
||||
REQUIRED_VARS ${name}_INCLUDE_DIRS)
|
||||
else()
|
||||
find_package_handle_standard_args(${name}
|
||||
REQUIRED_VARS ${name}_LIBRARY)
|
||||
endif()
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT DEFINED ${name}_FOUND)
|
||||
set (${name}_FOUND "${${NAME}_FOUND}")
|
||||
endif ()
|
||||
if (NOT DEFINED ${NAME}_FOUND)
|
||||
set (${NAME}_FOUND "${${name}_FOUND}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# the variable "NAME" may be replaced during find_package (as this is
|
||||
# now a macro, and not a function anymore), so we must reinitialize
|
||||
string (TOUPPER "${name}" NAME)
|
||||
string (REPLACE "-" "_" NAME "${NAME}")
|
||||
|
||||
if (${name}_FOUND OR ${NAME}_FOUND)
|
||||
foreach (var IN LISTS _opm_proj_vars)
|
||||
if (DEFINED ${name}_${var})
|
||||
list (APPEND ${prefix}_${var} ${${name}_${var}})
|
||||
# some packages define an uppercase version of their own name
|
||||
elseif (DEFINED ${NAME}_${var})
|
||||
list (APPEND ${prefix}_${var} ${${NAME}_${var}})
|
||||
endif (DEFINED ${name}_${var})
|
||||
# some packages define _PATH instead of _DIRS (Hi, MPI!)
|
||||
if ("${var}" STREQUAL "INCLUDE_DIRS")
|
||||
if (DEFINED ${name}_INCLUDE_PATH)
|
||||
list (APPEND ${prefix}_INCLUDE_DIRS ${${name}_INCLUDE_PATH})
|
||||
elseif (DEFINED ${NAME}_INCLUDE_PATH)
|
||||
list (APPEND ${prefix}_INCLUDE_DIRS ${${NAME}_INCLUDE_PATH})
|
||||
endif (DEFINED ${name}_INCLUDE_PATH)
|
||||
# some packages define only _DIR and not _DIRS (Hi, Eigen3!)
|
||||
if (DEFINED ${name}_INCLUDE_DIR)
|
||||
list (APPEND ${prefix}_INCLUDE_DIRS ${${name}_INCLUDE_DIR})
|
||||
elseif (DEFINED ${NAME}_INCLUDE_DIR)
|
||||
list (APPEND ${prefix}_INCLUDE_DIRS ${${NAME}_INCLUDE_DIR})
|
||||
endif (DEFINED ${name}_INCLUDE_DIR)
|
||||
endif ("${var}" STREQUAL "INCLUDE_DIRS")
|
||||
# cleanup lists
|
||||
if ("${var}" STREQUAL "LIBRARIES")
|
||||
remove_duplicate_libraries (${prefix})
|
||||
else ("${var}" STREQUAL "LIBRARIES")
|
||||
remove_duplicate_var (${prefix} ${var})
|
||||
endif ("${var}" STREQUAL "LIBRARIES")
|
||||
endforeach (var)
|
||||
# some libraries only define xxx_FOUND and not a corresponding HAVE_xxx
|
||||
if (NOT DEFINED HAVE_${NAME})
|
||||
set (HAVE_${NAME} 1)
|
||||
endif (NOT DEFINED HAVE_${NAME})
|
||||
endif (${name}_FOUND OR ${NAME}_FOUND)
|
||||
endmacro (find_and_append_package_to prefix name)
|
||||
|
||||
# append to the list of variables associated with the project
|
||||
macro (find_and_append_package name)
|
||||
find_and_append_package_to (${CMAKE_PROJECT_NAME} ${name} ${ARGN})
|
||||
endmacro (find_and_append_package name)
|
||||
|
||||
# find a list of dependencies, adding each one of them
|
||||
macro (find_and_append_package_list_to prefix)
|
||||
# setting and separating is necessary to work around apparent bugs
|
||||
# in CMake's parser (sic)
|
||||
set (_deps ${ARGN})
|
||||
foreach (_dep IN LISTS _deps)
|
||||
separate_arguments (_args UNIX_COMMAND ${_dep})
|
||||
find_and_append_package_to (${prefix} ${_args})
|
||||
endforeach (_dep)
|
||||
endmacro (find_and_append_package_list_to prefix)
|
||||
|
||||
# convenience method to supply the project name as prefix
|
||||
macro (find_and_append_package_list)
|
||||
find_and_append_package_list_to (${CMAKE_PROJECT_NAME} ${ARGN})
|
||||
endmacro (find_and_append_package_list)
|
||||
81
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmGrid.cmake
vendored
Normal file
81
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmGrid.cmake
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
# - Recreate grid selection macros from DUNE
|
||||
#
|
||||
# If anyone requires Dune::GridSelector::GridType, they must call this
|
||||
# macro in *their* project, to add this information to config.h. (In
|
||||
# the autotools version, dunecontrol will automatically include m4
|
||||
# scripts that does this).
|
||||
#
|
||||
# Example:
|
||||
# opm_cornerpoint_grid (${CONFIG_H})
|
||||
|
||||
include (CMakeParseArguments)
|
||||
function (opm_grid_type)
|
||||
cmake_parse_arguments (a "" "FILENAME;SYMBOL;TYPE;CONDITION" "HEADERS" ${ARGN})
|
||||
|
||||
# write prelude of a condition to use this particular grid, an inclusion guard,
|
||||
# and checks to see if the number of dimensions fits for this type of grid
|
||||
file (APPEND ${a_FILENAME}
|
||||
"/* add GRIDTYPE typedef for grid implementation ${a_TYPE}:
|
||||
defining ${a_SYMBOL} during compilation typedefs this grid implementation as GridType
|
||||
in namespace Dune::GridSelector;
|
||||
also integer constants dimgrid and dimworld are set in this namespace.
|
||||
The required headers for this grid implementation are also included.
|
||||
*/
|
||||
#if defined ${a_SYMBOL} && ! defined USED_${a_SYMBOL}_GRIDTYPE
|
||||
/* someone else has already defined a gridtype */
|
||||
#if HAVE_GRIDTYPE
|
||||
#error \"Ambigious definition of GRIDTYPE\"
|
||||
#endif
|
||||
|
||||
#ifndef WORLDDIM
|
||||
#define WORLDDIM GRIDDIM
|
||||
#endif
|
||||
#if not (WORLDDIM >= GRIDDIM)
|
||||
#error \"WORLDDIM < GRIDDIM does not make sense.\"
|
||||
#endif
|
||||
|
||||
#if ! (${a_CONDITION})
|
||||
#error \"Preprocessor assertion ${a_CONDITION} failed.\"
|
||||
#endif
|
||||
|
||||
")
|
||||
|
||||
# write headers which are capable of defining the type. this should
|
||||
# really just have consisted of a forward declaration, but the damage
|
||||
# is done: clients expect to just pull in config.h and have the
|
||||
# proper type available.
|
||||
foreach (header IN LISTS a_HEADERS)
|
||||
file (APPEND ${a_FILENAME}
|
||||
"#include <${header}>\n"
|
||||
)
|
||||
endforeach (header)
|
||||
|
||||
# main part which does the typedef and then a postlude which marks
|
||||
# the grid as "taken" and make sure that no one else does the same
|
||||
file (APPEND ${a_FILENAME}
|
||||
"
|
||||
namespace Dune {
|
||||
namespace GridSelector {
|
||||
const int dimgrid = GRIDDIM;
|
||||
const int worldgrid = WORLDDIM;
|
||||
typedef ${a_TYPE} GridType;
|
||||
}
|
||||
}
|
||||
|
||||
#define HAVE_GRIDTYPE 1
|
||||
#define USED_${a_SYMBOL}_GRIDTYPE 1
|
||||
#endif
|
||||
")
|
||||
|
||||
endfunction (opm_grid_type)
|
||||
|
||||
# write the grid type for opm-grid
|
||||
function (opm_cornerpoint_grid config_h)
|
||||
opm_grid_type (
|
||||
FILENAME ${CONFIG_H}
|
||||
SYMBOL CPGRID
|
||||
HEADERS "dune/grid/CpGrid.hpp" "dune/grid/cpgrid/dgfparser.hh"
|
||||
TYPE Dune::CpGrid
|
||||
CONDITION "(GRIDDIM == 3) && (WORLDDIM == 3)"
|
||||
)
|
||||
endfunction (opm_cornerpoint_grid config_h)
|
||||
143
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmInit.cmake
vendored
Normal file
143
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmInit.cmake
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
# - Initialize project-specific variables
|
||||
#
|
||||
# This will read the dune.module file for project information and
|
||||
# set the following variables:
|
||||
#
|
||||
# project From the Module: field
|
||||
# ${project}_NAME Same as above
|
||||
# ${project}_DESCRIPTION From the Description: field
|
||||
# ${project}_VERSION_MAJOR From the Version: field
|
||||
# ${project}_VERSION_MINOR From the Version: field also
|
||||
#
|
||||
# This module should be the first to be included in the project,
|
||||
# because most of the others (OpmXxx.cmake) use these variables.
|
||||
|
||||
# for CMake >= 3.0, we need to change a few policies:
|
||||
#
|
||||
# - CMP0026 to allow access to the LOCATION target property
|
||||
# - CMP0048 to indicate that we want to deal with the *VERSION*
|
||||
# variables ourselves
|
||||
# - CMP0064 to indicate that we want TEST if conditions to be evaluated
|
||||
# - CMP0074 to indicate that <PackageName>_ROOT can be used to find package
|
||||
# config files
|
||||
macro(OpmSetPolicies)
|
||||
if (POLICY CMP0026)
|
||||
# Needed as we query LOCATION in OpmCompile.cmake and OpmSatellites.cmake
|
||||
cmake_policy(SET CMP0026 OLD)
|
||||
endif()
|
||||
|
||||
if (POLICY CMP0048)
|
||||
# We do not set version. Hence NEW should work and this can be removed later
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0064)
|
||||
cmake_policy(SET CMP0064 NEW)
|
||||
endif()
|
||||
|
||||
# set the behavior of the policy 0054 to NEW. (i.e. do not implicitly
|
||||
# expand variables in if statements)
|
||||
if (POLICY CMP0054)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
endif()
|
||||
|
||||
# set the behavior of policy 0074 to new as we always used <PackageName>_ROOT as the
|
||||
# root of the installation
|
||||
if(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
endif()
|
||||
|
||||
# include special
|
||||
if (CMAKE_VERSION VERSION_LESS "2.8.3")
|
||||
message (STATUS "Enabling compatibility modules for CMake 2.8.3")
|
||||
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.3")
|
||||
endif (CMAKE_VERSION VERSION_LESS "2.8.3")
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS "2.8.5")
|
||||
message (STATUS "Enabling compatibility modules for CMake 2.8.5")
|
||||
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.5")
|
||||
endif (CMAKE_VERSION VERSION_LESS "2.8.5")
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS "2.8.7")
|
||||
message (STATUS "Enabling compatibility modules for CMake 2.8.7")
|
||||
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.7")
|
||||
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
|
||||
endmacro()
|
||||
|
||||
|
||||
# helper macro to retrieve a single field of a dune.module file
|
||||
macro(OpmGetDuneModuleDirective field variable contents)
|
||||
string (REGEX MATCH ".*${field}:[ ]*([^\n]+).*" ${variable} "${contents}")
|
||||
string (REGEX REPLACE ".*${field}:[ ]*([^\n]+).*" "\\1" "${variable}" "${${variable}}")
|
||||
string (STRIP "${${variable}}" ${variable})
|
||||
endmacro()
|
||||
|
||||
function (OpmInitProjVars)
|
||||
# locate the "dune.module" file
|
||||
set (DUNE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/dune.module")
|
||||
|
||||
# read this file into a variable
|
||||
file (READ "${DUNE_MODULE_PATH}" DUNE_MODULE)
|
||||
|
||||
# read fields from the file
|
||||
OpmGetDuneModuleDirective ("Module" project "${DUNE_MODULE}")
|
||||
OpmGetDuneModuleDirective ("Description" description "${DUNE_MODULE}")
|
||||
OpmGetDuneModuleDirective ("Version" version "${DUNE_MODULE}")
|
||||
OpmGetDuneModuleDirective ("Label" label "${DUNE_MODULE}")
|
||||
|
||||
# parse the version number
|
||||
set (verno_regex "^([0-9]*)\\.([0-9]*).*\$")
|
||||
string (REGEX REPLACE "${verno_regex}" "\\1" major "${version}")
|
||||
string (REGEX REPLACE "${verno_regex}" "\\2" minor "${version}")
|
||||
|
||||
# return these variables
|
||||
set (project "${project}" PARENT_SCOPE)
|
||||
set (${project}_NAME "${project}" PARENT_SCOPE)
|
||||
set (${project}_DESCRIPTION "${description}" PARENT_SCOPE)
|
||||
set (${project}_VERSION_MAJOR "${major}" PARENT_SCOPE)
|
||||
set (${project}_VERSION_MINOR "${minor}" PARENT_SCOPE)
|
||||
set (${project}_LABEL "${label}" PARENT_SCOPE)
|
||||
endfunction ()
|
||||
|
||||
macro (OpmInitDirVars)
|
||||
# these are the most common (and desired locations)
|
||||
set (${project}_DIR "opm")
|
||||
set (doxy_dir "doc/doxygen")
|
||||
|
||||
# but for backward compatibility we can override it
|
||||
if (COMMAND dir_hook)
|
||||
dir_hook ()
|
||||
endif (COMMAND dir_hook)
|
||||
endmacro ()
|
||||
|
||||
OpmInitProjVars ()
|
||||
OpmInitDirVars ()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
|
||||
include(OpmPackage)
|
||||
|
||||
# if we are backporting this release to a system which already have an
|
||||
# earlier version, set this flag to have everything scoped into a directory
|
||||
# which incorporates the label of the release. this is done by interjecting
|
||||
# the ${project}_VER_DIR into the installation path.
|
||||
option (USE_VERSIONED_DIR "Put files in release-specific directories" OFF)
|
||||
set (${project}_SUITE "opm")
|
||||
if (USE_VERSIONED_DIR)
|
||||
set (${project}_VER_DIR "/${${project}_SUITE}-${${project}_LABEL}")
|
||||
else ()
|
||||
set (${project}_VER_DIR "")
|
||||
endif ()
|
||||
|
||||
# parallel computing must be explicitly enabled
|
||||
# This needs to be in OpmInit as prereqs is called before OpmLibMain is included.
|
||||
option (USE_MPI "Use Message Passing Interface for parallel computing" OFF)
|
||||
if (NOT USE_MPI)
|
||||
set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
|
||||
endif ()
|
||||
|
||||
# quadmath must be explicitly enabled
|
||||
# This needs to be in OpmInit as prereqs is called before OpmLibMain is included.
|
||||
option (USE_QUADMATH "Use high precision floating point library (slow)" OFF)
|
||||
if (NOT USE_QUADMATH)
|
||||
set (CMAKE_DISABLE_FIND_PACKAGE_QuadMath TRUE)
|
||||
endif ()
|
||||
74
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmInstall.cmake
vendored
Normal file
74
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmInstall.cmake
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
# - Installation macro
|
||||
#
|
||||
# Set up installation targets for the binary library. The following
|
||||
# suffices must be defined for the prefix passed as parameter:
|
||||
#
|
||||
# _NAME Name of the library
|
||||
# _HEADERS List of header files to install
|
||||
# _TARGET CMake target which builds the library
|
||||
# _LIBRARY_TYPE Static or shared library
|
||||
# _DEBUG File containing debug symbols
|
||||
include (GNUInstallDirs)
|
||||
|
||||
macro (opm_install opm)
|
||||
foreach (_hdr IN LISTS ${opm}_HEADERS)
|
||||
get_filename_component (_dir ${_hdr} PATH)
|
||||
file (RELATIVE_PATH _rel_dir "${PROJECT_SOURCE_DIR}" "${_dir}")
|
||||
install (
|
||||
FILES ${_hdr}
|
||||
DESTINATION include${${opm}_VER_DIR}/${_rel_dir}
|
||||
)
|
||||
endforeach (_hdr)
|
||||
install (
|
||||
TARGETS ${${opm}_TARGET} ${${opm}_EXTRA_TARGETS}
|
||||
EXPORT ${opm}-targets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${${opm}_VER_DIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${${opm}_VER_DIR}
|
||||
)
|
||||
if(NOT "${${opm}_TARGET}" STREQUAL "")
|
||||
export(TARGETS ${${opm}_TARGET} ${${opm}_EXTRA_TARGETS}
|
||||
FILE ${opm}-targets.cmake)
|
||||
install(EXPORT ${opm}-targets DESTINATION "share/cmake/${opm}")
|
||||
endif()
|
||||
# only /usr/lib/debug seems to be searched for debug info; if we have
|
||||
# write access to that directory (package installation), then default
|
||||
# to use it; otherwise put the debug files together with the library
|
||||
# (local installation). everything can be overridden by the option.
|
||||
if (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
|
||||
set (_sys_dbg_def ON)
|
||||
else (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
|
||||
set (_sys_dbg_def OFF)
|
||||
endif (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
|
||||
option (SYSTEM_DEBUG "Put .debug files in GDB debug file directory" ${_sys_dbg_def})
|
||||
set (DEBUG_FILE_DIRECTORY /usr/lib/debug CACHE PATH "GDB debug file directory")
|
||||
mark_as_advanced (DEBUG_FILE_DIRECTORY)
|
||||
if (SYSTEM_DEBUG AND NOT APPLE)
|
||||
set (_dbg_prefix "${DEBUG_FILE_DIRECTORY}/")
|
||||
else (SYSTEM_DEBUG AND NOT APPLE)
|
||||
set (_dbg_prefix "")
|
||||
endif (SYSTEM_DEBUG AND NOT APPLE)
|
||||
# static libraries don't have their debug info stripped, so there is
|
||||
# only a separate file when we are building shared objects
|
||||
if (${opm}_LIBRARY_TYPE STREQUAL "SHARED" AND ${opm}_TARGET AND ${opm}_DEBUG)
|
||||
# on MacOS X, debug files are actually bundles (directories)
|
||||
if (APPLE)
|
||||
set (_dbg_type DIRECTORY)
|
||||
else ()
|
||||
set (_dbg_type FILES)
|
||||
endif ()
|
||||
install (
|
||||
${_dbg_type} ${PROJECT_BINARY_DIR}/${${opm}_DEBUG}
|
||||
DESTINATION ${_dbg_prefix}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${${opm}_VER_DIR}
|
||||
)
|
||||
endif (${opm}_LIBRARY_TYPE STREQUAL "SHARED" AND ${opm}_TARGET AND ${opm}_DEBUG)
|
||||
# note that the DUNE parts that looks for dune.module is currently (2013-09) not
|
||||
# multiarch-aware and will thus put in lib64/ on RHEL and lib/ on Debian
|
||||
install (
|
||||
FILES ${PROJECT_SOURCE_DIR}/dune.module
|
||||
DESTINATION lib/${${opm}_VER_DIR}/dunecontrol/${${opm}_NAME}
|
||||
)
|
||||
install (
|
||||
FILES ${PROJECT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}-prereqs.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/opm/cmake/Modules
|
||||
)
|
||||
endmacro (opm_install opm)
|
||||
58
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmKnown.cmake
vendored
Normal file
58
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmKnown.cmake
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# -*- 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:
|
||||
|
||||
# features that may be used by some packages (Fortran wrappers
|
||||
# for instance), and this set options for, but which is included
|
||||
# conditionally and thus does not exist in other packages
|
||||
set (FEATURE_VARS
|
||||
USE_UNDERSCORING
|
||||
)
|
||||
|
||||
# emulate the with-xxx feature of autotools to not give warnings
|
||||
# if we specify the directories of packages that are known to the
|
||||
# family but not necessarily used
|
||||
|
||||
# pick package names from these; opm-xxx, dune-xxx
|
||||
set (KNOWN_FAMILIES
|
||||
opm
|
||||
dune
|
||||
)
|
||||
|
||||
# variables to test; xxx_DIR, xxx_ROOT
|
||||
set (KNOWN_VARS
|
||||
DIR
|
||||
ROOT
|
||||
)
|
||||
|
||||
set (KNOWN_opm_PKGS
|
||||
common
|
||||
parser
|
||||
material
|
||||
core
|
||||
grid
|
||||
output
|
||||
simulators
|
||||
upscaling
|
||||
verteq
|
||||
)
|
||||
|
||||
set (KNOWN_dune_PKGS
|
||||
common
|
||||
geometry
|
||||
grid
|
||||
istl
|
||||
localfunctions
|
||||
)
|
||||
|
||||
foreach (family IN ITEMS ${KNOWN_FAMILIES})
|
||||
foreach (package IN ITEMS ${KNOWN_${family}_PKGS})
|
||||
foreach (var IN ITEMS ${KNOWN_VARS})
|
||||
# just "use" the variable, so we don't get warnings
|
||||
set (_dummy ${${family}-${package}_${var}})
|
||||
endforeach (var)
|
||||
endforeach (package)
|
||||
endforeach (family)
|
||||
|
||||
foreach (feature IN ITEMS ${FEATURE_VARS})
|
||||
set (_dummy ${${feature}})
|
||||
endforeach (feature)
|
||||
290
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmLibMain.cmake
vendored
Normal file
290
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmLibMain.cmake
vendored
Normal file
@@ -0,0 +1,290 @@
|
||||
# -*- 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:
|
||||
|
||||
# - Build an OPM library module
|
||||
#
|
||||
# This macro assumes that ${project} contains the name of the project,
|
||||
# e.g. "opm-core", and that various variables that configures the module
|
||||
# has been setup in advance.
|
||||
#
|
||||
# Customize the module configuration by defining these "callback" macros:
|
||||
#
|
||||
# prereqs_hook Do special processing before prerequisites are found
|
||||
# fortran_hook Determine whether Fortran support is necessary or not
|
||||
# sources_hook Do special processing before sources are compiled
|
||||
# tests_hook Do special processing before tests are compiled
|
||||
# files_hook Do special processing before final targets are added
|
||||
|
||||
|
||||
# don't write default flags into the cache, preserve that for user set values
|
||||
include (AddOptions)
|
||||
no_default_options ()
|
||||
|
||||
# Languages and global compiler settings
|
||||
if(CMAKE_VERSION VERSION_LESS 3.8)
|
||||
message(WARNING "CMake version does not support c++17, guessing -std=c++17")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
# Various compiler extension checks
|
||||
include(OpmCompilerChecks)
|
||||
|
||||
# print system information to better pinpoint issues from log alone
|
||||
include (UseSystemInfo)
|
||||
system_info ()
|
||||
|
||||
# very early try to print repo id (to pinpoint version if something goes wrong)
|
||||
include (UseVCSInfo)
|
||||
vcs_info ()
|
||||
|
||||
# print toolchain information to identify compilers with potential bugs
|
||||
include (UseCompVer)
|
||||
compiler_info ()
|
||||
linker_info ()
|
||||
|
||||
# default settings: build static debug library
|
||||
include (OpmDefaults)
|
||||
opm_defaults (${project})
|
||||
message (STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
# use tricks to do faster builds
|
||||
include (UseFastBuilds)
|
||||
|
||||
# precompiled headers
|
||||
include (UsePrecompHeaders)
|
||||
|
||||
# optimize full if we're not doing a debug build
|
||||
include (UseOptimization)
|
||||
|
||||
# turn on all warnings; this must be done before adding any
|
||||
# dependencies, in case they alter the list of warnings
|
||||
option(OPM_DISABLE_WARNINGS "Disable warning flags" OFF)
|
||||
if(NOT OPM_DISABLE_WARNINGS)
|
||||
include (UseWarnings)
|
||||
endif()
|
||||
|
||||
# parallel programming
|
||||
include (UseOpenMP)
|
||||
find_openmp (${project})
|
||||
include (UseThreads)
|
||||
find_threads (${project})
|
||||
|
||||
# SuperLU is optional
|
||||
option (USE_SUPERLU "Use SuperLU direct solvers" OFF)
|
||||
|
||||
# PETSc is optional
|
||||
option (USE_PETSC "Use PETSc iterative solvers" OFF)
|
||||
|
||||
# static code analysis
|
||||
include(UseStaticAnalysis)
|
||||
setup_static_analysis_tools()
|
||||
|
||||
# callback hook to setup additional dependencies
|
||||
if (COMMAND prereqs_hook)
|
||||
prereqs_hook ()
|
||||
endif (COMMAND prereqs_hook)
|
||||
|
||||
# macro to set standard variables (INCLUDE_DIRS, LIBRARIES etc.)
|
||||
include (OpmFind)
|
||||
find_and_append_package_list_to (${project} ${${project}_DEPS})
|
||||
|
||||
# set aliases to probed variables
|
||||
include (OpmAliases)
|
||||
|
||||
# remove the dependency on the testing framework from the main library;
|
||||
# it is not possible to query for Boost twice with different components.
|
||||
list (REMOVE_ITEM "${project}_LIBRARIES" "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
|
||||
|
||||
# don't import more libraries than we need to
|
||||
include (UseOnlyNeeded)
|
||||
|
||||
# put debug information into every executable
|
||||
include (UseDebugSymbols)
|
||||
|
||||
# detect if Boost is in a shared library
|
||||
include (UseDynamicBoost)
|
||||
|
||||
# needed for Debian installation scheme
|
||||
include (GNUInstallDirs)
|
||||
|
||||
# Run conditional file hook
|
||||
files_hook()
|
||||
|
||||
# this module contains code to figure out which files is where
|
||||
include (OpmFiles)
|
||||
opm_auto_dirs ()
|
||||
|
||||
# put libraries in lib/
|
||||
opm_out_dirs ()
|
||||
|
||||
# identify the compilation units in the library; sources in opm/,
|
||||
# tests files in tests/, examples in tutorials/ and examples/
|
||||
opm_sources (${project})
|
||||
|
||||
# processing after base sources have been identified
|
||||
if (COMMAND sources_hook)
|
||||
sources_hook ()
|
||||
endif (COMMAND sources_hook)
|
||||
|
||||
# convenience macro to add version of another suite, e.g. dune-common
|
||||
macro (opm_need_version_of what)
|
||||
string (TOUPPER "${what}" _WHAT)
|
||||
string (REPLACE "-" "_" _WHAT "${_WHAT}")
|
||||
list (APPEND ${project}_CONFIG_IMPL_VARS
|
||||
${_WHAT}_VERSION_MAJOR ${_WHAT}_VERSION_MINOR ${_WHAT}_VERSION_REVISION
|
||||
)
|
||||
endmacro (opm_need_version_of suite module)
|
||||
|
||||
# use this hook to add version macros before we write to config.h
|
||||
if (COMMAND config_hook)
|
||||
config_hook ()
|
||||
endif (COMMAND config_hook)
|
||||
|
||||
# create configuration header which describes available features
|
||||
# necessary to compile this library. singular version is the names that
|
||||
# is required by this project alone, plural version transitively
|
||||
# includes the necessary defines by the dependencies
|
||||
include (ConfigVars)
|
||||
list (APPEND ${project}_CONFIG_VARS ${${project}_CONFIG_VAR})
|
||||
|
||||
# write configuration variables to this file. note that it is a temporary.
|
||||
# _CONFIG_IMPL_VARS are defines that are only written to config.h internal
|
||||
# to this project; they are not exported to any installed files.
|
||||
# TESTING_CONFIG_VARS is what's required by the unit tests, and is therefore
|
||||
# added in an ad-hoc manner to avoid putting dependencies to it in the module
|
||||
# requirement file. (it should be added if there is .h code that needs it)
|
||||
message (STATUS "Writing config file \"${PROJECT_BINARY_DIR}/config.h\"...")
|
||||
set (CONFIG_H "${PROJECT_BINARY_DIR}/config.h.tmp")
|
||||
configure_vars (
|
||||
FILE CXX ${CONFIG_H}
|
||||
WRITE ${${project}_CONFIG_VARS}
|
||||
${${project}_CONFIG_IMPL_VARS}
|
||||
${TESTING_CONFIG_VARS}
|
||||
)
|
||||
|
||||
# call this hook to let it setup necessary conditions for Fortran support
|
||||
if (COMMAND fortran_hook)
|
||||
fortran_hook ()
|
||||
endif (COMMAND fortran_hook)
|
||||
|
||||
if (${project}_FORTRAN_IF)
|
||||
include (UseFortranWrappers)
|
||||
define_fc_func (
|
||||
APPEND ${CONFIG_H}
|
||||
IF ${${project}_FORTRAN_IF}
|
||||
)
|
||||
endif (${project}_FORTRAN_IF)
|
||||
|
||||
# overwrite the config.h that is used by the code only if we have some
|
||||
# real changes. thus, we don't have to recompile if a reconfigure is run
|
||||
# due to some files being added, for instance
|
||||
execute_process (COMMAND
|
||||
${CMAKE_COMMAND} -E copy_if_different ${CONFIG_H} ${PROJECT_BINARY_DIR}/config.h
|
||||
)
|
||||
|
||||
# compile main library; pull in all required includes and libraries
|
||||
include (OpmCompile)
|
||||
opm_compile (${project})
|
||||
|
||||
# installation target: copy the library together with debug and
|
||||
# configuration files to system directories
|
||||
include (OpmInstall)
|
||||
if (COMMAND install_hook)
|
||||
install_hook ()
|
||||
endif (COMMAND install_hook)
|
||||
opm_install (${project})
|
||||
message (STATUS "This build defaults to installing in ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# installation of CMake modules to help user programs locate the library
|
||||
include (OpmProject)
|
||||
opm_cmake_config (${project})
|
||||
|
||||
# routines to build satellites such as tests, tutorials and samples
|
||||
include (OpmSatellites)
|
||||
|
||||
# example programs are found in the tutorials/ and examples/ directory
|
||||
option (BUILD_EXAMPLES "Build the examples/ tree" ON)
|
||||
if (BUILD_EXAMPLES)
|
||||
opm_compile_satellites (${project} examples "" "")
|
||||
endif (BUILD_EXAMPLES)
|
||||
|
||||
opm_compile_satellites (${project} additionals EXCLUDE_FROM_ALL "")
|
||||
|
||||
# attic are programs which are not quite abandoned yet; however, they
|
||||
# are not actively maintained, so they should not be a part of the
|
||||
# default compile
|
||||
opm_compile_satellites (${project} attic EXCLUDE_FROM_ALL "")
|
||||
|
||||
# infrastructure for testing
|
||||
enable_testing ()
|
||||
include (CTest)
|
||||
|
||||
# conditionally disable tests when features aren't available
|
||||
macro (cond_disable_test name)
|
||||
if ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
|
||||
message (STATUS "${name} test disabled, since ${name} is not found.")
|
||||
string (TOLOWER "${name}" name_lower)
|
||||
get_filename_component (test_${name}_FILE "tests/test_${name_lower}.cpp" ABSOLUTE)
|
||||
list (REMOVE_ITEM tests_SOURCES "${test_${name}_FILE}")
|
||||
endif ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
|
||||
endmacro (cond_disable_test name)
|
||||
|
||||
# use this target to run all tests, with parallel execution
|
||||
cmake_host_system_information(RESULT TESTJOBS QUERY NUMBER_OF_PHYSICAL_CORES)
|
||||
if(TESTJOBS EQUAL 0)
|
||||
set(TESTJOBS 1)
|
||||
endif()
|
||||
add_custom_target (check
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -j${TESTJOBS}
|
||||
DEPENDS test-suite
|
||||
COMMENT "Checking if library is functional"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# special processing for tests
|
||||
if (COMMAND tests_hook)
|
||||
tests_hook ()
|
||||
endif (COMMAND tests_hook)
|
||||
|
||||
# make datafiles necessary for tests available in output directory
|
||||
opm_data (tests datafiles "${tests_DIR}")
|
||||
if(NOT BUILD_TESTING)
|
||||
set(excl_all EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
opm_compile_satellites (${project} tests "${excl_all}" "${tests_REGEXP}")
|
||||
|
||||
# use this target to check local git commits
|
||||
add_custom_target(check-commits
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
|
||||
-DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}
|
||||
-P ${OPM_MACROS_ROOT}/cmake/Scripts/CheckCommits.cmake)
|
||||
|
||||
# generate documentation from source code with Doxygen;
|
||||
# setup install target for this documentation
|
||||
include (OpmDoc)
|
||||
opm_doc (${project} ${doxy_dir})
|
||||
|
||||
### clean in-source builds ###
|
||||
include (OpmDistClean)
|
||||
opm_dist_clean (${project})
|
||||
|
||||
### emulate the with-xxx feature of autotools;
|
||||
include (OpmKnown)
|
||||
|
||||
# make sure we rebuild if dune.module changes
|
||||
configure_file (
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/dune.module"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/dunemod.tmp"
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
# make sure updated version information is available in the source code
|
||||
include (UseVersion)
|
||||
|
||||
# update the cache for next run
|
||||
write_back_options ()
|
||||
246
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmPackage.cmake
vendored
Normal file
246
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmPackage.cmake
vendored
Normal file
@@ -0,0 +1,246 @@
|
||||
# - Find routine for OPM-like modules
|
||||
#
|
||||
# Synopsis:
|
||||
#
|
||||
# find_opm_package (module deps header lib defs prog conf)
|
||||
#
|
||||
# where
|
||||
#
|
||||
# module Name of the module, e.g. "dune-common"; this will be the
|
||||
# stem of all variables defined (see below).
|
||||
# deps Semi-colon-separated list of dependent modules which must
|
||||
# be present; those that are required must be marked as such
|
||||
# explicitly. Quote if more than one word is necessary to
|
||||
# describe the dependency.
|
||||
# header Name of the header file to probe for, e.g.
|
||||
# "dune/common/fvector.hh". Note that you should have to same
|
||||
# relative path here as is used in the header files.
|
||||
# lib Name of the library to probe for, e.g. "dunecommon"
|
||||
# defs Symbols that should be passed to compilations
|
||||
# prog Program that should compile if library is present
|
||||
# conf Symbols that should be present in config.h
|
||||
#
|
||||
# It will provide these standard Find-module variables:
|
||||
#
|
||||
# ${module}_INCLUDE_DIRS Directory of header files
|
||||
# ${module}_LIBRARIES Directory of shared object files
|
||||
# ${module}_DEFINITIONS Defines that must be set to compile
|
||||
# ${module}_CONFIG_VARS List of defines that should be in config.h
|
||||
# HAVE_${MODULE} Binary value to use in config.h
|
||||
#
|
||||
# Note: Arguments should be quoted, otherwise a list will spill into the
|
||||
# next argument!
|
||||
|
||||
# Copyright (C) 2012 Uni Research AS
|
||||
# This file is licensed under the GNU General Public License v3.0
|
||||
|
||||
# <http://www.vtk.org/Wiki/CMake:How_To_Find_Libraries>
|
||||
|
||||
include (OpmFind)
|
||||
include (OpmSiblingSearch)
|
||||
|
||||
# append all items from src into dst; both must be *names* of lists
|
||||
macro (append_found src dst)
|
||||
foreach (_item IN LISTS ${src})
|
||||
if (NOT "${_item}" MATCHES "-NOTFOUND$")
|
||||
list (APPEND ${dst} ${_item})
|
||||
endif (NOT "${_item}" MATCHES "-NOTFOUND$")
|
||||
endforeach (_item)
|
||||
endmacro (append_found src dst)
|
||||
|
||||
macro (find_opm_package module deps header lib defs prog conf)
|
||||
# in addition to accepting mod-ule_ROOT, we also accept the somewhat
|
||||
# more idiomatic MOD_ULE_ROOT variant
|
||||
string (TOUPPER "${module}" MODULE_UPPER)
|
||||
string (REPLACE "-" "_" MODULE "${MODULE_UPPER}")
|
||||
|
||||
# if someone else has included this test, don't do it again
|
||||
# one exception is opm-common which is already found in the
|
||||
# top most CMakeLists.txt but we still need to search for its
|
||||
# dependencies
|
||||
if (${MODULE}_FOUND OR ${module}_FOUND)
|
||||
return ()
|
||||
endif ()
|
||||
|
||||
# variables to pass on to other packages
|
||||
if (${module}_FIND_QUIETLY)
|
||||
set (_${module}_quiet "QUIET")
|
||||
else (${module}_FIND_QUIETLY)
|
||||
set (_${module}_quiet "")
|
||||
endif (${module}_FIND_QUIETLY)
|
||||
if (${module}_FIND_REQUIRED)
|
||||
set (_${module}_required "REQUIRED")
|
||||
else (${module}_FIND_REQUIRED)
|
||||
set (_${module}_required "")
|
||||
endif (${module}_FIND_REQUIRED)
|
||||
|
||||
create_module_dir_var(${module})
|
||||
|
||||
# This will also set all the needed variables with the exception of
|
||||
# ${module}_CONFIG_VARS for dune modules.
|
||||
find_package(${module} ${_${module}_quiet} ${_${module}_required} CONFIG)
|
||||
|
||||
if(NOT ${module}_DEPS)
|
||||
# set the dependencies used in find_package_deps
|
||||
set(${module}_DEPS "${deps}")
|
||||
endif()
|
||||
find_package_deps(${module})
|
||||
|
||||
# since find_and_append_package_to is a macro, this variable have
|
||||
# probably been overwritten (due to its common name); it is now
|
||||
# this module's last dependency instead of the name of the module
|
||||
# itself, so it must be restored
|
||||
string (TOUPPER "${module}" MODULE_UPPER)
|
||||
string (REPLACE "-" "_" MODULE "${MODULE_UPPER}")
|
||||
|
||||
# compile with this option to avoid avalanche of warnings
|
||||
set (${module}_DEFINITIONS "${${module}_DEFINITIONS}")
|
||||
foreach (_def IN ITEMS ${defs})
|
||||
list (APPEND ${module}_DEFINITIONS "-D${_def}")
|
||||
endforeach (_def)
|
||||
|
||||
# tidy the lists before returning them
|
||||
remove_dup_deps (${module})
|
||||
|
||||
# these defines are used in dune/${module} headers, and should be put
|
||||
# in config.h when we include those
|
||||
foreach (_var IN ITEMS ${conf})
|
||||
# massage the name to remove source code formatting
|
||||
string (REGEX REPLACE "^[\n\t\ ]+" "" _var "${_var}")
|
||||
string (REGEX REPLACE "[\n\t\ ]+$" "" _var "${_var}")
|
||||
list (APPEND ${module}_CONFIG_VARS ${_var})
|
||||
endforeach (_var)
|
||||
|
||||
# these are the defines that should be set when compiling
|
||||
# without config.h
|
||||
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
|
||||
|
||||
if(prog)
|
||||
# check that we can compile a small test-program
|
||||
include (CMakePushCheckState)
|
||||
cmake_push_check_state ()
|
||||
include (CheckCXXSourceCompiles)
|
||||
# only add these if they are actually found; otherwise it won't
|
||||
# compile and the variable won't be set
|
||||
append_found (${module}_INCLUDE_DIRS CMAKE_REQUIRED_INCLUDES)
|
||||
append_found (${module}_LIBRARIES CMAKE_REQUIRED_LIBRARIES)
|
||||
# since we don't have any config.h yet
|
||||
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_DEFINITIONS})
|
||||
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_CMD_CONFIG})
|
||||
check_cxx_source_compiles ("${prog}" HAVE_${MODULE})
|
||||
cmake_pop_check_state ()
|
||||
else(prog)
|
||||
if(${module}_FOUND)
|
||||
# No test code provided, mark compilation as successful
|
||||
# if module was founf
|
||||
set(HAVE_${MODULE} 1)
|
||||
endif(${module}_FOUND)
|
||||
endif(prog)
|
||||
|
||||
# write status message in the same manner as everyone else
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (
|
||||
${module}
|
||||
DEFAULT_MSG
|
||||
${module}_INCLUDE_DIRS ${module}_LIBRARIES ${module}_FOUND ${module}_ALL_PREREQS HAVE_${MODULE}
|
||||
)
|
||||
|
||||
# some genius that coded the FindPackageHandleStandardArgs figured out
|
||||
# that the module name should be in uppercase (?!)
|
||||
set (${module}_FOUND "${${MODULE_UPPER}_FOUND}")
|
||||
set (${MODULE}_FOUND "${${MODULE_UPPER}_FOUND}")
|
||||
|
||||
# This variable is used by UseDuneVer
|
||||
list(GET ${module}_INCLUDE_DIRS 0 ${module}_INCLUDE_DIR)
|
||||
# print everything out if we're asked to
|
||||
if (${module}_DEBUG)
|
||||
debug_find_vars (${module})
|
||||
endif (${module}_DEBUG)
|
||||
endmacro (find_opm_package module deps header lib defs prog conf)
|
||||
|
||||
macro (find_package_deps module)
|
||||
# period because it should be something that evaluates to true
|
||||
# in find_package_handle_standard_args
|
||||
set (${module}_ALL_PREREQS ".")
|
||||
foreach (_dep IN ITEMS ${${module}_DEPS})
|
||||
separate_arguments (_${module}_args UNIX_COMMAND "${_dep}")
|
||||
if (_${module}_args)
|
||||
# keep REQUIRED in the arguments only if we were required ourself
|
||||
# "required-ness" is not transitive as far as CMake is concerned
|
||||
# (i.e. if an optional package requests a package to be required,
|
||||
# the build will fail if it's not found)
|
||||
string (REPLACE "REQUIRED" "${_${module}_required}" _args_req "${_${module}_args}")
|
||||
if(_dep MATCHES "opm-")
|
||||
set(deplist ${_dep})
|
||||
string(STRIP "${_dep}" _dep)
|
||||
string(REPLACE " " ";" deplist "${_dep}")
|
||||
list(GET deplist 0 depname)
|
||||
create_module_dir_var(${depname})
|
||||
endif()
|
||||
find_and_append_package_to (${module} ${_${module}_args} ${_${module}_quiet})
|
||||
list (GET _${module}_args 0 _name_only)
|
||||
string (TOUPPER "${_name_only}" _NAME_ONLY)
|
||||
string (REPLACE "-" "_" _NAME_ONLY "${_NAME_ONLY}")
|
||||
# check manually if it was found if REQUIRED; otherwise poison the
|
||||
# dependency list which is checked later (so that it will fail)
|
||||
if (("${_${module}_args}" MATCHES "REQUIRED") AND NOT (${_name_only}_FOUND OR ${_NAME_ONLY}_FOUND))
|
||||
list (APPEND ${module}_ALL_PREREQS "${_name_only}-NOTFOUND")
|
||||
endif ()
|
||||
else ()
|
||||
message (WARNING "Empty dependency in find module for ${module} (check for trailing semi-colon)")
|
||||
endif ()
|
||||
endforeach (_dep)
|
||||
|
||||
# tidy the lists before returning them
|
||||
remove_dup_deps (${module})
|
||||
|
||||
# these defines are used in dune/${module} headers, and should be put
|
||||
# in config.h when we include those
|
||||
foreach (_var IN ITEMS ${conf})
|
||||
# massage the name to remove source code formatting
|
||||
string (REGEX REPLACE "^[\n\t\ ]+" "" _var "${_var}")
|
||||
string (REGEX REPLACE "[\n\t\ ]+$" "" _var "${_var}")
|
||||
list (APPEND ${module}_CONFIG_VARS ${_var})
|
||||
endforeach (_var)
|
||||
|
||||
# these are the defines that should be set when compiling
|
||||
# without config.h
|
||||
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
|
||||
|
||||
# This variable is used by UseDuneVer
|
||||
#list(GET ${module}_INCLUDE_DIRS 0 ${module}_INCLUDE_DIR)
|
||||
# print everything out if we're asked to
|
||||
if (${module}_DEBUG)
|
||||
debug_find_vars (${module})
|
||||
endif (${module}_DEBUG)
|
||||
endmacro ()
|
||||
|
||||
# print all variables defined by the above macro
|
||||
function (debug_find_vars module)
|
||||
message (STATUS "${module}_FOUND = ${${module}_FOUND}")
|
||||
message (STATUS "${module}_INCLUDE_DIRS = ${${module}_INCLUDE_DIRS}")
|
||||
message (STATUS "${module}_LIBRARIES = ${${module}_LIBRARIES}")
|
||||
message (STATUS "${module}_DEFINITIONS = ${${module}_DEFINITIONS}")
|
||||
message (STATUS "${module}_CONFIG_VARS = ${${module}_CONFIG_VARS}")
|
||||
message (STATUS "${module}_LINKER_FLAGS = ${${module}_LINKER_FLAGS}")
|
||||
string (TOUPPER ${module} MODULE)
|
||||
string (REPLACE "-" "_" MODULE ${MODULE})
|
||||
message (STATUS "HAVE_${MODULE} = ${HAVE_${MODULE}}")
|
||||
endfunction (debug_find_vars module)
|
||||
|
||||
# generate a command-line that can be used to pass variables before
|
||||
# config.h is available (such as probe tests). varname is the *name*
|
||||
# of the variable to receive the result, defs is a list of the *names*
|
||||
# which should be passed
|
||||
function (config_cmd_line varname defs)
|
||||
# process each variable
|
||||
foreach (_var IN LISTS ${defs})
|
||||
# only generate an entry if the define was actually set
|
||||
if ((DEFINED ${_var}) AND (NOT "${${_var}}" STREQUAL ""))
|
||||
# add command-line option to define this variable
|
||||
list (APPEND _cmdline "-D${_var}=${${_var}}")
|
||||
endif ((DEFINED ${_var}) AND (NOT "${${_var}}" STREQUAL ""))
|
||||
endforeach (_var)
|
||||
# return the resulting command-line options for defining vars
|
||||
set (${varname} "${_cmdline}" PARENT_SCOPE)
|
||||
endfunction (config_cmd_line)
|
||||
168
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmProject.cmake
vendored
Normal file
168
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmProject.cmake
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
# - Helper routines for opm-core like projects
|
||||
|
||||
include (LibtoolArchives) # linker_cmdline
|
||||
|
||||
# convert a list back to a command-line string
|
||||
function (unseparate_args var_name prefix value)
|
||||
separate_arguments (value)
|
||||
foreach (item IN LISTS value)
|
||||
set (prefixed_item "${prefix}${item}")
|
||||
if (${var_name})
|
||||
set (${var_name} "${${var_name}} ${prefixed_item}")
|
||||
else (${var_name})
|
||||
set (${var_name} "${prefixed_item}")
|
||||
endif (${var_name})
|
||||
endforeach (item)
|
||||
set (${var_name} "${${var_name}}" PARENT_SCOPE)
|
||||
endfunction (unseparate_args var_name prefix value)
|
||||
|
||||
# wrapper to set variables in pkg-config file
|
||||
function (configure_pc_file name source dest prefix libdir includedir)
|
||||
# escape set of standard strings
|
||||
unseparate_args (includes "-I" "${${name}_INCLUDE_DIRS}")
|
||||
unseparate_args (defs "" "${${name}_DEFINITIONS}")
|
||||
linker_cmdline (STRING INTO libs FROM ${${name}_LIBRARIES})
|
||||
|
||||
# necessary to make these variables visible to configure_file
|
||||
set (name "${${name}_NAME}")
|
||||
set (description "${${name}_DESCRIPTION}")
|
||||
set (major "${${name}_VERSION_MAJOR}")
|
||||
set (minor "${${name}_VERSION_MINOR}")
|
||||
set (target "${${name}_LIBRARY}")
|
||||
linker_cmdline (STRING INTO target from ${target})
|
||||
|
||||
configure_file (${source} ${dest} @ONLY)
|
||||
endfunction (configure_pc_file name source dist prefix libdir includedir)
|
||||
|
||||
function (configure_cmake_file name variant version)
|
||||
# declarative list of the variable names that are used in the template
|
||||
# and that must be defined in the project to be exported
|
||||
set (variable_suffices
|
||||
DESCRIPTION
|
||||
VERSION
|
||||
DEFINITIONS
|
||||
INCLUDE_DIRS
|
||||
LIBRARY_DIRS
|
||||
LINKER_FLAGS
|
||||
CONFIG_VARS
|
||||
LIBRARY
|
||||
LIBRARIES
|
||||
TARGET
|
||||
)
|
||||
|
||||
# set these variables temporarily (this is in a function scope) so
|
||||
# they are available to the template (only)
|
||||
foreach (suffix IN LISTS variable_suffices)
|
||||
set (opm-project_${suffix} "${${name}_${suffix}}")
|
||||
endforeach (suffix)
|
||||
set (opm-project_NAME "${${name}_NAME}")
|
||||
set (opm-project_NAME_UC "${${name}_NAME}")
|
||||
string(TOUPPER "${opm-project_NAME}" opm-project_NAME_UC)
|
||||
string(REPLACE "-" "_" opm-project_NAME_UC "${opm-project_NAME_UC}")
|
||||
|
||||
# make the file substitutions
|
||||
configure_file (
|
||||
${template_dir}/opm-project-config${version}.cmake.in
|
||||
${PROJECT_BINARY_DIR}/${${name}_NAME}-${variant}${version}.cmake
|
||||
@ONLY
|
||||
)
|
||||
endfunction (configure_cmake_file name)
|
||||
|
||||
# installation of CMake modules to help user programs locate the library
|
||||
function (opm_cmake_config name)
|
||||
# assume that the template is located in cmake/Templates (cannot use
|
||||
# the current directory since this is in a function and the directory
|
||||
# at runtime not at definition will be used
|
||||
set (template_dir "${OPM_MACROS_ROOT}/cmake/Templates")
|
||||
|
||||
# write configuration file to locate library
|
||||
set(DUNE_PREFIX ${PROJECT_SOURCE_DIR})
|
||||
set(OPM_PROJECT_EXTRA_CODE ${OPM_PROJECT_EXTRA_CODE_INTREE})
|
||||
set(PREREQ_LOCATION "${PROJECT_SOURCE_DIR}")
|
||||
configure_cmake_file (${name} "config" "")
|
||||
configure_cmake_file (${name} "config" "-version")
|
||||
configure_vars (
|
||||
FILE CMAKE "${PROJECT_BINARY_DIR}/${${name}_NAME}-config.cmake"
|
||||
APPEND "${${name}_CONFIG_VARS}"
|
||||
)
|
||||
|
||||
# config-mode .pc file; use this to find the build tree
|
||||
configure_pc_file (
|
||||
${name}
|
||||
${template_dir}/opm-project.pc.in
|
||||
${PROJECT_BINARY_DIR}/${${name}_NAME}.pc
|
||||
${PROJECT_BINARY_DIR}
|
||||
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
|
||||
${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
# The next replace will result in bogus entries if install directory is
|
||||
# a subdirectory of source tree,
|
||||
# and we have existing entries pointing to that install directory.
|
||||
# Since they will yield a duplicate in next replace anyways, we filter them out first
|
||||
# to get avoid those the bogus entries.
|
||||
string(REPLACE "${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}" "" ${name}_INCLUDE_DIRS "${${name}_INCLUDE_DIRS}")
|
||||
|
||||
# replace the build directory with the target directory in the
|
||||
# variables that contains build paths
|
||||
string (REPLACE
|
||||
"${PROJECT_SOURCE_DIR}"
|
||||
"${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}"
|
||||
${name}_INCLUDE_DIRS
|
||||
"${${name}_INCLUDE_DIRS}"
|
||||
)
|
||||
string (REPLACE
|
||||
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
|
||||
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${${name}_VER_DIR}"
|
||||
${name}_LIBRARY
|
||||
"${${name}_LIBRARY}"
|
||||
)
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY
|
||||
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${${name}_VER_DIR}"
|
||||
)
|
||||
# create a config mode file which targets the install directory instead
|
||||
# of the build directory (using the same input template)
|
||||
set(OPM_PROJECT_EXTRA_CODE ${OPM_PROJECT_EXTRA_CODE_INSTALLED})
|
||||
set(PREREQ_LOCATION "${CMAKE_INSTALL_PREFIX}/share/opm/cmake/Modules")
|
||||
set(DUNE_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
configure_cmake_file (${name} "install" "")
|
||||
configure_vars (
|
||||
FILE CMAKE "${PROJECT_BINARY_DIR}/${${name}_NAME}-install.cmake"
|
||||
APPEND "${${name}_CONFIG_VARS}"
|
||||
)
|
||||
# this file gets copied to the final installation directory
|
||||
install (
|
||||
FILES ${PROJECT_BINARY_DIR}/${${name}_NAME}-install.cmake
|
||||
DESTINATION share/cmake${${name}_VER_DIR}/${${name}_NAME}
|
||||
RENAME ${${name}_NAME}-config.cmake
|
||||
)
|
||||
# assume that there exists a version file already
|
||||
install (
|
||||
FILES ${PROJECT_BINARY_DIR}/${${name}_NAME}-config-version.cmake
|
||||
DESTINATION share/cmake${${name}_VER_DIR}/${${name}_NAME}
|
||||
)
|
||||
|
||||
# find-mode .pc file; use this to locate system installation
|
||||
configure_pc_file (
|
||||
${name}
|
||||
${template_dir}/opm-project.pc.in
|
||||
${PROJECT_BINARY_DIR}/${${name}_NAME}-install.pc
|
||||
${CMAKE_INSTALL_PREFIX}
|
||||
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${${name}_VER_DIR}
|
||||
${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}
|
||||
)
|
||||
|
||||
# put this in the right system location; if we have binaries then it
|
||||
# should go in the arch-specific lib/ directory, otherwise use the
|
||||
# common/noarch lib/ directory (these targets come from UseMultiArch)
|
||||
if (${name}_TARGET)
|
||||
set (_pkg_dir ${CMAKE_INSTALL_LIBDIR})
|
||||
else ()
|
||||
set (_pkg_dir lib)
|
||||
endif ()
|
||||
install (
|
||||
FILES ${PROJECT_BINARY_DIR}/${${name}_NAME}-install.pc
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${_pkg_dir}/pkgconfig${${name}_VER_DIR}/
|
||||
RENAME ${${name}_NAME}.pc
|
||||
)
|
||||
endfunction (opm_cmake_config name)
|
||||
7
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmPythonTest.cmake
vendored
Normal file
7
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmPythonTest.cmake
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
function (opm_add_python_test TEST_NAME TEST_SCRIPT)
|
||||
add_test(NAME ${TEST_NAME}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMAND ${TEST_SCRIPT} ${ARGN})
|
||||
|
||||
set_property(TEST ${TEST_NAME} PROPERTY ENVIRONMENT "PYTHONPATH=${ERT_PYTHON_PATH}:${CWRAP_PYTHON_PATH}:${PYTHONPATH}")
|
||||
endfunction(opm_add_python_test)
|
||||
385
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmSatellites.cmake
vendored
Normal file
385
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmSatellites.cmake
vendored
Normal file
@@ -0,0 +1,385 @@
|
||||
# - Build satellites that are dependent of main library
|
||||
|
||||
#
|
||||
# Enumerate all source code in a "satellite" directory such as tests/,
|
||||
# compile each of them and optionally set them as a test for CTest to
|
||||
# run. They will be linked to the main library created by the project.
|
||||
#
|
||||
# The following suffices must be defined for the opm prefix passed as
|
||||
# parameter:
|
||||
#
|
||||
# _LINKER_FLAGS Necessary flags to link with this library
|
||||
# _TARGET CMake target which creates the library
|
||||
# _LIBRARIES Other dependencies that must also be linked
|
||||
|
||||
# Synopsis:
|
||||
# opm_compile_satellites (opm satellite excl_all test_regexp)
|
||||
#
|
||||
# Parameters:
|
||||
# opm Prefix of the variable which contain information
|
||||
# about the library these satellites depends on, e.g.
|
||||
# pass "opm-core" if opm-core_TARGET is the name of
|
||||
# the target the builds this library. Variables with
|
||||
# suffixes _TARGET and _LIBRARIES must exist.
|
||||
#
|
||||
# satellite Prefix of variable which contain the names of the
|
||||
# files, e.g. pass "tests" if the files are in the
|
||||
# variable tests_SOURCES. Variables with suffixes
|
||||
# _DATAFILES, _SOURCES and _DIR should exist. This
|
||||
# name is also used as name of the target that builds
|
||||
# all these files.
|
||||
#
|
||||
# excl_all EXCLUDE_FROM_ALL if these targets should not be built by
|
||||
# default, otherwise empty string.
|
||||
#
|
||||
# test_regexp Regular expression which picks the name of a test
|
||||
# out of the filename, or blank if no test should be
|
||||
# setup.
|
||||
#
|
||||
# Example:
|
||||
# opm_compile_satellites (opm-core test "" "^test_([^/]*)$")
|
||||
#
|
||||
macro (opm_compile_satellites opm satellite excl_all test_regexp)
|
||||
# if we are going to build the tests always, then make sure that
|
||||
# the datafiles are present too
|
||||
if (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
||||
set (_incl_all "ALL")
|
||||
else (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
||||
set (_incl_all "")
|
||||
endif (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
||||
|
||||
# if a set of datafiles has been setup, pull those in
|
||||
add_custom_target (${satellite} ${_incl_all})
|
||||
if (${satellite}_DATAFILES)
|
||||
add_dependencies (${satellite} ${${satellite}_DATAFILES})
|
||||
endif (${satellite}_DATAFILES)
|
||||
|
||||
# compile each of these separately
|
||||
foreach (_sat_FILE IN LISTS ${satellite}_SOURCES)
|
||||
if (NOT "${test_regexp}" STREQUAL "" AND NOT Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
||||
continue()
|
||||
endif()
|
||||
get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)
|
||||
add_executable (${_sat_NAME} ${excl_all} ${_sat_FILE})
|
||||
add_dependencies (${satellite} ${_sat_NAME})
|
||||
set_target_properties (${_sat_NAME} PROPERTIES
|
||||
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}")
|
||||
if(HAVE_DYNAMIC_BOOST_TEST)
|
||||
set_target_properties (${_sat_NAME} PROPERTIES
|
||||
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
# are we building a test? luckily, the testing framework doesn't
|
||||
# require anything else, so we don't have to figure out where it
|
||||
# should go in the library list
|
||||
if (NOT "${test_regexp}" STREQUAL "")
|
||||
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
|
||||
else (NOT "${test_regexp}" STREQUAL "")
|
||||
set (_test_lib "")
|
||||
add_static_analysis_tests(_sat_FILE ${opm}_INCLUDE_DIRS)
|
||||
endif (NOT "${test_regexp}" STREQUAL "")
|
||||
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
|
||||
if (STRIP_DEBUGGING_SYMBOLS)
|
||||
strip_debug_symbols (${_sat_NAME} _sat_DEBUG)
|
||||
list (APPEND ${satellite}_DEBUG ${_sat_DEBUG})
|
||||
endif()
|
||||
|
||||
# variable with regular expression doubles as a flag for
|
||||
# whether tests should be setup or not
|
||||
set(_sat_FANCY)
|
||||
if (NOT "${test_regexp}" STREQUAL "")
|
||||
foreach (_regexp IN ITEMS ${test_regexp})
|
||||
if ("${_sat_NAME}" MATCHES "${_regexp}")
|
||||
string (REGEX REPLACE "${_regexp}" "\\1" _sat_FANCY "${_sat_NAME}")
|
||||
elseif(NOT _sat_FANCY)
|
||||
set(_sat_FANCY ${_sat_NAME})
|
||||
endif()
|
||||
endforeach (_regexp)
|
||||
get_target_property (_sat_LOC ${_sat_NAME} LOCATION)
|
||||
# Run tests through mpi-run. Ubuntu 14.04 provided mpi libs will crash
|
||||
# in the MPI_Finalize() call otherwise.
|
||||
if(MPI_FOUND)
|
||||
set(_sat_LOC ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${_sat_LOC})
|
||||
endif()
|
||||
if (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||
add_test (NAME ${_sat_FANCY}
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_BINARY_DIR}/${${satellite}_DIR}" ${_sat_LOC})
|
||||
else (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||
add_test (${_sat_FANCY} ${_sat_LOC})
|
||||
# run the test in the directory where the data files are
|
||||
set_tests_properties (${_sat_FANCY} PROPERTIES
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${${satellite}_DIR})
|
||||
endif (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||
if(NOT TARGET test-suite)
|
||||
add_custom_target(test-suite)
|
||||
endif()
|
||||
add_dependencies(test-suite "${_sat_NAME}")
|
||||
endif(NOT "${test_regexp}" STREQUAL "")
|
||||
|
||||
# if this program on the list of files that should be distributed?
|
||||
# we check by the name of the source file
|
||||
list (FIND ${satellite}_SOURCES_DIST "${_sat_FILE}" _is_util)
|
||||
if (NOT (_is_util EQUAL -1))
|
||||
install (TARGETS ${_sat_NAME} RUNTIME
|
||||
DESTINATION bin${${opm}_VER_DIR}/)
|
||||
endif (NOT (_is_util EQUAL -1))
|
||||
endforeach (_sat_FILE)
|
||||
endmacro (opm_compile_satellites opm prefix)
|
||||
|
||||
# Synopsis:
|
||||
# opm_data (satellite target dirname files)
|
||||
#
|
||||
# provides these output variables:
|
||||
#
|
||||
# ${satellite}_INPUT_FILES List of all files that are copied
|
||||
# ${satellite}_DATAFILES Name of target which copies these files
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# opm_data (tests datafiles "tests/")
|
||||
#
|
||||
macro (opm_data satellite target dirname)
|
||||
# even if there are no datafiles, create the directory so the
|
||||
# satellite programs have a homedir to run in
|
||||
execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${dirname})
|
||||
|
||||
# if ever huge test datafiles are necessary, then change this
|
||||
# into "create_symlink" (on UNIX only, apparently)
|
||||
set (make_avail "copy")
|
||||
|
||||
# provide datafiles as inputs for the tests, by copying them
|
||||
# to a tests/ directory in the output tree (if different)
|
||||
set (${satellite}_INPUT_FILES)
|
||||
if (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||
foreach (input_datafile IN LISTS ${satellite}_DATA)
|
||||
if (IS_ABSOLUTE ${input_datafile})
|
||||
file (RELATIVE_PATH rel_datafile "${PROJECT_SOURCE_DIR}" ${input_datafile})
|
||||
else()
|
||||
set(rel_datafile ${input_datafile})
|
||||
endif()
|
||||
set (output_datafile "${PROJECT_BINARY_DIR}/${rel_datafile}")
|
||||
add_custom_command (OUTPUT ${output_datafile}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
ARGS -E ${make_avail} ${input_datafile} ${output_datafile}
|
||||
DEPENDS ${input_datafile}
|
||||
VERBATIM)
|
||||
list (APPEND ${satellite}_INPUT_FILES "${output_datafile}")
|
||||
endforeach (input_datafile)
|
||||
endif(NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||
|
||||
# setup a target which does all the copying
|
||||
set (${satellite}_DATAFILES "${target}")
|
||||
add_custom_target (${${satellite}_DATAFILES}
|
||||
DEPENDS ${${satellite}_INPUT_FILES}
|
||||
COMMENT "Making \"${satellite}\" data available in output tree")
|
||||
if(NOT TARGET test-suite)
|
||||
add_custom_target(test-suite)
|
||||
endif()
|
||||
add_dependencies(test-suite ${${satellite}_DATAFILES})
|
||||
endmacro (opm_data satellite target dirname files)
|
||||
|
||||
# Add a single unit test (can be orchestrated by the 'ctest' command)
|
||||
#
|
||||
# Synopsis:
|
||||
# opm_add_test(TestName)
|
||||
#
|
||||
# Parameters:
|
||||
# TestName Name of test
|
||||
# ONLY_COMPILE Only build test but do not run it (optional)
|
||||
# DEFAULT_ENABLE_IF Only enable by default if a given condition is true (optional)
|
||||
# ALWAYS_ENABLE Force enabling test even if -DBUILD_TESTING=OFF was set (optional)
|
||||
# EXE_NAME Name of test executable (optional, default: ./bin/${TestName})
|
||||
# CONDITION Condition to enable test (optional, cmake code)
|
||||
# DEPENDS Targets which the test depends on (optional)
|
||||
# DRIVER The script which supervises the test (optional, default: ${OPM_TEST_DRIVER})
|
||||
# DRIVER_ARGS The script which supervises the test (optional, default: ${OPM_TEST_DRIVER_ARGS})
|
||||
# TEST_ARGS Arguments to pass to test's binary (optional, default: empty)
|
||||
# SOURCES Source files for the test (optional, default: ${EXE_NAME}.cpp)
|
||||
# PROCESSORS Number of processors to run test on (optional, default: 1)
|
||||
# TEST_DEPENDS Other tests which must be run before running this test (optional, default: None)
|
||||
# LIBRARIES Libraries to link test against (optional)
|
||||
# WORKING_DIRECTORY Working directory for test (optional, default: ${PROJECT_BINARY_DIR})
|
||||
# CONFIGURATION Configuration to add test to
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# opm_add_test(funky_test
|
||||
# ALWAYS_ENABLE
|
||||
# CONDITION FUNKY_GRID_FOUND
|
||||
# SOURCES tests/MyFunkyTest.cpp
|
||||
# LIBRARIES -lgmp -lm)
|
||||
include(CMakeParseArguments)
|
||||
|
||||
macro(opm_add_test TestName)
|
||||
cmake_parse_arguments(CURTEST
|
||||
"NO_COMPILE;ONLY_COMPILE;ALWAYS_ENABLE" # flags
|
||||
"EXE_NAME;PROCESSORS;WORKING_DIRECTORY;CONFIGURATION" # one value args
|
||||
"CONDITION;DEFAULT_ENABLE_IF;TEST_DEPENDS;DRIVER;DRIVER_ARGS;DEPENDS;TEST_ARGS;SOURCES;LIBRARIES" # multi-value args
|
||||
${ARGN})
|
||||
|
||||
set(BUILD_TESTING "${BUILD_TESTING}")
|
||||
|
||||
# set the default values for optional parameters
|
||||
if (NOT CURTEST_EXE_NAME)
|
||||
set(CURTEST_EXE_NAME ${TestName})
|
||||
endif()
|
||||
|
||||
# Strip test_ prefix from name
|
||||
if ("${TestName}" MATCHES "^test_([^/]*)$")
|
||||
string (REGEX REPLACE "^test_([^/]*)$" "\\1" _FANCY "${TestName}")
|
||||
else()
|
||||
set(_FANCY ${TestName})
|
||||
endif()
|
||||
|
||||
# try to auto-detect the name of the source file if SOURCES are not
|
||||
# explicitly specified.
|
||||
if (NOT CURTEST_SOURCES)
|
||||
set(CURTEST_SOURCES "")
|
||||
set(_SDir "${PROJECT_SOURCE_DIR}")
|
||||
foreach(CURTEST_CANDIDATE "${CURTEST_EXE_NAME}.cpp"
|
||||
"${CURTEST_EXE_NAME}.cc"
|
||||
"tests/${CURTEST_EXE_NAME}.cpp"
|
||||
"tests/${CURTEST_EXE_NAME}.cc")
|
||||
if (EXISTS "${_SDir}/${CURTEST_CANDIDATE}")
|
||||
set(CURTEST_SOURCES "${_SDir}/${CURTEST_CANDIDATE}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# the default working directory is the content of
|
||||
# OPM_TEST_DEFAULT_WORKING_DIRECTORY or the source directory if this
|
||||
# is unspecified
|
||||
if (NOT CURTEST_WORKING_DIRECTORY)
|
||||
if (OPM_TEST_DEFAULT_WORKING_DIRECTORY)
|
||||
set(CURTEST_WORKING_DIRECTORY ${OPM_TEST_DEFAULT_WORKING_DIRECTORY})
|
||||
else()
|
||||
set(CURTEST_WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# don't build the tests by _default_ if BUILD_TESTING is false,
|
||||
# i.e., when typing 'make' the tests are not build in that
|
||||
# case. They can still be build using 'make test-suite' and they can
|
||||
# be build and run using 'make check'
|
||||
set(CURTEST_EXCLUDE_FROM_ALL "")
|
||||
if (NOT "AND OR ${CURTEST_DEFAULT_ENABLE_IF}" STREQUAL "AND OR ")
|
||||
if (NOT ${CURTEST_DEFAULT_ENABLE_IF})
|
||||
set(CURTEST_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
|
||||
endif()
|
||||
endif()
|
||||
if (NOT BUILD_TESTING AND NOT CURTEST_ALWAYS_ENABLE)
|
||||
set(CURTEST_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
|
||||
endif()
|
||||
|
||||
# figure out the test driver script and its arguments. (the variable
|
||||
# for the driver script may be empty. In this case the binary is run
|
||||
# "bare metal".)
|
||||
if (NOT CURTEST_DRIVER)
|
||||
set(CURTEST_DRIVER "${OPM_TEST_DRIVER}")
|
||||
endif()
|
||||
if (NOT CURTEST_DRIVER_ARGS)
|
||||
set(CURTEST_DRIVER_ARGS "${OPM_TEST_DRIVER_ARGS}")
|
||||
endif()
|
||||
|
||||
# the libraries to link against
|
||||
if (NOT CURTEST_LIBRARIES)
|
||||
SET(CURTEST_LIBRARIES "${${project}_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
# determine if the test should be completely ignored, i.e., the
|
||||
# CONDITION argument evaluates to false. the "AND OR " is a hack
|
||||
# which is required to prevent CMake from evaluating the condition
|
||||
# in the string. (which might evaluate to an empty string even
|
||||
# though "${CURTEST_CONDITION}" is not empty.)
|
||||
if ("AND OR ${CURTEST_CONDITION}" STREQUAL "AND OR ")
|
||||
set(SKIP_CUR_TEST "0")
|
||||
elseif(${CURTEST_CONDITION})
|
||||
set(SKIP_CUR_TEST "0")
|
||||
else()
|
||||
set(SKIP_CUR_TEST "1")
|
||||
endif()
|
||||
|
||||
if (NOT SKIP_CUR_TEST)
|
||||
if (CURTEST_ONLY_COMPILE)
|
||||
# only compile the binary but do not run it as a test
|
||||
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
|
||||
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
|
||||
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
|
||||
add_static_analysis_tests(CURTEST_SOURCES dirs)
|
||||
|
||||
if(TARGET ${project}_prepare)
|
||||
add_dependencies("${CURTEST_EXE_NAME}" ${project}_prepare)
|
||||
endif()
|
||||
if(CURTEST_DEPENDS)
|
||||
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
|
||||
endif()
|
||||
else()
|
||||
if (NOT CURTEST_NO_COMPILE)
|
||||
# in addition to being run, the test must be compiled. (the
|
||||
# run-only case occurs if the binary is already compiled by an
|
||||
# earlier test.)
|
||||
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
|
||||
if(HAVE_DYNAMIC_BOOST_TEST)
|
||||
set_target_properties (${CURTEST_EXE_NAME} PROPERTIES
|
||||
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
|
||||
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
|
||||
add_static_analysis_tests(CURTEST_SOURCES dirs)
|
||||
|
||||
if(CURTEST_DEPENDS)
|
||||
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
|
||||
endif()
|
||||
if(TARGET ${project}_prepare)
|
||||
add_dependencies("${CURTEST_EXE_NAME}" ${project}_prepare)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# figure out how the test should be run. if a test driver script
|
||||
# has been specified to supervise the test binary, use it else
|
||||
# run the test binary "naked".
|
||||
if (CURTEST_DRIVER)
|
||||
set(CURTEST_COMMAND ${CURTEST_DRIVER} ${CURTEST_DRIVER_ARGS} ${CURTEST_EXE_NAME} ${CURTEST_TEST_ARGS})
|
||||
else()
|
||||
set(CURTEST_COMMAND ${PROJECT_BINARY_DIR}/bin/${CURTEST_EXE_NAME})
|
||||
if (CURTEST_TEST_ARGS)
|
||||
list(APPEND CURTEST_COMMAND ${CURTEST_TEST_ARGS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_test(NAME ${_FANCY}
|
||||
WORKING_DIRECTORY "${CURTEST_WORKING_DIRECTORY}"
|
||||
COMMAND ${CURTEST_COMMAND}
|
||||
CONFIGURATIONS ${CURTEST_CONFIGURATION})
|
||||
|
||||
# specify the dependencies between the tests
|
||||
if (CURTEST_TEST_DEPENDS)
|
||||
set_tests_properties(${_FANCY} PROPERTIES DEPENDS "${CURTEST_TEST_DEPENDS}")
|
||||
endif()
|
||||
|
||||
# tell ctest how many cores it should reserve to run the test
|
||||
if (CURTEST_PROCESSORS)
|
||||
set_tests_properties(${_FANCY} PROPERTIES PROCESSORS "${CURTEST_PROCESSORS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT CURTEST_NO_COMPILE)
|
||||
if(NOT TARGET test-suite)
|
||||
add_custom_target(test-suite)
|
||||
endif()
|
||||
add_dependencies(test-suite "${CURTEST_EXE_NAME}")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# macro to set the default test driver script and the its default
|
||||
# arguments
|
||||
macro(opm_set_test_driver DriverBinary DriverDefaultArgs)
|
||||
set(OPM_TEST_DRIVER "${DriverBinary}")
|
||||
set(OPM_TEST_DRIVER_ARGS "${DriverDefaultArgs}")
|
||||
endmacro()
|
||||
|
||||
# macro to set the default test driver script and the its default
|
||||
# arguments
|
||||
macro(opm_set_test_default_working_directory Dir)
|
||||
set(OPM_TEST_DEFAULT_WORKING_DIRECTORY "${Dir}")
|
||||
endmacro()
|
||||
32
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmSiblingSearch.cmake
vendored
Normal file
32
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmSiblingSearch.cmake
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
option (SIBLING_SEARCH "Search sibling directories before system paths" ON)
|
||||
mark_as_advanced (SIBLING_SEARCH)
|
||||
|
||||
macro(create_module_dir_var module)
|
||||
if(SIBLING_SEARCH AND NOT ${module}_DIR)
|
||||
# guess the sibling dir
|
||||
get_filename_component(_leaf_dir_name ${PROJECT_BINARY_DIR} NAME)
|
||||
get_filename_component(_parent_full_dir ${PROJECT_BINARY_DIR} DIRECTORY)
|
||||
get_filename_component(_parent_dir_name ${_parent_full_dir} NAME)
|
||||
#Try if <module-name>/<build-dir> is used
|
||||
get_filename_component(_modules_dir ${_parent_full_dir} DIRECTORY)
|
||||
set(_clone_dir "${module}")
|
||||
if(IS_DIRECTORY ${_modules_dir}/${_clone_dir}/${_leaf_dir_name})
|
||||
set(${module}_DIR ${_modules_dir}/${_clone_dir}/${_leaf_dir_name})
|
||||
else()
|
||||
string(REPLACE ${PROJECT_NAME} ${_clone_dir} _module_leaf ${_leaf_dir_name})
|
||||
if(NOT _leaf_dir_name STREQUAL _module_leaf
|
||||
AND IS_DIRECTORY ${_parent_full_dir}/${_module_leaf})
|
||||
# We are using build directories named <prefix><module-name><postfix>
|
||||
set(${module}_DIR ${_parent_full_dir}/${_module_leaf})
|
||||
elseif(IS_DIRECTORY ${_parent_full_dir}/${_clone_dir} AND
|
||||
EXISTS ${_parent_full_dir}/${_clone_dir}/CMakeCache.txt)
|
||||
# All modules are in a common build dir
|
||||
set(${module}_DIR "${_parent_full_dir}/${_clone_dir}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(${module}_DIR AND NOT IS_DIRECTORY ${${module}_DIR})
|
||||
message(WARNING "Value ${${module}_DIR} passed to variable"
|
||||
" ${module}_DIR is not a directory")
|
||||
endif()
|
||||
endmacro()
|
||||
103
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmStaticTargets.cmake
vendored
Normal file
103
ThirdParty/custom-opm-common/opm-common/cmake/Modules/OpmStaticTargets.cmake
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
####################################################################
|
||||
# #
|
||||
# Setup static targets for all submodules. #
|
||||
# Useful when building a static benchmark executable #
|
||||
# #
|
||||
####################################################################
|
||||
|
||||
# Macros
|
||||
|
||||
# Clone a git and build it statically
|
||||
# If ARGN is specified installation is skipped, ARGN0 is
|
||||
# a build-system target name and the rest of ARGN are build tool parameters
|
||||
function(opm_from_git repo name revision)
|
||||
if(ARGN)
|
||||
list(GET ARGN 0 target)
|
||||
list(REMOVE_AT ARGN 0)
|
||||
# This is used for top build of benchmarks.
|
||||
# Clones the local source tree and builds it against the static libraries,
|
||||
# skipping the install step. Note that in pricinple URL instead of GIT_REPOSITORY
|
||||
# could have been used, but externalproject cannot handle build directories
|
||||
# which are a subdirectory of the source tree, and since that is typically the case
|
||||
# we work-around by re-cloning the local git.
|
||||
# The ommision of GIT_TAG ensures that we build the tip of the local git.
|
||||
set(COMMANDS BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --target ${target} -- ${ARGN}
|
||||
GIT_TAG ${revision}
|
||||
INSTALL_COMMAND)
|
||||
else()
|
||||
# This is used with "normal" static builds.
|
||||
set(COMMANDS GIT_TAG ${revision})
|
||||
endif()
|
||||
externalproject_add(${name}-static
|
||||
GIT_REPOSITORY ${repo}
|
||||
PREFIX static/${name}
|
||||
CONFIGURE_COMMAND PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/static/installed/lib/pkgconfig:${CMAKE_BINARY_DIR}/static/installed/${CMAKE_INSTALL_LIBDIR}/pkgconfig:$ENV{PKG_CONFIG_PATH}
|
||||
${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/static/installed
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DBUILD_SHARED_LIBS=0
|
||||
-DBUILD_TESTING=0 -DBUILD_EXAMPLES=0 <SOURCE_DIR>
|
||||
-G ${CMAKE_GENERATOR}
|
||||
${COMMANDS} "")
|
||||
set_target_properties(${name}-static PROPERTIES EXCLUDE_FROM_ALL 1)
|
||||
endfunction()
|
||||
|
||||
# Convenience macro for adding dependencies without having to include the -static all over
|
||||
macro(opm_static_add_dependencies target)
|
||||
foreach(arg ${ARGN})
|
||||
add_dependencies(${target}-static ${arg}-static)
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Defaults to building master
|
||||
if(NOT OPM_BENCHMARK_VERSION)
|
||||
set(OPM_BENCHMARK_VERSION "origin/master")
|
||||
endif()
|
||||
|
||||
# ERT
|
||||
externalproject_add(ert-static
|
||||
GIT_REPOSITORY https://github.com/Ensembles/ert
|
||||
PREFIX static/ert
|
||||
GIT_TAG ${revision}
|
||||
CONFIGURE_COMMAND ${CMAKE_COMMAND}
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/static/installed
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DBUILD_SHARED_LIBS=0 <SOURCE_DIR>/devel)
|
||||
set_target_properties(ert-static PROPERTIES EXCLUDE_FROM_ALL 1)
|
||||
|
||||
# 2015.04 release used dune v2.3.1
|
||||
if(OPM_BENCHMARK_VERSION STREQUAL "release/2015.04/final")
|
||||
set(DUNE_VERSION v2.3.1)
|
||||
endif()
|
||||
|
||||
# Master currently uses dune v2.3.1
|
||||
if(OPM_BENCHMARK_VERSION STREQUAL "origin/master")
|
||||
set(DUNE_VERSION v2.3.1)
|
||||
endif()
|
||||
|
||||
# Fallback
|
||||
if(NOT DUNE_VERSION)
|
||||
set(DUNE_VERSION v2.3.1)
|
||||
endif()
|
||||
|
||||
# Dune
|
||||
foreach(dune_repo dune-common dune-geometry dune-grid dune-istl)
|
||||
opm_from_git(http://git.dune-project.org/repositories/${dune_repo} ${dune_repo} ${DUNE_VERSION})
|
||||
endforeach()
|
||||
opm_static_add_dependencies(dune-istl dune-common)
|
||||
opm_static_add_dependencies(dune-geometry dune-common)
|
||||
opm_static_add_dependencies(dune-grid dune-geometry)
|
||||
|
||||
# OPM
|
||||
foreach(opm_repo opm-common opm-parser opm-core opm-output opm-grid opm-material
|
||||
opm-upscaling)
|
||||
opm_from_git(https://github.com/OPM/${opm_repo} ${opm_repo} ${OPM_BENCHMARK_VERSION})
|
||||
endforeach()
|
||||
opm_static_add_dependencies(opm-parser opm-common ert)
|
||||
opm_static_add_dependencies(opm-core opm-parser dune-istl)
|
||||
opm_static_add_dependencies(opm-grid opm-core dune-grid)
|
||||
opm_static_add_dependencies(opm-material opm-core)
|
||||
opm_static_add_dependencies(opm-upscaling opm-grid opm-material)
|
||||
108
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseCompVer.cmake
vendored
Normal file
108
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseCompVer.cmake
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
# - Get compiler version
|
||||
|
||||
# probe the GCC version, returns empty string if GCC is not compiler
|
||||
function (get_gcc_version language ver_name)
|
||||
if(CMAKE_${language}_COMPILER_ID STREQUAL GNU)
|
||||
# exec_program is deprecated, but execute_process does't work :-(
|
||||
exec_program (${CMAKE_${language}_COMPILER}
|
||||
ARGS ${CMAKE_${language}_COMPILER_ARG1} -dumpversion
|
||||
OUTPUT_VARIABLE _version
|
||||
)
|
||||
set (${ver_name} ${_version} PARENT_SCOPE)
|
||||
else (CMAKE_${language}_COMPILER_ID STREQUAL GNU)
|
||||
set (${ver_name} "" PARENT_SCOPE)
|
||||
endif (CMAKE_${language}_COMPILER_ID STREQUAL GNU)
|
||||
endfunction (get_gcc_version ver_name)
|
||||
|
||||
# less reliable, but includes the patch number
|
||||
function (get_gcc_patch language ver_name)
|
||||
if(CMAKE_${language}_COMPILER_ID STREQUAL GNU)
|
||||
# exec_program is deprecated, but execute_process does't work :-(
|
||||
exec_program (${CMAKE_${language}_COMPILER}
|
||||
ARGS ${CMAKE_${language}_COMPILER_ARG1} --version
|
||||
OUTPUT_VARIABLE _version
|
||||
)
|
||||
# split multi-line string into list
|
||||
if (WIN32)
|
||||
string (REPLACE "\r\n" ";" _version "${_version}")
|
||||
else (WIN32)
|
||||
string (REPLACE "\n" ";" _version "${_version}")
|
||||
endif (WIN32)
|
||||
# only keep first line
|
||||
list (GET _version 0 _version)
|
||||
# extract version number from it (this is the fragile part)
|
||||
string (REGEX REPLACE "^[^\\(]+(\\([^\\)]*\\))?[\ \t]*([0-9]+\\.[0-9]+\\.[0-9]+)(.*\\(.*\\))?" "\\2" _version "${_version}")
|
||||
# return this to the caller
|
||||
set (${ver_name} ${_version} PARENT_SCOPE)
|
||||
else (CMAKE_${language}_COMPILER_ID STREQUAL GNU)
|
||||
set (${ver_name} "" PARENT_SCOPE)
|
||||
endif (CMAKE_${language}_COMPILER_ID STREQUAL GNU)
|
||||
endfunction (get_gcc_patch language ver_name)
|
||||
|
||||
function (compiler_info)
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
get_gcc_patch (CXX version)
|
||||
message (STATUS "GNU C++ compiler version: ${version}")
|
||||
endif (CMAKE_COMPILER_IS_GNUCXX)
|
||||
endfunction (compiler_info)
|
||||
|
||||
function (get_ld_version ver_name)
|
||||
# run linker to get the version number. interestingly, this option works
|
||||
# (for our purposes) on all major platforms (Linux, Mac OS X and Windows);
|
||||
# it returns the program version although it may have ended in error
|
||||
exec_program (${CMAKE_LINKER}
|
||||
ARGS "-v"
|
||||
OUTPUT_VARIABLE _version
|
||||
)
|
||||
|
||||
# keep only first line, even on Mac OS X there is no line end
|
||||
list (GET _version 0 _version)
|
||||
|
||||
# format of the version string is platform-specific
|
||||
if (NOT WIN32)
|
||||
if (APPLE)
|
||||
string (REGEX REPLACE ".*, from Apple (.*\)" "\\1" _version "${_version}")
|
||||
else (APPLE)
|
||||
# assuming some GNU toolchain now
|
||||
string (REGEX REPLACE "GNU ([a-zA-Z0-9_]*) (version|\\(.*\\)) ([^\\ ]*).*" "\\1 \\3" _version "${_version}")
|
||||
endif (APPLE)
|
||||
endif (NOT WIN32)
|
||||
|
||||
# return the string to the caller
|
||||
set (${ver_name} "${_version}" PARENT_SCOPE)
|
||||
endfunction (get_ld_version ver_name)
|
||||
|
||||
function (linker_info)
|
||||
get_ld_version (version)
|
||||
message (STATUS "Linker: ${version}")
|
||||
endfunction (linker_info)
|
||||
|
||||
# sets CXX_COMPAT_GCC if we have either GCC or Clang
|
||||
macro (is_compiler_gcc_compatible)
|
||||
# is the C++ compiler clang++?
|
||||
string (TOUPPER "${CMAKE_CXX_COMPILER_ID}" _comp_id)
|
||||
if (_comp_id MATCHES "CLANG")
|
||||
set (CMAKE_COMPILER_IS_CLANGXX TRUE)
|
||||
else ()
|
||||
set (CMAKE_COMPILER_IS_CLANGXX FALSE)
|
||||
endif ()
|
||||
# is the C++ compiler g++ or clang++?
|
||||
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
|
||||
set (CXX_COMPAT_GCC TRUE)
|
||||
else ()
|
||||
set (CXX_COMPAT_GCC FALSE)
|
||||
endif ()
|
||||
# is the C compiler clang?
|
||||
string (TOUPPER "${CMAKE_C_COMPILER_ID}" _comp_id)
|
||||
if (_comp_id MATCHES "CLANG")
|
||||
set (CMAKE_COMPILER_IS_CLANG TRUE)
|
||||
else ()
|
||||
set (CMAKE_COMPILER_IS_CLANG FALSE)
|
||||
endif ()
|
||||
# is the C compiler gcc or clang?
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
||||
set (C_COMPAT_GCC TRUE)
|
||||
else ()
|
||||
set (C_COMPAT_GCC FALSE)
|
||||
endif ()
|
||||
endmacro (is_compiler_gcc_compatible)
|
||||
132
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseDebugSymbols.cmake
vendored
Normal file
132
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseDebugSymbols.cmake
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
# - Generate debug symbols in a separate file
|
||||
#
|
||||
# (1) Include this file in your CMakeLists.txt; it will setup everything
|
||||
# to compile WITH debug symbols in any case.
|
||||
#
|
||||
# (2) Run the strip_debug_symbols function on every target that you want
|
||||
# to strip.
|
||||
|
||||
# Copyright (C) 2012 Uni Research AS
|
||||
# This code is licensed under The GNU General Public License v3.0
|
||||
|
||||
include (AddOptions)
|
||||
include (UseCompVer)
|
||||
is_compiler_gcc_compatible ()
|
||||
|
||||
# only debugging using the GNU toolchain is supported for now
|
||||
if (CXX_COMPAT_GCC)
|
||||
# default debug level, if not specified by the user
|
||||
set_default_option (CXX _dbg_flag "-ggdb3" "(^|\ )-g")
|
||||
|
||||
# add debug symbols to *all* targets if the build mode is either "Debug" or "RelWithDebInfo"
|
||||
if (_dbg_flag)
|
||||
message (STATUS "Generating debug symbols: ${_dbg_flag}")
|
||||
add_options (ALL_LANGUAGES "Debug;RelWithDebInfo" "${_dbg_flag}")
|
||||
endif (_dbg_flag)
|
||||
|
||||
# extracting the debug info is done by a separate utility in the GNU
|
||||
# toolchain. check that this is actually installed.
|
||||
message (STATUS "Looking for strip utility")
|
||||
if (APPLE)
|
||||
# MacOS X has a duo of utilities; we need both
|
||||
find_program (OBJCOPY strip)
|
||||
find_program (DSYMUTIL dsymutil)
|
||||
mark_as_advanced (DSYMUTIL)
|
||||
if (NOT DSYMUTIL)
|
||||
set (OBJCOPY dsymutil-NOTFOUND)
|
||||
endif (NOT DSYMUTIL)
|
||||
else (APPLE)
|
||||
find_program (OBJCOPY
|
||||
objcopy
|
||||
${CYGWIN_INSTALL_PATH}/bin /usr/bin /usr/local/bin
|
||||
)
|
||||
endif (APPLE)
|
||||
mark_as_advanced (OBJCOPY)
|
||||
if (OBJCOPY)
|
||||
message (STATUS "Looking for strip utility - found")
|
||||
else (OBJCOPY)
|
||||
message (WARNING "Looking for strip utility - not found")
|
||||
endif (OBJCOPY)
|
||||
endif ()
|
||||
|
||||
# command to separate the debug information from the executable into
|
||||
# its own file; this must be called for each target; optionally takes
|
||||
# the name of a variable to receive the list of .debug files
|
||||
function (strip_debug_symbols targets)
|
||||
if (CXX_COMPAT_GCC AND OBJCOPY)
|
||||
foreach (target IN LISTS targets)
|
||||
# libraries must retain the symbols in order to link to them, but
|
||||
# everything can be stripped in an executable
|
||||
get_target_property (_kind ${target} TYPE)
|
||||
|
||||
# don't strip static libraries
|
||||
if ("${_kind}" STREQUAL "STATIC_LIBRARY")
|
||||
return ()
|
||||
endif ("${_kind}" STREQUAL "STATIC_LIBRARY")
|
||||
|
||||
# don't strip public symbols in shared objects
|
||||
if ("${_kind}" STREQUAL "EXECUTABLE")
|
||||
set (_strip_args "--strip-all")
|
||||
else ("${_kind}" STREQUAL "EXECUTABLE")
|
||||
set (_strip_args "--strip-debug")
|
||||
endif ("${_kind}" STREQUAL "EXECUTABLE")
|
||||
|
||||
# add_custom_command doesn't support generator expressions in the
|
||||
# working_directory argument (sic; that's what you get when you do
|
||||
# ad hoc programming all the time), so we need to extract the
|
||||
# location up front (the location on the other hand should not be
|
||||
# used for libraries as it does not include the soversion -- sic
|
||||
# again)
|
||||
get_target_property (_full ${target} LOCATION)
|
||||
get_filename_component (_dir ${_full} PATH)
|
||||
if (NOT (("${_dir}" STREQUAL "") OR ("${_dir}" MATCHES ".*/$")))
|
||||
set (_dir "${_dir}/")
|
||||
endif (NOT (("${_dir}" STREQUAL "") OR ("${_dir}" MATCHES ".*/$")))
|
||||
get_filename_component (_name ${_full} NAME_WE)
|
||||
get_filename_component (_ext ${_full} EXT)
|
||||
# only libraries have soversion property attached
|
||||
get_target_property (_target_soversion ${target} SOVERSION)
|
||||
get_target_property (_target_version ${target} VERSION)
|
||||
if (_target_soversion)
|
||||
# MacOS X puts the version number before the extension
|
||||
if (APPLE)
|
||||
set (_target_file_name "${_name}.${_target_version}${_ext}")
|
||||
else (APPLE)
|
||||
set (_target_file_name "${_name}${_ext}.${_target_version}")
|
||||
endif (APPLE)
|
||||
else (_target_soversion)
|
||||
set (_target_file_name "${_name}${_ext}")
|
||||
endif (_target_soversion)
|
||||
set (_target_file "${_dir}${_target_file_name}")
|
||||
# do without generator expressions (which doesn't work everywhere)
|
||||
if (APPLE)
|
||||
set (_debug_ext ".dSYM")
|
||||
add_custom_command (TARGET ${target}
|
||||
POST_BUILD
|
||||
WORKING_DIRECTORY ${_dir}
|
||||
COMMAND ${DSYMUTIL} ARGS --out=${_target_file}${_debug_ext} ${_target_file}
|
||||
COMMAND ${OBJCOPY} ARGS -S ${_target_file}
|
||||
VERBATIM
|
||||
)
|
||||
else (APPLE)
|
||||
set (_debug_ext ".debug")
|
||||
add_custom_command (TARGET ${target}
|
||||
POST_BUILD
|
||||
WORKING_DIRECTORY ${_dir}
|
||||
COMMAND ${OBJCOPY} ARGS --only-keep-debug ${_target_file} ${_target_file}${_debug_ext}
|
||||
COMMAND ${OBJCOPY} ARGS ${_strip_args} ${_target_file}
|
||||
COMMAND ${OBJCOPY} ARGS --add-gnu-debuglink=${_target_file_name}${_debug_ext} ${_target_file}
|
||||
VERBATIM
|
||||
)
|
||||
endif (APPLE)
|
||||
# add this .debug file to the list
|
||||
file (RELATIVE_PATH _this_debug_file "${PROJECT_BINARY_DIR}" "${_target_file}${_debug_ext}")
|
||||
set (_debug_files ${_debug_files} ${_this_debug_file})
|
||||
endforeach (target)
|
||||
# if optional debug list was requested, then copy to output parameter
|
||||
if (ARGV1)
|
||||
set (${ARGV1} ${_debug_files} PARENT_SCOPE)
|
||||
endif (ARGV1)
|
||||
endif ()
|
||||
endfunction (strip_debug_symbols targets)
|
||||
|
||||
32
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseDuneVer.cmake
vendored
Normal file
32
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseDuneVer.cmake
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# - Find version of a DUNE package
|
||||
#
|
||||
# Synopsis:
|
||||
#
|
||||
# find_dune_version (suite module)
|
||||
#
|
||||
# where:
|
||||
# suite Name of the suite; this should always be "dune"
|
||||
# module Name of the module, e.g. "common"
|
||||
#
|
||||
# Finds the content of DUNE_${MODULE}_VERSION_{MAJOR,MINOR,REVISION}
|
||||
# from the installation.
|
||||
#
|
||||
# Add these variables to ${project}_CONFIG_IMPL_VARS in CMakeLists.txt
|
||||
# if you need these in the code.
|
||||
|
||||
function (find_dune_version suite module)
|
||||
# CMake's find_package will set <package>_VERSION_(MAJOR|MINOR|REVISION)
|
||||
# we simply rely on that.
|
||||
# generate variable for what we have found
|
||||
string (TOUPPER "${suite}" _SUITE)
|
||||
string (TOUPPER "${module}" _MODULE)
|
||||
string (REPLACE "-" "_" _MODULE "${_MODULE}")
|
||||
set (${_SUITE}_${_MODULE}_VERSION_MAJOR "${${suite}-${module}_VERSION_MAJOR}" PARENT_SCOPE)
|
||||
set (${_SUITE}_${_MODULE}_VERSION_MINOR "${${suite}-${module}_VERSION_MINOR}" PARENT_SCOPE)
|
||||
set (${_SUITE}_${_MODULE}_VERSION_REVISION "${${suite}-${module}_VERSION_PATCH}" PARENT_SCOPE)
|
||||
|
||||
if( ${suite}-${module}_FOUND )
|
||||
# print the version number we detected in the configuration log
|
||||
message (STATUS "Version ${${suite}-${module}_VERSION_MAJOR}.${${suite}-${module}_VERSION_MINOR}.${${suite}-${module}_VERSION_PATCH} of ${suite}-${module} from ${${suite}-${module}_DIR}")
|
||||
endif()
|
||||
endfunction (find_dune_version suite module)
|
||||
36
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseDynamicBoost.cmake
vendored
Normal file
36
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseDynamicBoost.cmake
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
find_package (Boost 1.44.0 COMPONENTS unit_test_framework QUIET)
|
||||
|
||||
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
||||
# setup to do a test compile
|
||||
include (CMakePushCheckState)
|
||||
cmake_push_check_state ()
|
||||
include (CheckCXXSourceCompiles)
|
||||
list (APPEND CMAKE_REQUIRED_INCLUDES ${Boost_INCLUDE_DIRS})
|
||||
list (APPEND CMAKE_REQUIRED_LIBRARIES ${Boost_LIBRARIES})
|
||||
|
||||
unset(HAVE_DYNAMIC_BOOST_TEST CACHE)
|
||||
check_cxx_source_compiles("
|
||||
#define BOOST_TEST_DYN_LINK
|
||||
#define BOOST_TEST_MODULE DYNLINK_TEST
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
int f(int x) { return 2 * x; }
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DynlinkConfigureTest) {
|
||||
BOOST_CHECK_MESSAGE(f(2) == 4,
|
||||
\"Apparently, multiplication doesn't \"
|
||||
\"work: f(2) = \" << f(2));
|
||||
}" HAVE_DYNAMIC_BOOST_TEST)
|
||||
cmake_pop_check_state ()
|
||||
else (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
||||
# no Boost, no compile
|
||||
set (HAVE_DYNAMIC_BOOST_TEST 0)
|
||||
endif (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
||||
|
||||
# save this for later
|
||||
set (HAVE_DYNAMIC_BOOST_TEST "${HAVE_DYNAMIC_BOOST_TEST}"
|
||||
CACHE BOOL "Whether Boost::Test is dynamically linked or not"
|
||||
)
|
||||
|
||||
# include in config.h
|
||||
list (APPEND TESTING_CONFIG_VARS "HAVE_DYNAMIC_BOOST_TEST")
|
||||
11
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseFastBuilds.cmake
vendored
Normal file
11
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseFastBuilds.cmake
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# - Try to build faster depending on the compiler
|
||||
|
||||
# faster builds by using a pipe instead of temp files
|
||||
include (AddOptions)
|
||||
include (UseCompVer)
|
||||
is_compiler_gcc_compatible ()
|
||||
|
||||
if (CXX_COMPAT_GCC)
|
||||
add_options (ALL_LANGUAGES ALL_BUILDS "-pipe")
|
||||
endif ()
|
||||
|
||||
90
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseFortranWrappers.cmake
vendored
Normal file
90
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseFortranWrappers.cmake
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
# - Provide C wrappers for Fortran code
|
||||
#
|
||||
# Synopsis:
|
||||
# define_fc_func (APPEND config.h IF HAVE_BLAS)
|
||||
|
||||
function (define_fc_func verb file)
|
||||
# check that we are being called correctly
|
||||
if (NOT (("${verb}" STREQUAL "APPEND") OR
|
||||
("${verb}" STREQUAL "WRITE")))
|
||||
message (FATAL_ERROR
|
||||
"Unknown verb \"${verb}\" passed as first argument."
|
||||
)
|
||||
endif (NOT (("${verb}" STREQUAL "APPEND") OR
|
||||
("${verb}" STREQUAL "WRITE")))
|
||||
|
||||
# check under which conditions we should do our work
|
||||
if (NOT "${ARGN}" STREQUAL "")
|
||||
set (args ${ARGN})
|
||||
list (GET args 0 keyword)
|
||||
if (NOT "${keyword}" STREQUAL "IF")
|
||||
message (FATAL_ERROR
|
||||
"Unknown conditional \"${keyword}\" passed as third argument."
|
||||
)
|
||||
endif (NOT "${keyword}" STREQUAL "IF")
|
||||
list (REMOVE_AT args 0)
|
||||
set (needed FALSE)
|
||||
foreach (condition IN LISTS args)
|
||||
if (${${condition}})
|
||||
set (needed TRUE)
|
||||
break ()
|
||||
endif (${${condition}})
|
||||
endforeach (condition)
|
||||
else (NOT "${ARGN}" STREQUAL "")
|
||||
# if called unconditionally, then always include the wrapper
|
||||
set (needed TRUE)
|
||||
endif (NOT "${ARGN}" STREQUAL "")
|
||||
|
||||
# only do something if we actually have some components which requires
|
||||
# the interaction -- don't load the Fortran compiler just to write
|
||||
# this macro (which apparently nobody uses then)
|
||||
if (needed)
|
||||
# if this option is enabled, we skip detecting the Fortran externals
|
||||
# using a real compiler (which may not be the same that compiled the
|
||||
# library) and just write a macro that uses a single underscore (which
|
||||
# is the assumption that FindLAPACK operates on anyway)
|
||||
option (USE_UNDERSCORING "Assume that Fortran routines have underscore suffix" OFF)
|
||||
if (USE_UNDERSCORING)
|
||||
message (STATUS "Assuming Fortran externals have underscore suffix")
|
||||
set (_str "#define FC_FUNC(name,NAME) name##_\n")
|
||||
else (USE_UNDERSCORING)
|
||||
|
||||
# enable languages needed
|
||||
if (NOT CMAKE_C_COMPILER_LOADED)
|
||||
enable_language (C)
|
||||
endif (NOT CMAKE_C_COMPILER_LOADED)
|
||||
if (NOT CMAKE_Fortran_COMPILER_LOADED)
|
||||
enable_language (Fortran)
|
||||
endif (NOT CMAKE_Fortran_COMPILER_LOADED)
|
||||
|
||||
# get a temporary file
|
||||
set (_tmp_hdr ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/config_f.h)
|
||||
|
||||
# write a small config file that contains the proper convention for
|
||||
# calling Fortran from C
|
||||
include (FortranCInterface)
|
||||
fortrancinterface_header (${_tmp_hdr})
|
||||
|
||||
# read the definition back in from the file
|
||||
file (STRINGS
|
||||
${_tmp_hdr}
|
||||
_str
|
||||
REGEX "^#define FortranCInterface_GLOBAL\\(name,NAME\\) .*$"
|
||||
)
|
||||
|
||||
# massage it to look like the one AC_FC_WRAPPERS provide
|
||||
string (REPLACE "FortranCInterface_GLOBAL" "FC_FUNC" _str ${_str})
|
||||
|
||||
endif (USE_UNDERSCORING)
|
||||
|
||||
# write this definition to the end of our own configuration file
|
||||
file (${verb} ${file}
|
||||
"\n/* Define to a macro mangling the given C identifier (in lower and upper
|
||||
case), which must not contain underscores, for linking with Fortran. */\n"
|
||||
${_str}
|
||||
"\n"
|
||||
)
|
||||
else (needed)
|
||||
message (STATUS "Fortran/C interface not activated")
|
||||
endif (needed)
|
||||
endfunction (define_fc_func)
|
||||
50
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseOnlyNeeded.cmake
vendored
Normal file
50
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseOnlyNeeded.cmake
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
# - Use only needed imports from libraries
|
||||
#
|
||||
# Add the -Wl,--as-needed flag to the default linker flags on Linux
|
||||
# in order to get only the minimal set of dependencies.
|
||||
|
||||
function (prepend var_name value)
|
||||
# only add the prefix if it is not already at the beginning. this
|
||||
# prevents the same string to be added at the same place every time
|
||||
# we check for reconfiguration (e.g. "--as-needed" below)
|
||||
string (LENGTH "${value}" _val_len)
|
||||
string (LENGTH "${${var_name}}" _var_len)
|
||||
if (NOT (${_var_len} LESS ${_val_len}))
|
||||
string (SUBSTRING "${${var_name}}" 0 ${_val_len} _var_pre)
|
||||
else (NOT (${_var_len} LESS ${_val_len}))
|
||||
set (_var_pre)
|
||||
endif (NOT (${_var_len} LESS ${_val_len}))
|
||||
if (NOT ("${_var_pre}" STREQUAL "${value}"))
|
||||
if (${var_name})
|
||||
set (${var_name} "${value} ${${var_name}}" PARENT_SCOPE)
|
||||
else (${var_name})
|
||||
set (${var_name} "${value}")
|
||||
endif (${var_name})
|
||||
endif (NOT ("${_var_pre}" STREQUAL "${value}"))
|
||||
endfunction (prepend var_name value)
|
||||
|
||||
option (ONLY_NEEDED_LIBRARIES "Instruct the linker to not use libraries which are unused" OFF)
|
||||
|
||||
# only ELF shared objects can be underlinked, and only GNU will accept
|
||||
# these parameters; otherwise just leave it to the defaults
|
||||
if ((CMAKE_CXX_PLATFORM_ID STREQUAL "Linux") AND CMAKE_COMPILER_IS_GNUCC AND ONLY_NEEDED_LIBRARIES)
|
||||
# these are the modules whose probes will turn up incompatible
|
||||
# flags on some systems
|
||||
set (_maybe_underlinked
|
||||
SuiteSparse
|
||||
)
|
||||
# check if any modules actually reported problems (by setting an
|
||||
# appropriate linker flag)
|
||||
set (_underlinked FALSE)
|
||||
foreach (_module IN LISTS _maybe_underlinked)
|
||||
if ("${${_module}_LINKER_FLAGS}" MATCHES "-Wl,--no-as-needed")
|
||||
set (_underlinked TRUE)
|
||||
endif ("${${_module}_LINKER_FLAGS}" MATCHES "-Wl,--no-as-needed")
|
||||
endforeach (_module)
|
||||
# if we didn't have any problems, then go ahead and add
|
||||
if (NOT _underlinked)
|
||||
prepend (CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
|
||||
prepend (CMAKE_MODULE_LINKER_FLAGS "-Wl,--as-needed")
|
||||
prepend (CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
|
||||
endif (NOT _underlinked)
|
||||
endif ((CMAKE_CXX_PLATFORM_ID STREQUAL "Linux") AND CMAKE_COMPILER_IS_GNUCC AND ONLY_NEEDED_LIBRARIES)
|
||||
76
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseOpenMP.cmake
vendored
Normal file
76
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseOpenMP.cmake
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
# - Use OpenMP features
|
||||
#
|
||||
# Synopsis:
|
||||
#
|
||||
# find_openmp (module)
|
||||
#
|
||||
# where:
|
||||
#
|
||||
# module Name of the module to which OpenMP libraries
|
||||
# etc. should be added, e.g. "opm-core".
|
||||
#
|
||||
# Note: Compiler flags are always added globally, to avoid ABI
|
||||
# incompatibility problems.
|
||||
#
|
||||
# It is assumed that the following variables are available
|
||||
#
|
||||
# ${module}_QUIET Verbosity level of the parent's find module
|
||||
# ${module}_LIBRARIES List of libraries to which OpenMP will be added
|
||||
#
|
||||
# Example:
|
||||
# find_openmp (opm-core)
|
||||
# remove_dup_deps (opm-core)
|
||||
|
||||
include (AddOptions)
|
||||
include (UseCompVer)
|
||||
is_compiler_gcc_compatible ()
|
||||
|
||||
macro (find_openmp opm)
|
||||
# default is that OpenMP is not considered to be there; if we set this
|
||||
# to a blank definition, it may be added but it cannot be removed if
|
||||
# it propagates to other projects (someone declares it to be part of
|
||||
# _CONFIG_VARS)
|
||||
set (HAVE_OPENMP)
|
||||
|
||||
# user code can be conservative by setting USE_OPENMP_DEFAULT
|
||||
if (NOT DEFINED USE_OPENMP_DEFAULT)
|
||||
set (USE_OPENMP_DEFAULT ON)
|
||||
endif (NOT DEFINED USE_OPENMP_DEFAULT)
|
||||
option (USE_OPENMP "Enable OpenMP for parallelization" ${USE_OPENMP_DEFAULT})
|
||||
if (USE_OPENMP)
|
||||
|
||||
# enabling OpenMP is supposedly enough to make the compiler link with
|
||||
# the appropriate libraries
|
||||
find_package (OpenMP ${${opm}_QUIET})
|
||||
|
||||
if(OpenMP_CXX_FOUND)
|
||||
list (APPEND ${opm}_LIBRARIES OpenMP::OpenMP_CXX)
|
||||
else()
|
||||
list (APPEND ${opm}_LIBRARIES ${OpenMP_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if (OPENMP_FOUND)
|
||||
add_options (C ALL_BUILDS "${OpenMP_C_FLAGS}")
|
||||
add_options (CXX ALL_BUILDS "${OpenMP_CXX_FLAGS}")
|
||||
set (HAVE_OPENMP 1)
|
||||
endif (OPENMP_FOUND)
|
||||
|
||||
# threading library (search for this *after* OpenMP
|
||||
set (CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
find_package (Threads ${${opm}_QUIET})
|
||||
if (CMAKE_USE_PTHREADS_INIT)
|
||||
list (APPEND ${opm}_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif (CMAKE_USE_PTHREADS_INIT)
|
||||
|
||||
else (USE_OPENMP)
|
||||
message (STATUS "OpenMP: disabled")
|
||||
|
||||
# if we don't have OpenMP support, then don't show warnings that these
|
||||
# pragmas are unknown
|
||||
if (CXX_COMPAT_GCC)
|
||||
add_options (ALL_LANGUAGES ALL_BUILDS "-Wno-unknown-pragmas")
|
||||
elseif (MSVC)
|
||||
add_options (ALL_LANGUAGES ALL_BUILDS "-wd4068")
|
||||
endif()
|
||||
endif (USE_OPENMP)
|
||||
endmacro (find_openmp opm)
|
||||
86
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseOptimization.cmake
vendored
Normal file
86
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseOptimization.cmake
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
# - Turn on optimizations based on build type
|
||||
|
||||
include(TestCXXAcceptsFlag)
|
||||
include (AddOptions)
|
||||
include (UseCompVer)
|
||||
is_compiler_gcc_compatible ()
|
||||
|
||||
# mapping from profile name (in CMAKE_BUILD_TYPE) to variable part
|
||||
set (_prof_DEBUG "Debug")
|
||||
set (_prof_RELEASE "Release;RelWithDebInfo;MinSizeRel")
|
||||
|
||||
# if we are building a debug target, then disable all optimizations
|
||||
# otherwise, turn them on. indicate to the code what we have done
|
||||
# so it can turn on assertions etc.
|
||||
|
||||
if (CXX_COMPAT_GCC)
|
||||
# extra flags passed for optimization
|
||||
set (_opt_flags "")
|
||||
|
||||
# link-time (a.k.a. global) optimizations
|
||||
# disabled due to widespread bugs in the linker plugin
|
||||
option (WHOLE_PROG_OPTIM "Whole program optimization (lto)" OFF)
|
||||
if (WHOLE_PROG_OPTIM)
|
||||
check_cxx_accepts_flag ("-flto" HAVE_LINK_OPTS)
|
||||
check_cxx_accepts_flag ("-fuse-linker-plugin" HAVE_LINK_PLUGIN)
|
||||
if (HAVE_LINK_OPTS)
|
||||
list (APPEND _opt_flags "-flto")
|
||||
endif (HAVE_LINK_OPTS)
|
||||
if (HAVE_LINK_PLUGIN)
|
||||
list (APPEND _opt_flags "-fuse-linker-plugin")
|
||||
endif (HAVE_LINK_PLUGIN)
|
||||
if(HAVE_LINK_OPTS AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
string(REPLACE "." ";" VERSION_LIST "${CMAKE_C_COMPILER_VERSION}")
|
||||
list(GET VERSION_LIST 0 VER_MAJOR)
|
||||
find_program(LTO_AR_COMMAND NAMES ${CMAKE_C_COMPILER}-ar gcc-ar-${VER_MAJOR} gcc-ar)
|
||||
find_program(LTO_RANLIB_COMMAND NAMES ${CMAKE_C_COMPILER}-ranlib gcc-ranlib-${VER_MAJOR} gcc-ranlib)
|
||||
if(LTO_AR_COMMAND)
|
||||
set(CMAKE_AR ${LTO_AR_COMMAND})
|
||||
message(STATUS "Using LTO-enabled ar: ${CMAKE_AR}")
|
||||
endif()
|
||||
if(LTO_RANLIB_COMMAND)
|
||||
set(CMAKE_RANLIB ${LTO_RANLIB_COMMAND})
|
||||
message(STATUS "Using LTO-enabled ranlib: ${CMAKE_RANLIB}")
|
||||
endif()
|
||||
endif()
|
||||
endif (WHOLE_PROG_OPTIM)
|
||||
|
||||
# native instruction set tuning
|
||||
option (WITH_NATIVE "Use native instruction set" ON)
|
||||
if (WITH_NATIVE)
|
||||
check_cxx_accepts_flag ("-mtune=native" HAVE_MTUNE)
|
||||
if (HAVE_MTUNE)
|
||||
list (APPEND _opt_flags "-mtune=native")
|
||||
endif (HAVE_MTUNE)
|
||||
endif (WITH_NATIVE)
|
||||
|
||||
# default optimization flags, if not set by user
|
||||
set_default_option (CXX _opt_dbg "-O0" "(^|\ )-O")
|
||||
set_default_option (CXX _opt_rel "-O3" "(^|\ )-O")
|
||||
|
||||
# use these options for debug builds - no optimizations
|
||||
add_options (ALL_LANGUAGES "${_prof_DEBUG}" ${_opt_dbg} "-DDEBUG")
|
||||
|
||||
# use these options for release builds - full optimization
|
||||
add_options (ALL_LANGUAGES "${_prof_RELEASE}" ${_opt_rel} ${_opt_flags})
|
||||
option(WITH_NDEBUG "Disable asserts in release mode" ON)
|
||||
if(WITH_NDEBUG)
|
||||
add_options (ALL_LANGUAGES "${_prof_RELEASE}" -DNDEBUG)
|
||||
endif()
|
||||
|
||||
else ()
|
||||
# default information from system
|
||||
foreach (lang IN ITEMS C CXX Fortran)
|
||||
if (lang STREQUAL "Fortran")
|
||||
set (_lang F)
|
||||
else (lang STREQUAL "Fortran")
|
||||
set (_lang ${lang})
|
||||
endif (lang STREQUAL "Fortran")
|
||||
foreach (profile IN ITEMS DEBUG RELEASE)
|
||||
if (NOT CMAKE_${lang}_FLAGS_${profile})
|
||||
add_options (${lang} "${_prof_${profile}}"
|
||||
"$ENV{${_lang}FLAGS} ${CMAKE_${lang}_FLAGS_${profile}_INIT}")
|
||||
endif (NOT CMAKE_${lang}_FLAGS_${profile})
|
||||
endforeach (profile)
|
||||
endforeach (lang)
|
||||
endif ()
|
||||
171
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UsePrecompHeaders.cmake
vendored
Normal file
171
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UsePrecompHeaders.cmake
vendored
Normal file
@@ -0,0 +1,171 @@
|
||||
# - Use precompiled headers
|
||||
#
|
||||
# precompile_header takes these parameters
|
||||
#
|
||||
# language Language in which the header is written; C or CXX.
|
||||
#
|
||||
# type Type of target being build, SHARED_LIBRARY, STATIC_LIBRARY
|
||||
# or EXECUTABLE.
|
||||
#
|
||||
# header Relative path within the source tree to the header
|
||||
# that contains the list of includes to be precompiled.
|
||||
# This header should not be added to the installation,
|
||||
# as it will be specific for this project.
|
||||
#
|
||||
# target Name of target to be created. All targets that
|
||||
# use the precompiled header should depend on this target
|
||||
# so that it is built before them. A variable with this
|
||||
# name will also be created which contains the file name.
|
||||
#
|
||||
# flags_name Name of variable to receive the flags that should be
|
||||
# added to the command-line.
|
||||
#
|
||||
# Example:
|
||||
# get_target_property (type opmcore TYPE)
|
||||
# precompile_header (CXX ${type}
|
||||
# HEADER "opm/core/opm-core-pch.hpp"
|
||||
# TARGET opmcore_CXX_pch
|
||||
# FLAGS opmcore_PRECOMP_CXX_FLAGS
|
||||
# )
|
||||
# set_source_files_properties (${opmcore_CXX_SOURCES} PROPERTIES
|
||||
# OBJECT_DEPENDS "${opmcore_CXX_pch}"
|
||||
# COMPILE_FLAGS "${opmcore_PRECOMP_CXX_FLAGS}"
|
||||
# )
|
||||
|
||||
# get compiler version
|
||||
include (UseCompVer)
|
||||
is_compiler_gcc_compatible ()
|
||||
|
||||
# reconstruct the compiler command line; this does NOT include the
|
||||
# DEFINE_SYMBOL that is added for shared libraries. type is the TYPE
|
||||
# target property.
|
||||
# see larsch's PrecompiledHeader.cmake: <https://gist.github.com/573926>
|
||||
# and <https://github.com/loaden/qtcreator/blob/wip/cmake/cmake/PrecompiledHeader.cmake>
|
||||
function (compiler_cmdline language type cmd_name args_name)
|
||||
# get the compiler for this particular language
|
||||
set (${cmd_name} "${CMAKE_${language}_COMPILER}" PARENT_SCOPE)
|
||||
|
||||
# in case someone has overridden the compiler (e.g. ccache)
|
||||
set (_args "${CMAKE_${language}_COMPILER_ARG1}")
|
||||
|
||||
# macro definitions
|
||||
get_directory_property (_defs DEFINITIONS)
|
||||
list (APPEND _args "${_defs}")
|
||||
|
||||
# global flags (such as -std=c++11); notice that there are both
|
||||
# release-dependent and non-release-dependent ones
|
||||
string (TOUPPER "CMAKE_${language}_FLAGS" _flags)
|
||||
list (APPEND _args "${${_flags}}")
|
||||
string (TOUPPER "CMAKE_${language}_FLAGS_${CMAKE_BUILD_TYPE}" _flags)
|
||||
list (APPEND _args "${${_flags}}")
|
||||
|
||||
# assume that we are always generating position-independent code
|
||||
# when compiling for a shared library
|
||||
if (type STREQUAL "SHARED_LIBRARY")
|
||||
list (APPEND _args "${CMAKE_SHARED_LIBRARY_${language}_FLAGS}")
|
||||
endif (type STREQUAL "SHARED_LIBRARY")
|
||||
|
||||
# directories included
|
||||
get_directory_property (_dirs INCLUDE_DIRECTORIES)
|
||||
foreach (_dir ${_dirs})
|
||||
list (APPEND _args "-I${_dir}")
|
||||
endforeach (_dir)
|
||||
|
||||
# make arguments a real list, and write to output variable
|
||||
separate_arguments (_args)
|
||||
set (${args_name} "${_args}" PARENT_SCOPE)
|
||||
endfunction (compiler_cmdline language type cmd_name args_name)
|
||||
|
||||
function (precompile_header
|
||||
language type hdr_kw header tgt_kw target flgs_kw flags_name)
|
||||
|
||||
# check "syntax"
|
||||
if (NOT hdr_kw STREQUAL "HEADER")
|
||||
message (FATAL "Third token to precompile_header shoulde be \"HEADER\"")
|
||||
endif (NOT hdr_kw STREQUAL "HEADER")
|
||||
if (NOT tgt_kw STREQUAL "TARGET")
|
||||
message (FATAL "Fifth token to precompile_header should be \"TARGET\"")
|
||||
endif (NOT tgt_kw STREQUAL "TARGET")
|
||||
if (NOT flgs_kw STREQUAL "FLAGS")
|
||||
message (FATAL "Seventh token to precompile_header should be \"FLAGS\"")
|
||||
endif (NOT flgs_kw STREQUAL "FLAGS")
|
||||
|
||||
# check language
|
||||
if (language STREQUAL "CXX")
|
||||
set (gcc_lang "c++-header")
|
||||
elseif (language STREQUAL "C")
|
||||
set (gcc_lang "c-header")
|
||||
else (language STREQUAL "CXX")
|
||||
message (FATAL "Only C or C++ can have precompiled headers")
|
||||
endif (language STREQUAL "CXX")
|
||||
|
||||
# if no precompiled header was found, then we shouldn't do anything here
|
||||
if (NOT header)
|
||||
return ()
|
||||
endif (NOT header)
|
||||
|
||||
# only support precompiled headers if the compiler is gcc >= 3.4 or clang
|
||||
if (CXX_COMPAT_GCC)
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
# genuine GCC; must test version
|
||||
get_gcc_version (${language} GCC_VERSION)
|
||||
if (GCC_VERSION VERSION_EQUAL 3.4 OR GCC_VERSION VERSION_GREATER 3.4)
|
||||
set (_do_pch TRUE)
|
||||
else ()
|
||||
set (_do_pch FALSE)
|
||||
endif ()
|
||||
elseif (CMAKE_COMPILER_IS_CLANGXX)
|
||||
# any Clang version that is new enough to compile us can do this
|
||||
set (_do_pch TRUE)
|
||||
else ()
|
||||
set (_do_pch FALSE)
|
||||
endif ()
|
||||
if (_do_pch)
|
||||
# command-line used to compile modules in this kind of target
|
||||
compiler_cmdline (${language} ${type} _cmd _args)
|
||||
|
||||
# gcc will include any configurations which are in a directory
|
||||
# with the same name as the header included
|
||||
set (_pch_dir "CMakeFiles/pch")
|
||||
set (_pch_file "${_pch_dir}/${header}.gch/${target}")
|
||||
|
||||
# make sure that output directory exists
|
||||
get_filename_component (_outdir "${PROJECT_BINARY_DIR}/${_pch_file}" PATH)
|
||||
file (MAKE_DIRECTORY ${_outdir})
|
||||
|
||||
# we need to generate the precompiled header in the output tree, but
|
||||
# at the same time prevent the compiler to pick up the header from the
|
||||
# source tree. getting the order of the include paths right is fragile
|
||||
# in CMake. by copying the header, we can put the precompile dump
|
||||
# right next to it and have the compiler pick it up there
|
||||
add_custom_command (
|
||||
OUTPUT "${_pch_dir}/${header}"
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
ARGS -E copy "${PROJECT_SOURCE_DIR}/${header}" "${_pch_dir}/${header}"
|
||||
DEPENDS "${PROJECT_SOURCE_DIR}/${header}"
|
||||
)
|
||||
|
||||
# add a makefile rule to create the precompiled header
|
||||
add_custom_command (
|
||||
OUTPUT ${PROJECT_BINARY_DIR}/${_pch_file}
|
||||
COMMAND ${_cmd}
|
||||
ARGS ${_args} "-o" "${_pch_file}" "-x" "${gcc_lang}" "-c" "${_pch_dir}/${header}"
|
||||
DEPENDS "${_pch_dir}/${header}"
|
||||
COMMENT "Precompiling headers ${_pch_file}"
|
||||
)
|
||||
|
||||
# create a phony target that is always built, but which only checks
|
||||
# if the header file is OK (i.e. the header only gets rebuilt if
|
||||
# necessary)
|
||||
add_custom_target (${target} ALL
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/${_pch_file}
|
||||
)
|
||||
|
||||
# these flags need to be added to the target
|
||||
set (${target} "${_pch_file}" PARENT_SCOPE)
|
||||
set (${flags_name} "-Winvalid-pch -include ${_pch_dir}/${header}" PARENT_SCOPE)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
endfunction (precompile_header
|
||||
language type header tgt_kw target flgs_kw flags_name)
|
||||
63
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseStaticAnalysis.cmake
vendored
Normal file
63
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseStaticAnalysis.cmake
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
# Add static analysis tests for a given source file
|
||||
|
||||
macro(setup_static_analysis_tools)
|
||||
find_package(CppCheck)
|
||||
if(CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
find_package(ClangCheck)
|
||||
else()
|
||||
message(STATUS "Disabling clang-check as CMAKE_EXPORT_COMPILE_COMMANDS is not enabled")
|
||||
endif()
|
||||
if(OPM_COMMON_ROOT)
|
||||
set(DIR ${OPM_COMMON_ROOT})
|
||||
elseif(OPM_MACROS_ROOT)
|
||||
set(DIR ${OPM_MACROS_ROOT})
|
||||
else()
|
||||
set(DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
if(CPPCHECK_FOUND)
|
||||
file(COPY ${DIR}/cmake/Scripts/cppcheck-test.sh
|
||||
DESTINATION bin
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
endif()
|
||||
if(CLANGCHECK_FOUND AND CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
configure_file(${DIR}/cmake/Scripts/clang-check-test.sh.in
|
||||
${CMAKE_BINARY_DIR}/CMakeFiles/clang-check-test.sh)
|
||||
file(COPY ${CMAKE_BINARY_DIR}/CMakeFiles/clang-check-test.sh
|
||||
DESTINATION bin
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function(add_static_analysis_tests sources includes)
|
||||
if(CPPCHECK_FOUND OR (CLANGCHECK_FOUND AND CMAKE_EXPORT_COMPILE_COMMANDS))
|
||||
foreach(dep ${${includes}})
|
||||
list(APPEND IPATHS -I ${dep})
|
||||
endforeach()
|
||||
foreach(src ${${sources}})
|
||||
if(src MATCHES "TARGET_OBJECTS:")
|
||||
string(REGEX REPLACE "\\$<TARGET_OBJECTS:(.*)>" "\\1" TGT ${src})
|
||||
get_target_property(src ${TGT} SOURCES)
|
||||
endif()
|
||||
if(IS_ABSOLUTE ${src})
|
||||
file(RELATIVE_PATH name ${PROJECT_SOURCE_DIR} ${src})
|
||||
else()
|
||||
set(name ${src})
|
||||
set(src ${PROJECT_SOURCE_DIR}/${src})
|
||||
endif()
|
||||
if(CPPCHECK_FOUND)
|
||||
if(NOT TEST cppcheck+${name})
|
||||
add_test(NAME cppcheck+${name}
|
||||
COMMAND bin/cppcheck-test.sh ${CPPCHECK_PROGRAM} ${src} ${IPATHS}
|
||||
CONFIGURATIONS analyze cppcheck)
|
||||
endif()
|
||||
endif()
|
||||
if(CLANGCHECK_FOUND AND CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
if(NOT TEST clang-check+${name})
|
||||
add_test(NAME clang-check+${name}
|
||||
COMMAND bin/clang-check-test.sh ${CLANGCHECK_PROGRAM} ${src}
|
||||
CONFIGURATIONS analyze clang-check)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endfunction()
|
||||
198
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseSystemInfo.cmake
vendored
Normal file
198
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseSystemInfo.cmake
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
# - Print CMake and OS distribution version
|
||||
#
|
||||
function (system_info)
|
||||
message (STATUS "CMake version: ${CMAKE_VERSION}")
|
||||
if (CMAKE_SYSTEM MATCHES "Linux")
|
||||
distro_name (DISTRO_NAME)
|
||||
message (STATUS "Linux distribution: ${DISTRO_NAME}")
|
||||
elseif (CMAKE_SYSTEM MATCHES "Darwin")
|
||||
sw_vers (OS_VERSION)
|
||||
message (STATUS "${OS_VERSION}")
|
||||
else (CMAKE_SYSTEM MATCHES "Linux")
|
||||
message (STATUS "Operating system: ${CMAKE_SYSTEM}")
|
||||
endif (CMAKE_SYSTEM MATCHES "Linux")
|
||||
|
||||
target_architecture (TARGET_CPU)
|
||||
message (STATUS "Target architecture: ${TARGET_CPU}")
|
||||
endfunction (system_info)
|
||||
|
||||
function (sw_vers varname)
|
||||
# query operating system for information
|
||||
exec_program (sw_vers OUTPUT_VARIABLE _vers)
|
||||
# split multi-line into various fields
|
||||
string (REPLACE "\n" ";" _vers "${_vers}")
|
||||
string (REPLACE ":" ";" _vers "${_vers}")
|
||||
# get the various fields
|
||||
list (GET _vers 1 _prod_name)
|
||||
list (GET _vers 3 _prod_vers)
|
||||
list (GET _vers 5 _prod_build)
|
||||
# remove extraneous whitespace
|
||||
string (STRIP "${_prod_name}" _prod_name)
|
||||
string (STRIP "${_prod_vers}" _prod_vers)
|
||||
string (STRIP "${_prod_build}" _prod_build)
|
||||
# assemble result variable
|
||||
set (${varname} "${_prod_name} version: ${_prod_vers} (${_prod_build})" PARENT_SCOPE)
|
||||
endfunction (sw_vers varname)
|
||||
|
||||
# probe various system files that may be found
|
||||
function (distro_name varname)
|
||||
file (GLOB has_os_release /etc/os-release)
|
||||
file (GLOB has_lsb_release /etc/lsb-release)
|
||||
file (GLOB has_sys_release /etc/system-release)
|
||||
file (GLOB has_redhat_release /etc/redhat-release)
|
||||
set (_descr)
|
||||
# start with /etc/os-release,
|
||||
# see <http://0pointer.de/blog/projects/os-release.html>
|
||||
if (NOT has_os_release STREQUAL "")
|
||||
read_release (PRETTY_NAME FROM /etc/os-release INTO _descr)
|
||||
# previous "standard", used on older Ubuntu and Debian
|
||||
elseif (NOT has_lsb_release STREQUAL "")
|
||||
read_release (DISTRIB_DESCRIPTION FROM /etc/lsb-release INTO _descr)
|
||||
endif (NOT has_os_release STREQUAL "")
|
||||
# RHEL/CentOS etc. has just a text-file
|
||||
if (NOT _descr)
|
||||
if (NOT has_sys_release STREQUAL "")
|
||||
file (READ /etc/system-release _descr)
|
||||
elseif (NOT has_redhat_release STREQUAL "")
|
||||
file (READ /etc/redhat-release _descr)
|
||||
else (NOT has_sys_release STREQUAL "")
|
||||
# no yet known release file found
|
||||
set (_descr "unknown")
|
||||
endif (NOT has_sys_release STREQUAL "")
|
||||
endif (NOT _descr)
|
||||
# return from function (into appropriate variable)
|
||||
string (STRIP "${_descr}" _descr)
|
||||
set (${varname} "${_descr}" PARENT_SCOPE)
|
||||
endfunction (distro_name varname)
|
||||
|
||||
# read property from the newer /etc/os-release
|
||||
function (read_release valuename FROM filename INTO varname)
|
||||
file (STRINGS ${filename} _distrib
|
||||
REGEX "^${valuename}="
|
||||
)
|
||||
string (REGEX REPLACE
|
||||
"^${valuename}=\"?\(.*\)" "\\1" ${varname} "${_distrib}"
|
||||
)
|
||||
# remove trailing quote that got globbed by the wildcard (greedy match)
|
||||
string (REGEX REPLACE
|
||||
"\"$" "" ${varname} "${${varname}}"
|
||||
)
|
||||
set (${varname} "${${varname}}" PARENT_SCOPE)
|
||||
endfunction (read_release valuename FROM filename INTO varname)
|
||||
|
||||
# the following code is adapted from commit f7467762 of the code at
|
||||
# <https://github.com/petroules/solar-cmake/blob/master/TargetArch.cmake>
|
||||
# which is Copyright (c) 2012 Petroules Corporation, and which at the
|
||||
# time of download (2013-04-07 12:30 CET) is made available with a BSD license.
|
||||
#
|
||||
# it attempts to compile a program which detects the architecture from the
|
||||
# preprocessor symbols and communicate this back to us through an error message(!)
|
||||
function (target_architecture output_var)
|
||||
# OS X is capable of building for *several* architectures at once in
|
||||
# the Mach-O binary, and there is a variable that tells us which those
|
||||
# are, but they may be in any order, so they must be normalized
|
||||
if (APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
# detect each of the possible candidates as a separate flag
|
||||
set (osx_arch_list i386 x86_64)
|
||||
foreach (osx_arch IN ITEMS ${CMAKE_OSX_ARCHITECTURES})
|
||||
foreach (candidate IN LISTS osx_arch_list)
|
||||
if ("${osx_arch}" STREQUAL "${candidate}")
|
||||
set (osx_arch_${candidate} TRUE)
|
||||
endif ("${osx_arch}" STREQUAL "${candidate}")
|
||||
endforeach (candidate)
|
||||
endforeach (osx_arch)
|
||||
|
||||
# add all architectures back in normalized order
|
||||
foreach (candidate IN LISTS osx_arch_list)
|
||||
if (osx_arch_${candidate})
|
||||
list (APPEND ARCH ${candidate})
|
||||
endif (osx_arch_${candidate})
|
||||
endforeach (candidate)
|
||||
|
||||
else (APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
# use the preprocessor defines to determine which target architectures
|
||||
# that are available
|
||||
set (arch_c_src "
|
||||
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
|
||||
# if defined(__ARM_ARCH_7__) \\
|
||||
|| defined(__ARM_ARCH_7A__) \\
|
||||
|| defined(__ARM_ARCH_7R__) \\
|
||||
|| defined(__ARM_ARCH_7M__) \\
|
||||
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7)
|
||||
# error cmake_ARCH armv7
|
||||
# elif defined(__ARM_ARCH_6__) \\
|
||||
|| defined(__ARM_ARCH_6J__) \\
|
||||
|| defined(__ARM_ARCH_6T2__) \\
|
||||
|| defined(__ARM_ARCH_6Z__) \\
|
||||
|| defined(__ARM_ARCH_6K__) \\
|
||||
|| defined(__ARM_ARCH_6ZK__) \\
|
||||
|| defined(__ARM_ARCH_6M__) \\
|
||||
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
|
||||
# error cmake_ARCH armv6
|
||||
# elif defined(__ARM_ARCH_5TEJ__) \\
|
||||
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5)
|
||||
# error cmake_ARCH armv5
|
||||
# else
|
||||
# error cmake_ARCH arm
|
||||
# endif
|
||||
#elif defined(__i386) \\
|
||||
|| defined(__i386__) \\
|
||||
|| defined(_M_IX86)
|
||||
# error cmake_ARCH i386
|
||||
#elif defined(__x86_64) \\
|
||||
|| defined(__x86_64__) \\
|
||||
|| defined(__amd64) \\
|
||||
|| defined(_M_X64)
|
||||
# error cmake_ARCH x86_64
|
||||
#elif defined(__ia64) \\
|
||||
|| defined(__ia64__) \\
|
||||
|| defined(_M_IA64)
|
||||
# error cmake_ARCH ia64
|
||||
#elif defined(__ppc__) \\
|
||||
|| defined(__ppc) \\
|
||||
|| defined(__powerpc__) \\
|
||||
|| defined(_ARCH_COM) \\
|
||||
|| defined(_ARCH_PWR) \\
|
||||
|| defined(_ARCH_PPC) \\
|
||||
|| defined(_M_MPPC) \\
|
||||
|| defined(_M_PPC)
|
||||
# if defined(__ppc64__) \\
|
||||
|| defined(__powerpc64__) \\
|
||||
|| defined(__64BIT__)
|
||||
# error cmake_ARCH ppc64
|
||||
# else
|
||||
# error cmake_ARCH ppc
|
||||
# endif
|
||||
#else
|
||||
# error cmake_ARCH unknown
|
||||
#endif
|
||||
")
|
||||
|
||||
# write a temporary program that can be compiled to get the result
|
||||
set (tmp_dir "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp")
|
||||
set (arch_c "${tmp_dir}/arch.c")
|
||||
file (WRITE "${arch_c}" "${arch_c_src}")
|
||||
try_compile (
|
||||
compile_result_unused
|
||||
"${tmp_dir}"
|
||||
"${arch_c}"
|
||||
CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
|
||||
OUTPUT_VARIABLE ARCH
|
||||
)
|
||||
|
||||
# parse the architecture name from the compiler output
|
||||
string (REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}")
|
||||
|
||||
# get rid of the value marker leaving just the architecture name
|
||||
string (REPLACE "cmake_ARCH " "" ARCH "${ARCH}")
|
||||
|
||||
# if we are compiling with an unknown architecture this variable should
|
||||
# already be set to "unknown" but in the case that it's empty (i.e. due
|
||||
# to a typo in the code), then set it to unknown
|
||||
if (NOT ARCH)
|
||||
set (ARCH "unknown")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (${output_var} "${ARCH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
53
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseThreads.cmake
vendored
Normal file
53
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseThreads.cmake
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
# - Use PThread features
|
||||
#
|
||||
# Synopsis:
|
||||
#
|
||||
# find_threads (module)
|
||||
#
|
||||
# where:
|
||||
#
|
||||
# module Name of the module to which Threads support
|
||||
# etc. should be added, e.g. "opm-core".
|
||||
#
|
||||
# Note: Compiler flags are always added globally, to avoid ABI
|
||||
# incompatibility problems.
|
||||
#
|
||||
# It is assumed that the following variables are available
|
||||
#
|
||||
# ${module}_QUIET Verbosity level of the parent's find module
|
||||
# ${module}_LIBRARIES List of libraries to which Thread support will be added
|
||||
#
|
||||
# Example:
|
||||
# find_threads (opm-core)
|
||||
|
||||
include (AddOptions)
|
||||
include (UseCompVer)
|
||||
is_compiler_gcc_compatible ()
|
||||
|
||||
macro(find_threads opm)
|
||||
# default is that Threads are added
|
||||
option(USE_PTHREAD "Use pthreads" ON)
|
||||
|
||||
# if USE_PTHREAD is enabled then check and set HAVE_PTHREAD
|
||||
if( USE_PTHREAD )
|
||||
# threading library
|
||||
set (CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
find_package (Threads ${${opm}_QUIET})
|
||||
if (CMAKE_USE_PTHREADS_INIT)
|
||||
list (APPEND ${opm}_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
if (CXX_COMPAT_GCC)
|
||||
check_cxx_accepts_flag ("-pthread" HAVE_PTHREAD)
|
||||
if(HAVE_PTHREAD)
|
||||
add_options (ALL_LANGUAGES ALL_BUILDS "-pthread")
|
||||
set(HAVE_PTHREAD "1")
|
||||
endif(HAVE_PTHREAD)
|
||||
endif (CXX_COMPAT_GCC)
|
||||
else(CMAKE_USE_PTHREADS_INIT)
|
||||
set(USE_PTHREAD OFF)
|
||||
endif (CMAKE_USE_PTHREADS_INIT)
|
||||
else( USE_PTHREAD )
|
||||
# reset HAVE_PTHREAD
|
||||
set(HAVE_PTHREAD "")
|
||||
endif( USE_PTHREAD )
|
||||
|
||||
endmacro(find_threads opm)
|
||||
102
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseVCSInfo.cmake
vendored
Normal file
102
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseVCSInfo.cmake
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
# - Get version control information from source tree
|
||||
#
|
||||
# Sets the following variables
|
||||
#
|
||||
# VCS_SYSTEM Currently, this will only be "git", or empty if
|
||||
# no source code control system is found.
|
||||
#
|
||||
# VCS_SHA1 Hash code of the last commit. If this is empty,
|
||||
# then no source code repository was found.
|
||||
#
|
||||
# VCS_DECOR Characters that denotes any local modifications:
|
||||
# "*" - Unstaged local changes
|
||||
# "+" - Staged, but not committed, local changes
|
||||
# "%" - Untracked local files
|
||||
function (vcs_info)
|
||||
# if we haven't located git yet, then do it now
|
||||
if (NOT GIT_FOUND)
|
||||
find_package (Git)
|
||||
endif (NOT GIT_FOUND)
|
||||
|
||||
# if git is not installed (unpacked tarball), then just state that
|
||||
# the version practically is unknown
|
||||
set (VCS_DECOR "")
|
||||
if (GIT_FOUND)
|
||||
set (VCS_SYSTEM "git")
|
||||
|
||||
# assume that we have a .git subdirectory under the source directory;
|
||||
# if we have a bare repository, then we won't be able to build in there
|
||||
# and we won't be able to identify the git dir to use from only a work
|
||||
# tree, so we handle that like a regular unpacked tarball
|
||||
|
||||
# exec_program is used because execute_process is buggy on common
|
||||
# platforms (notable CMake 2.8.7 in Ubuntu Precise 12.04)
|
||||
|
||||
# get hash code
|
||||
exec_program (
|
||||
${GIT_EXECUTABLE} ${PROJECT_SOURCE_DIR}
|
||||
ARGS rev-parse --short --verify HEAD
|
||||
OUTPUT_VARIABLE VCS_SHA1
|
||||
RETURN_VALUE has_sha
|
||||
)
|
||||
|
||||
# exec_program mashes together output and error
|
||||
if (NOT ${has_sha} EQUAL 0)
|
||||
set (VCS_SHA1 "")
|
||||
endif (NOT ${has_sha} EQUAL 0)
|
||||
|
||||
# only proceed if we actually found a source tree in there
|
||||
if (VCS_SHA1)
|
||||
# check for unstaged local changes
|
||||
exec_program (
|
||||
${GIT_EXECUTABLE} ${PROJECT_SOURCE_DIR}
|
||||
ARGS diff --no-ext-diff --quiet --exit-code
|
||||
RETURN_VALUE dirty
|
||||
OUTPUT_VARIABLE _dummy
|
||||
)
|
||||
if (NOT ${dirty} EQUAL 0)
|
||||
list (APPEND VCS_DECOR "*")
|
||||
endif (NOT ${dirty} EQUAL 0)
|
||||
|
||||
# check for staged local changes
|
||||
exec_program (
|
||||
${GIT_EXECUTABLE} ${PROJECT_SOURCE_DIR}
|
||||
ARGS diff-index --no-ext-diff --cached --quiet --exit-code HEAD --
|
||||
RETURN_VALUE staged
|
||||
OUTPUT_VARIABLE _dummy
|
||||
)
|
||||
if (NOT ${staged} EQUAL 0)
|
||||
list (APPEND VCS_DECOR "+")
|
||||
endif (NOT ${staged} EQUAL 0)
|
||||
|
||||
# check for untracked files
|
||||
exec_program (
|
||||
${GIT_EXECUTABLE} ${PROJECT_SOURCE_DIR}
|
||||
ARGS ls-files --others --exclude-standard
|
||||
OUTPUT_VARIABLE untracked
|
||||
)
|
||||
if (untracked)
|
||||
list (APPEND VCS_DECOR "%")
|
||||
endif (untracked)
|
||||
|
||||
# convert list to regular string
|
||||
string (REPLACE ";" "" VCS_DECOR "${VCS_DECOR}")
|
||||
endif (VCS_SHA1)
|
||||
else (GIT_FOUND)
|
||||
set (VCS_SYSTEM "")
|
||||
set (VCS_SHA1 "")
|
||||
set (VCS_DECOR "")
|
||||
endif (GIT_FOUND)
|
||||
|
||||
# diagnostic output
|
||||
if (VCS_SYSTEM AND VCS_SHA1)
|
||||
message (STATUS "Source code repository: ${VCS_SYSTEM} ${VCS_SHA1}${VCS_DECOR}")
|
||||
else (VCS_SYSTEM AND VCS_SHA1)
|
||||
message (STATUS "Source code repository: not found!")
|
||||
endif (VCS_SYSTEM AND VCS_SHA1)
|
||||
|
||||
# export to parent context
|
||||
set (VCS_SYSTEM "${VCS_SYSTEM}" PARENT_SCOPE)
|
||||
set (VCS_SHA1 "${VCS_SHA1}" PARENT_SCOPE)
|
||||
set (VCS_DECOR "${VCS_DECOR}" PARENT_SCOPE)
|
||||
endfunction (vcs_info)
|
||||
120
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseVersion.cmake
vendored
Normal file
120
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseVersion.cmake
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
# - Write version information into the source code
|
||||
#
|
||||
# Add an unconditional target to the Makefile which checks the current
|
||||
# SHA of the source directory and write to a header file if and *only*
|
||||
# if this has changed (thus we avoid unnecessary rebuilds). By having
|
||||
# this in the Makefile, we get updated version information even though
|
||||
# we haven't done any reconfiguring.
|
||||
#
|
||||
# The time it takes to probe the VCS for this information and write it
|
||||
# to the miniature file in negligable.
|
||||
#
|
||||
# If the build type is Debug, then we only write a static version
|
||||
# information as it gets tiresome to rebuild the project everytime one
|
||||
# makes changes to any of the unit tests.
|
||||
|
||||
message("-- Writing version information to local header project-version.h")
|
||||
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
|
||||
|
||||
string (TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_upper_)
|
||||
if (cmake_build_type_upper_ MATCHES DEBUG)
|
||||
file (WRITE "${PROJECT_BINARY_DIR}/project-version.h"
|
||||
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||
"#define OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||
"#define PROJECT_VERSION_NAME \"${${project}_LABEL}\"\n"
|
||||
"#define PROJECT_VERSION_HASH \"debug\"\n"
|
||||
"#define PROJECT_VERSION \"${${project}_LABEL} (debug)\"\n"
|
||||
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||
)
|
||||
|
||||
# Write header file with build timestamp
|
||||
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
|
||||
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
||||
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
||||
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
|
||||
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
||||
)
|
||||
else ()
|
||||
if (NOT GIT_FOUND)
|
||||
find_package (Git)
|
||||
endif ()
|
||||
|
||||
# if git is *still* not found means it is not present on the
|
||||
# system, so there is "no" way we can update the SHA. notice
|
||||
# that this is a slightly different version of the label than
|
||||
# above.
|
||||
if (NOT GIT_FOUND)
|
||||
file (WRITE "${PROJECT_BINARY_DIR}/project-version.h"
|
||||
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||
"#define OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||
"#define PROJECT_VERSION_NAME \"${${project}_LABEL}\"\n"
|
||||
"#define PROJECT_VERSION_HASH \"unknown git version\"\n"
|
||||
"#define PROJECT_VERSION \"${${project}_LABEL} (unknown git version)\"\n"
|
||||
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||
)
|
||||
# Write header file with build timestamp
|
||||
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
|
||||
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
||||
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
||||
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
|
||||
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
||||
)
|
||||
else ()
|
||||
add_custom_target (update-version ALL
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DCMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY}
|
||||
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
|
||||
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
|
||||
-DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}
|
||||
-DPROJECT_LABEL=${${project}_LABEL}
|
||||
-P ${OPM_MACROS_ROOT}/cmake/Scripts/WriteVerSHA.cmake
|
||||
COMMENT "Updating version information"
|
||||
)
|
||||
|
||||
# the target above gets built every time thanks to the "ALL" modifier,
|
||||
# but it must also be done before the main library so it can pick up
|
||||
# any changes it does.
|
||||
if (${project}_TARGET)
|
||||
add_dependencies (${${project}_TARGET} update-version)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# safety precaution: check that we don't have version number mismatch.
|
||||
|
||||
# first get the name of the module (e.g. "core")
|
||||
set (_module_regexp "([^-]+)-(.*)")
|
||||
string (REGEX REPLACE "${_module_regexp}" "\\1" _suite_name "${project}")
|
||||
string (REGEX REPLACE "${_module_regexp}" "\\2" _module_name "${project}")
|
||||
|
||||
# if we have a version number it must be in this file, e.g. opm/core/version.h
|
||||
set (_rel_ver_h "${${project}_DIR}/${_module_name}/version.h")
|
||||
set (_version_h "${PROJECT_SOURCE_DIR}/${_rel_ver_h}")
|
||||
|
||||
# not all modules have version files, so only check if they do
|
||||
if (EXISTS "${_version_h}")
|
||||
# uppercase versions which is used in the file
|
||||
string (TOUPPER "${_suite_name}" _suite_upper)
|
||||
string (TOUPPER "${_module_name}" _module_upper)
|
||||
|
||||
# scan the files for version define for major version
|
||||
set (_major_regexp "#define[ ]+${_suite_upper}_${_module_upper}_VERSION_MAJOR[ ]+([0-9]*)")
|
||||
file (STRINGS "${_version_h}" _version_h_major REGEX "${_major_regexp}")
|
||||
string (REGEX REPLACE "${_major_regexp}" "\\1" _version_h_major "${_version_h_major}")
|
||||
|
||||
# exactly the same, but minor version (making a macro is more lines...)
|
||||
set (_minor_regexp "#define[ ]+${_suite_upper}_${_module_upper}_VERSION_MINOR[ ]+([0-9]*)")
|
||||
file (STRINGS "${_version_h}" _version_h_minor REGEX "${_minor_regexp}")
|
||||
string (REGEX REPLACE "${_minor_regexp}" "\\1" _version_h_minor "${_version_h_minor}")
|
||||
|
||||
# compare what we got from the file with what we have defined here
|
||||
if (NOT (("${_version_h_major}" EQUAL "${${project}_VERSION_MAJOR}")
|
||||
AND ("${_version_h_minor}" EQUAL "${${project}_VERSION_MINOR}")))
|
||||
set (_proj_ver "${${project}_VERSION_MAJOR}.${${project}_VERSION_MINOR}")
|
||||
set (_file_ver "${_version_h_major}.${_version_h_minor}")
|
||||
message (AUTHOR_WARNING
|
||||
"Version in build system (dune.module) is \"${_proj_ver}\", "
|
||||
"but version in source (${_rel_ver_h}) is \"${_file_ver}\""
|
||||
)
|
||||
endif ()
|
||||
endif ()
|
||||
19
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseWarnings.cmake
vendored
Normal file
19
ThirdParty/custom-opm-common/opm-common/cmake/Modules/UseWarnings.cmake
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# - Turn on warnings when compiling
|
||||
|
||||
include (AddOptions)
|
||||
include (UseCompVer)
|
||||
is_compiler_gcc_compatible ()
|
||||
|
||||
if (CXX_COMPAT_GCC)
|
||||
# default warnings flags, if not set by user
|
||||
set_default_option (CXX _warn_flag "-Wall -Wextra -Wshadow" "(^|\ )-W")
|
||||
if (_warn_flag)
|
||||
message (STATUS "All warnings enabled: ${_warn_flag}")
|
||||
add_options (ALL_LANGUAGES ALL_BUILDS "${_warn_flag}")
|
||||
endif (_warn_flag)
|
||||
endif ()
|
||||
|
||||
option(SILENCE_EXTERNAL_WARNINGS "Disable some warnings from external packages (requires GCC 4.6 or newer)" OFF)
|
||||
if(SILENCE_EXTERNAL_WARNINGS AND CXX_COMPAT_GCC)
|
||||
add_definitions(-DSILENCE_EXTERNAL_WARNINGS)
|
||||
endif()
|
||||
138
ThirdParty/custom-opm-common/opm-common/cmake/Modules/compat-2.8.3/CMakeParseArguments.cmake
vendored
Normal file
138
ThirdParty/custom-opm-common/opm-common/cmake/Modules/compat-2.8.3/CMakeParseArguments.cmake
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
|
||||
#
|
||||
# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
|
||||
# parsing the arguments given to that macro or function.
|
||||
# It processes the arguments and defines a set of variables which hold the
|
||||
# values of the respective options.
|
||||
#
|
||||
# The <options> argument contains all options for the respective macro,
|
||||
# i.e. keywords which can be used when calling the macro without any value
|
||||
# following, like e.g. the OPTIONAL keyword of the install() command.
|
||||
#
|
||||
# The <one_value_keywords> argument contains all keywords for this macro
|
||||
# which are followed by one value, like e.g. DESTINATION keyword of the
|
||||
# install() command.
|
||||
#
|
||||
# The <multi_value_keywords> argument contains all keywords for this macro
|
||||
# which can be followed by more than one value, like e.g. the TARGETS or
|
||||
# FILES keywords of the install() command.
|
||||
#
|
||||
# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
|
||||
# keywords listed in <options>, <one_value_keywords> and
|
||||
# <multi_value_keywords> a variable composed of the given <prefix>
|
||||
# followed by "_" and the name of the respective keyword.
|
||||
# These variables will then hold the respective value from the argument list.
|
||||
# For the <options> keywords this will be TRUE or FALSE.
|
||||
#
|
||||
# All remaining arguments are collected in a variable
|
||||
# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
|
||||
# your macro was called with unrecognized parameters.
|
||||
#
|
||||
# As an example here a my_install() macro, which takes similar arguments as the
|
||||
# real install() command:
|
||||
#
|
||||
# function(MY_INSTALL)
|
||||
# set(options OPTIONAL FAST)
|
||||
# set(oneValueArgs DESTINATION RENAME)
|
||||
# set(multiValueArgs TARGETS CONFIGURATIONS)
|
||||
# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
# ...
|
||||
#
|
||||
# Assume my_install() has been called like this:
|
||||
# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
|
||||
#
|
||||
# After the cmake_parse_arguments() call the macro will have set the following
|
||||
# variables:
|
||||
# MY_INSTALL_OPTIONAL = TRUE
|
||||
# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
|
||||
# MY_INSTALL_DESTINATION = "bin"
|
||||
# MY_INSTALL_RENAME = "" (was not used)
|
||||
# MY_INSTALL_TARGETS = "foo;bar"
|
||||
# MY_INSTALL_CONFIGURATIONS = "" (was not used)
|
||||
# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
|
||||
#
|
||||
# You can the continue and process these variables.
|
||||
#
|
||||
# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
|
||||
# another recognized keyword follows, this is interpreted as the beginning of
|
||||
# the new option.
|
||||
# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
|
||||
# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
|
||||
# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
|
||||
if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
|
||||
|
||||
|
||||
function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
|
||||
# first set all result variables to empty/FALSE
|
||||
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
|
||||
set(${prefix}_${arg_name})
|
||||
endforeach(arg_name)
|
||||
|
||||
foreach(option ${_optionNames})
|
||||
set(${prefix}_${option} FALSE)
|
||||
endforeach(option)
|
||||
|
||||
set(${prefix}_UNPARSED_ARGUMENTS)
|
||||
|
||||
set(insideValues FALSE)
|
||||
set(currentArgName)
|
||||
|
||||
# now iterate over all arguments and fill the result variables
|
||||
foreach(currentArg ${ARGN})
|
||||
list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
|
||||
list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
|
||||
list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
|
||||
|
||||
if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
|
||||
if(insideValues)
|
||||
if("${insideValues}" STREQUAL "SINGLE")
|
||||
set(${prefix}_${currentArgName} ${currentArg})
|
||||
set(insideValues FALSE)
|
||||
elseif("${insideValues}" STREQUAL "MULTI")
|
||||
list(APPEND ${prefix}_${currentArgName} ${currentArg})
|
||||
endif()
|
||||
else(insideValues)
|
||||
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
|
||||
endif(insideValues)
|
||||
else()
|
||||
if(NOT ${optionIndex} EQUAL -1)
|
||||
set(${prefix}_${currentArg} TRUE)
|
||||
set(insideValues FALSE)
|
||||
elseif(NOT ${singleArgIndex} EQUAL -1)
|
||||
set(currentArgName ${currentArg})
|
||||
set(${prefix}_${currentArgName})
|
||||
set(insideValues "SINGLE")
|
||||
elseif(NOT ${multiArgIndex} EQUAL -1)
|
||||
set(currentArgName ${currentArg})
|
||||
set(${prefix}_${currentArgName})
|
||||
set(insideValues "MULTI")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endforeach(currentArg)
|
||||
|
||||
# propagate the result variables to the caller:
|
||||
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
|
||||
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
|
||||
endforeach(arg_name)
|
||||
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
|
||||
|
||||
endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)
|
||||
47
ThirdParty/custom-opm-common/opm-common/cmake/Modules/compat-2.8.5/FindGit.cmake
vendored
Normal file
47
ThirdParty/custom-opm-common/opm-common/cmake/Modules/compat-2.8.5/FindGit.cmake
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
# The module defines the following variables:
|
||||
# GIT_EXECUTABLE - path to git command line client
|
||||
# GIT_FOUND - true if the command line client was found
|
||||
# Example usage:
|
||||
# find_package(Git)
|
||||
# if(GIT_FOUND)
|
||||
# message("git found: ${GIT_EXECUTABLE}")
|
||||
# endif()
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2010 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# Look for 'git' or 'eg' (easy git)
|
||||
#
|
||||
set(git_names git eg)
|
||||
|
||||
# Prefer .cmd variants on Windows unless running in a Makefile
|
||||
# in the MSYS shell.
|
||||
#
|
||||
if(WIN32)
|
||||
if(NOT CMAKE_GENERATOR MATCHES "MSYS")
|
||||
set(git_names git.cmd git eg.cmd eg)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_program(GIT_EXECUTABLE
|
||||
NAMES ${git_names}
|
||||
PATH_SUFFIXES Git/cmd Git/bin
|
||||
DOC "git command line client"
|
||||
)
|
||||
mark_as_advanced(GIT_EXECUTABLE)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)
|
||||
61
ThirdParty/custom-opm-common/opm-common/cmake/Modules/compat-2.8.7/CMakePushCheckState.cmake
vendored
Normal file
61
ThirdParty/custom-opm-common/opm-common/cmake/Modules/compat-2.8.7/CMakePushCheckState.cmake
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
# This module defines two macros:
|
||||
# CMAKE_PUSH_CHECK_STATE()
|
||||
# and
|
||||
# CMAKE_POP_CHECK_STATE()
|
||||
# These two macros can be used to save and restore the state of the variables
|
||||
# CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES
|
||||
# and CMAKE_REQUIRED_INCLUDES used by the various Check-files coming with CMake,
|
||||
# like e.g. check_function_exists() etc.
|
||||
# The variable contents are pushed on a stack, pushing multiple times is supported.
|
||||
# This is useful e.g. when executing such tests in a Find-module, where they have to be set,
|
||||
# but after the Find-module has been executed they should have the same value
|
||||
# as they had before.
|
||||
#
|
||||
# Usage:
|
||||
# cmake_push_check_state()
|
||||
# set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
|
||||
# check_function_exists(...)
|
||||
# cmake_pop_check_state()
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2011 Alexander Neundorf, <neundorf@kde.org>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
|
||||
MACRO(CMAKE_PUSH_CHECK_STATE)
|
||||
|
||||
IF(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
|
||||
SET(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
|
||||
ENDIF()
|
||||
|
||||
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
|
||||
|
||||
SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
|
||||
SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
|
||||
SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
|
||||
SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
|
||||
ENDMACRO(CMAKE_PUSH_CHECK_STATE)
|
||||
|
||||
MACRO(CMAKE_POP_CHECK_STATE)
|
||||
|
||||
# don't pop more than we pushed
|
||||
IF("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
|
||||
|
||||
SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||
SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||
SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||
|
||||
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
|
||||
ENDIF()
|
||||
|
||||
ENDMACRO(CMAKE_POP_CHECK_STATE)
|
||||
624
ThirdParty/custom-opm-common/opm-common/cmake/Modules/compat-2.8.7/FindBLAS.cmake
vendored
Normal file
624
ThirdParty/custom-opm-common/opm-common/cmake/Modules/compat-2.8.7/FindBLAS.cmake
vendored
Normal file
@@ -0,0 +1,624 @@
|
||||
# - Find BLAS library
|
||||
# This module finds an installed fortran library that implements the BLAS
|
||||
# linear-algebra interface (see http://www.netlib.org/blas/).
|
||||
# The list of libraries searched for is taken
|
||||
# from the autoconf macro file, acx_blas.m4 (distributed at
|
||||
# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
|
||||
#
|
||||
# This module sets the following variables:
|
||||
# BLAS_FOUND - set to true if a library implementing the BLAS interface
|
||||
# is found
|
||||
# BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
|
||||
# and -L).
|
||||
# BLAS_LIBRARIES - uncached list of libraries (using full path name) to
|
||||
# link against to use BLAS
|
||||
# BLAS95_LIBRARIES - uncached list of libraries (using full path name)
|
||||
# to link against to use BLAS95 interface
|
||||
# BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
|
||||
# is found
|
||||
# BLA_STATIC if set on this determines what kind of linkage we do (static)
|
||||
# BLA_VENDOR if set checks only the specified vendor, if not set checks
|
||||
# all the possibilities
|
||||
# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
|
||||
##########
|
||||
### List of vendors (BLA_VENDOR) valid in this module
|
||||
## Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model),
|
||||
## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic
|
||||
# C/CXX should be enabled to use Intel mkl
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2007-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
include(CheckFunctionExists)
|
||||
include(CheckFortranFunctionExists)
|
||||
|
||||
set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
# Check the language being used
|
||||
get_property( _LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES )
|
||||
if( _LANGUAGES_ MATCHES Fortran )
|
||||
set( _CHECK_FORTRAN TRUE )
|
||||
elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) )
|
||||
set( _CHECK_FORTRAN FALSE )
|
||||
else()
|
||||
if(BLAS_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.")
|
||||
else(BLAS_FIND_REQUIRED)
|
||||
message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)")
|
||||
return()
|
||||
endif(BLAS_FIND_REQUIRED)
|
||||
endif( )
|
||||
|
||||
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
|
||||
# This macro checks for the existence of the combination of fortran libraries
|
||||
# given by _list. If the combination is found, this macro checks (using the
|
||||
# Check_Fortran_Function_Exists macro) whether can link against that library
|
||||
# combination using the name of a routine given by _name using the linker
|
||||
# flags given by _flags. If the combination of libraries is found and passes
|
||||
# the link test, LIBRARIES is set to the list of complete library paths that
|
||||
# have been found. Otherwise, LIBRARIES is set to FALSE.
|
||||
|
||||
# N.B. _prefix is the prefix applied to the names of all cached variables that
|
||||
# are generated internally and marked advanced by this macro.
|
||||
|
||||
set(_libdir ${ARGN})
|
||||
|
||||
set(_libraries_work TRUE)
|
||||
set(${LIBRARIES})
|
||||
set(_combined_name)
|
||||
if (NOT _libdir)
|
||||
if (WIN32)
|
||||
set(_libdir ENV LIB)
|
||||
elseif (APPLE)
|
||||
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH)
|
||||
else ()
|
||||
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
|
||||
endif ()
|
||||
endif ()
|
||||
foreach(_library ${_list})
|
||||
set(_combined_name ${_combined_name}_${_library})
|
||||
|
||||
if(_libraries_work)
|
||||
if (BLA_STATIC)
|
||||
if (WIN32)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif ( WIN32 )
|
||||
if (APPLE)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
else (APPLE)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif (APPLE)
|
||||
else (BLA_STATIC)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# for ubuntu's libblas3gf and liblapack3gf packages
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
|
||||
endif ()
|
||||
endif (BLA_STATIC)
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ${_libdir}
|
||||
)
|
||||
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
|
||||
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
||||
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
|
||||
endif(_libraries_work)
|
||||
endforeach(_library ${_list})
|
||||
if(_libraries_work)
|
||||
# Test this combination of libraries.
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads})
|
||||
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
||||
if (_CHECK_FORTRAN)
|
||||
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
|
||||
else()
|
||||
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
|
||||
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
|
||||
endif(_libraries_work)
|
||||
if(NOT _libraries_work)
|
||||
set(${LIBRARIES} FALSE)
|
||||
endif(NOT _libraries_work)
|
||||
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
|
||||
endmacro(Check_Fortran_Libraries)
|
||||
|
||||
set(BLAS_LINKER_FLAGS)
|
||||
set(BLAS_LIBRARIES)
|
||||
set(BLAS95_LIBRARIES)
|
||||
if ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||
set(BLA_VENDOR $ENV{BLA_VENDOR})
|
||||
else ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||
if(NOT BLA_VENDOR)
|
||||
set(BLA_VENDOR "All")
|
||||
endif(NOT BLA_VENDOR)
|
||||
endif ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||
|
||||
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
# gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"goto2"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
dgemm
|
||||
""
|
||||
"f77blas;atlas"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
|
||||
if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"sgemm;dgemm;blas"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
# BLAS in Alpha CXML library?
|
||||
if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"cxml"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
# BLAS in Alpha DXML library? (now called CXML, see above)
|
||||
if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"dxml"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
# BLAS in Sun Performance library?
|
||||
if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
"-xlic_lib=sunperf"
|
||||
"sunperf;sunmath"
|
||||
""
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
|
||||
endif(BLAS_LIBRARIES)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
# BLAS in SCSL library? (SGI/Cray Scientific Library)
|
||||
if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"scsl"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
# BLAS in SGIMATH library?
|
||||
if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"complib.sgimath"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
|
||||
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"essl;blas"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
#BLAS in acml library?
|
||||
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
|
||||
if( ((BLA_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR
|
||||
((BLA_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) OR
|
||||
((BLA_VENDOR STREQUAL "ACML_GPU") AND (NOT BLAS_ACML_GPU_LIB_DIRS))
|
||||
)
|
||||
# try to find acml in "standard" paths
|
||||
if( WIN32 )
|
||||
file( GLOB _ACML_ROOT "C:/AMD/acml*/ACML-EULA.txt" )
|
||||
else()
|
||||
file( GLOB _ACML_ROOT "/opt/acml*/ACML-EULA.txt" )
|
||||
endif()
|
||||
if( WIN32 )
|
||||
file( GLOB _ACML_GPU_ROOT "C:/AMD/acml*/GPGPUexamples" )
|
||||
else()
|
||||
file( GLOB _ACML_GPU_ROOT "/opt/acml*/GPGPUexamples" )
|
||||
endif()
|
||||
list(GET _ACML_ROOT 0 _ACML_ROOT)
|
||||
list(GET _ACML_GPU_ROOT 0 _ACML_GPU_ROOT)
|
||||
if( _ACML_ROOT )
|
||||
get_filename_component( _ACML_ROOT ${_ACML_ROOT} PATH )
|
||||
if( SIZEOF_INTEGER EQUAL 8 )
|
||||
set( _ACML_PATH_SUFFIX "_int64" )
|
||||
else()
|
||||
set( _ACML_PATH_SUFFIX "" )
|
||||
endif()
|
||||
if( CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" )
|
||||
set( _ACML_COMPILER32 "ifort32" )
|
||||
set( _ACML_COMPILER64 "ifort64" )
|
||||
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "SunPro" )
|
||||
set( _ACML_COMPILER32 "sun32" )
|
||||
set( _ACML_COMPILER64 "sun64" )
|
||||
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" )
|
||||
set( _ACML_COMPILER32 "pgi32" )
|
||||
if( WIN32 )
|
||||
set( _ACML_COMPILER64 "win64" )
|
||||
else()
|
||||
set( _ACML_COMPILER64 "pgi64" )
|
||||
endif()
|
||||
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "Open64" )
|
||||
# 32 bit builds not supported on Open64 but for code simplicity
|
||||
# We'll just use the same directory twice
|
||||
set( _ACML_COMPILER32 "open64_64" )
|
||||
set( _ACML_COMPILER64 "open64_64" )
|
||||
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
|
||||
set( _ACML_COMPILER32 "nag32" )
|
||||
set( _ACML_COMPILER64 "nag64" )
|
||||
else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
|
||||
set( _ACML_COMPILER32 "gfortran32" )
|
||||
set( _ACML_COMPILER64 "gfortran64" )
|
||||
endif()
|
||||
|
||||
if( BLA_VENDOR STREQUAL "ACML_MP" )
|
||||
set(_ACML_MP_LIB_DIRS
|
||||
"${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib"
|
||||
"${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" )
|
||||
else() #if( _BLAS_VENDOR STREQUAL "ACML" )
|
||||
set(_ACML_LIB_DIRS
|
||||
"${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib"
|
||||
"${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
|
||||
endif()
|
||||
endif()
|
||||
elseif(BLAS_${BLA_VENDOR}_LIB_DIRS)
|
||||
set(_${BLA_VENDOR}_LIB_DIRS ${BLAS_${BLA_VENDOR}_LIB_DIRS})
|
||||
endif()
|
||||
|
||||
if( BLA_VENDOR STREQUAL "ACML_MP" )
|
||||
foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS})
|
||||
check_fortran_libraries (
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
"" "acml_mp;acml_mv" "" ${BLAS_ACML_MP_LIB_DIRS}
|
||||
)
|
||||
if( BLAS_LIBRARIES )
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
elseif( BLA_VENDOR STREQUAL "ACML_GPU" )
|
||||
foreach( BLAS_ACML_GPU_LIB_DIRS ${_ACML_GPU_LIB_DIRS})
|
||||
check_fortran_libraries (
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
"" "acml;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS}
|
||||
)
|
||||
if( BLAS_LIBRARIES )
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
else() #if( _BLAS_VENDOR STREQUAL "ACML" )
|
||||
foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} )
|
||||
check_fortran_libraries (
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
"" "acml;acml_mv" "" ${BLAS_ACML_LIB_DIRS}
|
||||
)
|
||||
if( BLAS_LIBRARIES )
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Either acml or acml_mp should be in LD_LIBRARY_PATH but not both
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"acml;acml_mv"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"acml_mp;acml_mv"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"acml;acml_mv;CALBLAS"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif () # ACML
|
||||
|
||||
# Apple BLAS library?
|
||||
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
dgemm
|
||||
""
|
||||
"Accelerate"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
||||
if ( NOT BLAS_LIBRARIES )
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
dgemm
|
||||
""
|
||||
"vecLib"
|
||||
""
|
||||
)
|
||||
endif ( NOT BLAS_LIBRARIES )
|
||||
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
||||
# Generic BLAS library?
|
||||
if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"blas"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
#BLAS in intel mkl 10 library? (em64t 64bit)
|
||||
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||
if (NOT WIN32)
|
||||
set(LM "-lm")
|
||||
endif ()
|
||||
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||
if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
|
||||
find_package(Threads)
|
||||
else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
|
||||
if (WIN32)
|
||||
if(BLA_F95)
|
||||
if(NOT BLAS95_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS95_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl_blas95;mkl_intel_c;mkl_intel_thread;mkl_core;libguide40"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS95_LIBRARIES)
|
||||
else(BLA_F95)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
SGEMM
|
||||
""
|
||||
"mkl_c_dll;mkl_intel_thread_dll;mkl_core_dll;libguide40"
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif(BLA_F95)
|
||||
else(WIN32)
|
||||
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
|
||||
if(BLA_F95)
|
||||
if(NOT BLAS95_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS95_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl_blas95;mkl_intel;mkl_intel_thread;mkl_core;guide"
|
||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||
)
|
||||
endif(NOT BLAS95_LIBRARIES)
|
||||
else(BLA_F95)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl_intel;mkl_intel_thread;mkl_core;guide"
|
||||
"${CMAKE_THREAD_LIBS_INIT}"
|
||||
"${LM}"
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif(BLA_F95)
|
||||
endif (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
|
||||
if(BLA_F95)
|
||||
if(NOT BLAS95_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS95_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl_blas95;mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
|
||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||
)
|
||||
endif(NOT BLAS95_LIBRARIES)
|
||||
else(BLA_F95)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
|
||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif(BLA_F95)
|
||||
endif (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
|
||||
endif (WIN32)
|
||||
#older vesions of intel mkl libs
|
||||
# BLAS in intel mkl library? (shared)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl;guide"
|
||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
#BLAS in intel mkl library? (static, 32bit)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl_ia32;guide"
|
||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
#BLAS in intel mkl library? (static, em64t 64bit)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl_em64t;guide"
|
||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
|
||||
if(BLA_F95)
|
||||
if(BLAS95_LIBRARIES)
|
||||
set(BLAS95_FOUND TRUE)
|
||||
else(BLAS95_LIBRARIES)
|
||||
set(BLAS95_FOUND FALSE)
|
||||
endif(BLAS95_LIBRARIES)
|
||||
|
||||
if(NOT BLAS_FIND_QUIETLY)
|
||||
if(BLAS95_FOUND)
|
||||
message(STATUS "A library with BLAS95 API found.")
|
||||
else(BLAS95_FOUND)
|
||||
if(BLAS_FIND_REQUIRED)
|
||||
message(FATAL_ERROR
|
||||
"A required library with BLAS95 API not found. Please specify library location.")
|
||||
else(BLAS_FIND_REQUIRED)
|
||||
message(STATUS
|
||||
"A library with BLAS95 API not found. Please specify library location.")
|
||||
endif(BLAS_FIND_REQUIRED)
|
||||
endif(BLAS95_FOUND)
|
||||
endif(NOT BLAS_FIND_QUIETLY)
|
||||
set(BLAS_FOUND TRUE)
|
||||
set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
|
||||
else(BLA_F95)
|
||||
if(BLAS_LIBRARIES)
|
||||
set(BLAS_FOUND TRUE)
|
||||
else(BLAS_LIBRARIES)
|
||||
set(BLAS_FOUND FALSE)
|
||||
endif(BLAS_LIBRARIES)
|
||||
|
||||
if(NOT BLAS_FIND_QUIETLY)
|
||||
if(BLAS_FOUND)
|
||||
message(STATUS "A library with BLAS API found.")
|
||||
else(BLAS_FOUND)
|
||||
if(BLAS_FIND_REQUIRED)
|
||||
message(FATAL_ERROR
|
||||
"A required library with BLAS API not found. Please specify library location."
|
||||
)
|
||||
else(BLAS_FIND_REQUIRED)
|
||||
message(STATUS
|
||||
"A library with BLAS API not found. Please specify library location."
|
||||
)
|
||||
endif(BLAS_FIND_REQUIRED)
|
||||
endif(BLAS_FOUND)
|
||||
endif(NOT BLAS_FIND_QUIETLY)
|
||||
endif(BLA_F95)
|
||||
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
307
ThirdParty/custom-opm-common/opm-common/cmake/Modules/compat-2.8.7/FindLAPACK.cmake
vendored
Normal file
307
ThirdParty/custom-opm-common/opm-common/cmake/Modules/compat-2.8.7/FindLAPACK.cmake
vendored
Normal file
@@ -0,0 +1,307 @@
|
||||
# - Find LAPACK library
|
||||
# This module finds an installed fortran library that implements the LAPACK
|
||||
# linear-algebra interface (see http://www.netlib.org/lapack/).
|
||||
#
|
||||
# The approach follows that taken for the autoconf macro file, acx_lapack.m4
|
||||
# (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
|
||||
#
|
||||
# This module sets the following variables:
|
||||
# LAPACK_FOUND - set to true if a library implementing the LAPACK interface
|
||||
# is found
|
||||
# LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
|
||||
# and -L).
|
||||
# LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
|
||||
# link against to use LAPACK
|
||||
# LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
|
||||
# link against to use LAPACK95
|
||||
# LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
|
||||
# interface is found
|
||||
# BLA_STATIC if set on this determines what kind of linkage we do (static)
|
||||
# BLA_VENDOR if set checks only the specified vendor, if not set checks
|
||||
# all the possibilities
|
||||
# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
|
||||
### List of vendors (BLA_VENDOR) valid in this module
|
||||
## Intel(mkl), ACML,Apple, NAS, Generic
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2007-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
if (NOT _LANGUAGES_ MATCHES Fortran)
|
||||
include(CheckFunctionExists)
|
||||
else (NOT _LANGUAGES_ MATCHES Fortran)
|
||||
include(CheckFortranFunctionExists)
|
||||
endif (NOT _LANGUAGES_ MATCHES Fortran)
|
||||
|
||||
set(LAPACK_FOUND FALSE)
|
||||
set(LAPACK95_FOUND FALSE)
|
||||
|
||||
# TODO: move this stuff to separate module
|
||||
|
||||
macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads)
|
||||
# This macro checks for the existence of the combination of fortran libraries
|
||||
# given by _list. If the combination is found, this macro checks (using the
|
||||
# Check_Fortran_Function_Exists macro) whether can link against that library
|
||||
# combination using the name of a routine given by _name using the linker
|
||||
# flags given by _flags. If the combination of libraries is found and passes
|
||||
# the link test, LIBRARIES is set to the list of complete library paths that
|
||||
# have been found. Otherwise, LIBRARIES is set to FALSE.
|
||||
|
||||
# N.B. _prefix is the prefix applied to the names of all cached variables that
|
||||
# are generated internally and marked advanced by this macro.
|
||||
|
||||
set(_libraries_work TRUE)
|
||||
set(${LIBRARIES})
|
||||
set(_combined_name)
|
||||
if (NOT _libdir)
|
||||
if (WIN32)
|
||||
set(_libdir ENV LIB)
|
||||
elseif (APPLE)
|
||||
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH)
|
||||
else ()
|
||||
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
|
||||
endif ()
|
||||
endif ()
|
||||
foreach(_library ${_list})
|
||||
set(_combined_name ${_combined_name}_${_library})
|
||||
|
||||
if(_libraries_work)
|
||||
if (BLA_STATIC)
|
||||
if (WIN32)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif ( WIN32 )
|
||||
if (APPLE)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
else (APPLE)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif (APPLE)
|
||||
else (BLA_STATIC)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# for ubuntu's libblas3gf and liblapack3gf packages
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
|
||||
endif ()
|
||||
endif (BLA_STATIC)
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ${_libdir}
|
||||
)
|
||||
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
|
||||
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
||||
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
|
||||
endif(_libraries_work)
|
||||
endforeach(_library ${_list})
|
||||
|
||||
if(_libraries_work)
|
||||
# Test this combination of libraries.
|
||||
if(UNIX AND BLA_STATIC)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group" ${${LIBRARIES}} ${_blas} "-Wl,--end-group" ${_threads})
|
||||
else(UNIX AND BLA_STATIC)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads})
|
||||
endif(UNIX AND BLA_STATIC)
|
||||
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
||||
if (NOT _LANGUAGES_ MATCHES Fortran)
|
||||
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
|
||||
else (NOT _LANGUAGES_ MATCHES Fortran)
|
||||
check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
|
||||
endif (NOT _LANGUAGES_ MATCHES Fortran)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
|
||||
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
|
||||
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
|
||||
endif(_libraries_work)
|
||||
|
||||
if(_libraries_work)
|
||||
set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads})
|
||||
else(_libraries_work)
|
||||
set(${LIBRARIES} FALSE)
|
||||
endif(_libraries_work)
|
||||
|
||||
endmacro(Check_Lapack_Libraries)
|
||||
|
||||
|
||||
set(LAPACK_LINKER_FLAGS)
|
||||
set(LAPACK_LIBRARIES)
|
||||
set(LAPACK95_LIBRARIES)
|
||||
|
||||
|
||||
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||
find_package(BLAS)
|
||||
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||
find_package(BLAS REQUIRED)
|
||||
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||
|
||||
|
||||
if(BLAS_FOUND)
|
||||
set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
|
||||
if ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||
set(BLA_VENDOR $ENV{BLA_VENDOR})
|
||||
else ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||
if(NOT BLA_VENDOR)
|
||||
set(BLA_VENDOR "All")
|
||||
endif(NOT BLA_VENDOR)
|
||||
endif ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||
|
||||
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT LAPACK_LIBRARIES)
|
||||
check_lapack_libraries(
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"goto2"
|
||||
"${BLAS_LIBRARIES}"
|
||||
""
|
||||
)
|
||||
endif(NOT LAPACK_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
|
||||
#acml lapack
|
||||
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLAS_LIBRARIES MATCHES ".+acml.+")
|
||||
set (LAPACK_LIBRARIES ${BLAS_LIBRARIES})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Apple LAPACK library?
|
||||
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
|
||||
if(NOT LAPACK_LIBRARIES)
|
||||
check_lapack_libraries(
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"Accelerate"
|
||||
"${BLAS_LIBRARIES}"
|
||||
""
|
||||
)
|
||||
endif(NOT LAPACK_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
||||
if ( NOT LAPACK_LIBRARIES )
|
||||
check_lapack_libraries(
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"vecLib"
|
||||
"${BLAS_LIBRARIES}"
|
||||
""
|
||||
)
|
||||
endif ( NOT LAPACK_LIBRARIES )
|
||||
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
||||
# Generic LAPACK library?
|
||||
if (BLA_VENDOR STREQUAL "Generic" OR
|
||||
BLA_VENDOR STREQUAL "ATLAS" OR
|
||||
BLA_VENDOR STREQUAL "All")
|
||||
if ( NOT LAPACK_LIBRARIES )
|
||||
check_lapack_libraries(
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"lapack"
|
||||
"${BLAS_LIBRARIES}"
|
||||
""
|
||||
)
|
||||
endif ( NOT LAPACK_LIBRARIES )
|
||||
endif ()
|
||||
#intel lapack
|
||||
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||
find_PACKAGE(Threads)
|
||||
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||
if (BLA_F95)
|
||||
if(NOT LAPACK95_LIBRARIES)
|
||||
check_lapack_libraries(
|
||||
LAPACK95_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"mkl_lapack95"
|
||||
"${BLAS95_LIBRARIES}"
|
||||
"${CMAKE_THREAD_LIBS_INIT}"
|
||||
)
|
||||
endif(NOT LAPACK95_LIBRARIES)
|
||||
else(BLA_F95)
|
||||
if(NOT LAPACK_LIBRARIES)
|
||||
check_lapack_libraries(
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"mkl_lapack"
|
||||
"${BLAS_LIBRARIES}"
|
||||
"${CMAKE_THREAD_LIBS_INIT}"
|
||||
)
|
||||
endif(NOT LAPACK_LIBRARIES)
|
||||
endif(BLA_F95)
|
||||
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||
endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||
else(BLAS_FOUND)
|
||||
message(STATUS "LAPACK requires BLAS")
|
||||
endif(BLAS_FOUND)
|
||||
|
||||
if(BLA_F95)
|
||||
if(LAPACK95_LIBRARIES)
|
||||
set(LAPACK95_FOUND TRUE)
|
||||
else(LAPACK95_LIBRARIES)
|
||||
set(LAPACK95_FOUND FALSE)
|
||||
endif(LAPACK95_LIBRARIES)
|
||||
if(NOT LAPACK_FIND_QUIETLY)
|
||||
if(LAPACK95_FOUND)
|
||||
message(STATUS "A library with LAPACK95 API found.")
|
||||
else(LAPACK95_FOUND)
|
||||
if(LAPACK_FIND_REQUIRED)
|
||||
message(FATAL_ERROR
|
||||
"A required library with LAPACK95 API not found. Please specify library location."
|
||||
)
|
||||
else(LAPACK_FIND_REQUIRED)
|
||||
message(STATUS
|
||||
"A library with LAPACK95 API not found. Please specify library location."
|
||||
)
|
||||
endif(LAPACK_FIND_REQUIRED)
|
||||
endif(LAPACK95_FOUND)
|
||||
endif(NOT LAPACK_FIND_QUIETLY)
|
||||
set(LAPACK_FOUND "${LAPACK95_FOUND}")
|
||||
set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}")
|
||||
else(BLA_F95)
|
||||
if(LAPACK_LIBRARIES)
|
||||
set(LAPACK_FOUND TRUE)
|
||||
else(LAPACK_LIBRARIES)
|
||||
set(LAPACK_FOUND FALSE)
|
||||
endif(LAPACK_LIBRARIES)
|
||||
|
||||
if(NOT LAPACK_FIND_QUIETLY)
|
||||
if(LAPACK_FOUND)
|
||||
message(STATUS "A library with LAPACK API found.")
|
||||
else(LAPACK_FOUND)
|
||||
if(LAPACK_FIND_REQUIRED)
|
||||
message(FATAL_ERROR
|
||||
"A required library with LAPACK API not found. Please specify library location."
|
||||
)
|
||||
else(LAPACK_FIND_REQUIRED)
|
||||
message(STATUS
|
||||
"A library with LAPACK API not found. Please specify library location."
|
||||
)
|
||||
endif(LAPACK_FIND_REQUIRED)
|
||||
endif(LAPACK_FOUND)
|
||||
endif(NOT LAPACK_FIND_QUIETLY)
|
||||
endif(BLA_F95)
|
||||
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
20
ThirdParty/custom-opm-common/opm-common/cmake/Modules/opm-verteq-prereqs.cmake
vendored
Normal file
20
ThirdParty/custom-opm-common/opm-common/cmake/Modules/opm-verteq-prereqs.cmake
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- 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-verteq_CONFIG_VAR
|
||||
)
|
||||
|
||||
# dependencies
|
||||
set (opm-verteq_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"
|
||||
# OPM dependency
|
||||
"opm-common;
|
||||
opm-core REQUIRED"
|
||||
)
|
||||
739
ThirdParty/custom-opm-common/opm-common/cmake/OPM-CMake.md
vendored
Normal file
739
ThirdParty/custom-opm-common/opm-common/cmake/OPM-CMake.md
vendored
Normal file
@@ -0,0 +1,739 @@
|
||||
OPM Build System
|
||||
================
|
||||
|
||||
This is the documentation for the build system used in various OPM modules.
|
||||
In the following, `xxx` is used as a placeholder for the project name (e.g.
|
||||
"core").
|
||||
|
||||
Unlike traditional CMake files which is highly imperative, OPM projects
|
||||
sets up declarative lists of prerequisites and content and rely on convention
|
||||
and pre-made modules to do the build. Its goal is to replace but be
|
||||
compatible with the old autotools-based system.
|
||||
|
||||
## Terminology
|
||||
|
||||
In the build system to following abstract locations are referred to:
|
||||
|
||||
<table><thead><tr><th>Location<th>Description<tbody>
|
||||
<tr>
|
||||
<td> Source tree
|
||||
<td>
|
||||
This is where the source files are located. Usually this directory is created
|
||||
by a `git clone`. You edit files in this directory. The build system on the
|
||||
other hand will never touch these files; they could be read-only for that
|
||||
matter. It should be located on a disk that is backed up. The source trees
|
||||
for various OPM modules should be siblings to eachother.
|
||||
|
||||
<tr>
|
||||
<td> Build tree
|
||||
<td>
|
||||
This is where you do `make` (or `ninja`), and the compiler/linker will put
|
||||
its output here. It may be the same directory as the source tree (which is
|
||||
then called an "in-tree build"). However, it is recommended that you keep
|
||||
it separate. Do `make clean && make distclean` to remove all files that
|
||||
are created by the build (if you put it in the source directory).
|
||||
You don't need to backup these files (since they can be generated from the
|
||||
source); instead this directory should be located somewhere with fast
|
||||
write access. The build trees for various OPM modules should be siblings
|
||||
(unless they are subdirectories in their source trees).
|
||||
|
||||
<tr>
|
||||
<td> Installation tree
|
||||
<td>
|
||||
This is where the build system will put all the final libraries and headers
|
||||
when running `make install`.
|
||||
You can specify another location for the installation tree by setting the
|
||||
CMake variable `CMAKE_INSTALL_PREFIX` on the command line (or use `--prefix=`
|
||||
with the configure script). Notice that the portion of this path which
|
||||
will become the new filesystem root should be specified with the environment
|
||||
variable `DESTDIR`.
|
||||
|
||||
</table>
|
||||
|
||||
## Use Cases
|
||||
|
||||
This section lists some common use cases for adding new code to a project
|
||||
with respect to the build system, and lists the steps that must be undertaken
|
||||
to do the necessary modifications.
|
||||
|
||||
### Adding a Translation Unit
|
||||
|
||||
1. Put the file in a sub-directory of `opm/xxx`.
|
||||
|
||||
2. Add the file name to the `MAIN_SOURCE_FILES` list in `CMakeLists_files.txt`.
|
||||
Please keep this list sorted.
|
||||
|
||||
3. If you are adding new interfaces that will be used by client code, add the
|
||||
header to the `PUBLIC_HEADER_FILES`. Note that any `_impl` headers containing
|
||||
template implementations must also be included.
|
||||
|
||||
### Adding a Prerequisite
|
||||
|
||||
1. Add the name of the prerequisite module to the `opm-xxx_DEPS` list in the file
|
||||
`cmake/Modules/opm-xxx-prereqs.cmake`, where xxx is a placeholder for the module
|
||||
name of your CMake project.
|
||||
|
||||
2. If you need any CMake configuration defines available in your public _headers_,
|
||||
add these to the `opm-xxx_CONFIG_VAR` list in the same file. Please refrain
|
||||
from this practice as it imposes a requirement on the clients of your code to
|
||||
gather the same configuration information and make it available in the units
|
||||
which uses your headers.
|
||||
|
||||
### Adding a Unit Test
|
||||
|
||||
1. Put the source code in a single translation unit in directory `tests`. The
|
||||
name of this unit should start with `test_`.
|
||||
|
||||
2. Put any datafiles this code rely on in the same directory. The code should
|
||||
assume that such datafiles are available in the current directory the program
|
||||
is running from. The code should not write to these files, but rather make
|
||||
a copy if it needs to modify them.
|
||||
|
||||
3. Add the file name to the `TEST_SOURCE_FILES` list in `CMakeLists_files.txt`.
|
||||
|
||||
4. Add the datafiles to the `TEST_DATA_FILES` list in the same files. The
|
||||
files will be copied from the source tree into the target tree.
|
||||
|
||||
### Adding a New Utility Program
|
||||
|
||||
1. Put the source code of the utility in the `examples` directory.
|
||||
|
||||
2. Add the name of the translation unit to the `PROGRAM_SOURCE_FILES` list
|
||||
in `CMakeLists_files.txt`.
|
||||
|
||||
### Creating a New Module
|
||||
|
||||
1. Copy the directory `cmake/` and all sub-directories from opm-core. This
|
||||
directory contains the common build system, and should ideally be identical
|
||||
across OPM projects. Also copy the file `configure` in the project root.
|
||||
|
||||
2. Create project-specific files using those from another project as a template.
|
||||
The list of project specific files is in the section
|
||||
[Modules Reference](#project-specific-files) below.
|
||||
|
||||
3. Create a new file `cmake/Modules/opm-xxx-prereqs.cmake`, using one of the
|
||||
existing ones as a template.
|
||||
|
||||
4. Optionally, create a new file `cmake/Modules/Findopm-xxx.cmake`, using one
|
||||
of the existing ones as a template.
|
||||
|
||||
## Options
|
||||
|
||||
These options regulate the behaviour of the build system. In addition to these
|
||||
options, you can also set standard CMake options, or options for the
|
||||
prerequisites, which is not documented here. If you run the configure script
|
||||
with the `--help` option, it will print a text of what the options are called
|
||||
when using the autotools-compatible wrapper.
|
||||
|
||||
<table><thead><tr><th>Option<th>Description<tbody>
|
||||
<tr>
|
||||
<td> BUILD_EXAMPLES
|
||||
<td>
|
||||
Include the examples when doing a build. Whenever you change something
|
||||
in the library, however small, all the examples will also be rebuilt.
|
||||
Default is ON.
|
||||
|
||||
<tr>
|
||||
<td> BUILD_TESTING
|
||||
<td>
|
||||
Include the unit tests when doing a build. Whenever you change something
|
||||
in the library, however small, all the unit tests will also be rebuilt.
|
||||
Default is ON.
|
||||
|
||||
<tr>
|
||||
<td> PRECOMPILE_HEADERS
|
||||
<td>
|
||||
Precompile common headers into a binary blob which is loaded on further
|
||||
compilations. If your compiler supports this, it usually reduces build
|
||||
time. It does not affect the running time of the code. Default is OFF.
|
||||
|
||||
<tr>
|
||||
<td> SIBLING_SEARCH
|
||||
<td>
|
||||
Search for OPM/DUNE prerequisites in sibling directories of the build
|
||||
tree. Default is ON.
|
||||
|
||||
<tr>
|
||||
<td> SUITESPARSE_USE_STATIC
|
||||
<td>
|
||||
Link SuiteSparse/UMFPack statically. Using this option will enable you
|
||||
to build an executable which has no external dependencies. The default
|
||||
is to use shared libraries if those are available.
|
||||
|
||||
<tr>
|
||||
<td> SYSTEM_DEBUG
|
||||
<td>
|
||||
Put debug symbols in the system debug directory (`/usr/lib/debug`) as
|
||||
this seems to be the only place which is searched by default by GDB.
|
||||
Default is OFF, as it requires that you have write access to that
|
||||
directory. Note that if you are doing a system installation (set
|
||||
CMAKE_INSTALL_PREFIX=/usr), then the libraries will be put in this
|
||||
location irregardless of this option.
|
||||
|
||||
<tr>
|
||||
<td> USE_MPI
|
||||
<td>
|
||||
Enable the code to use MPI for parallelization. Default is OFF.
|
||||
Note: It is important that OPM and DUNE modules is either all
|
||||
compiled with MPI support or that none is. The build system will
|
||||
attempt to recognize inconsistencies.
|
||||
|
||||
<tr>
|
||||
<td> USE_OPENMP
|
||||
<td>
|
||||
Enable the code to use OpenMP for parallelization. Default is ON.
|
||||
|
||||
<tr>
|
||||
<td> USE_RUNPATH
|
||||
<td>
|
||||
Remember the directories from where the prerequisites were found
|
||||
when building. Default is ON, which enables you to run without
|
||||
setting PATH all over the place in your build directories. When
|
||||
creating an installation package, this should be set off.
|
||||
|
||||
<tr>
|
||||
<td> USE_UNDERSCORING
|
||||
<td>
|
||||
Assume that Fortran externals have an underscore suffix instead
|
||||
of checking this with an actual compiler. If you set this option,
|
||||
you can use Fortran libraries (notably BLAS and LAPACK) without
|
||||
having a Fortran compiler installed. The default is OFF.
|
||||
|
||||
<tr>
|
||||
<td> USE_VERSIONED_DIR
|
||||
<td>
|
||||
Put libraries in a directory which includes the label of the project,
|
||||
e.g. `/usr/lib/opm-core/2013.10`. Default is OFF.
|
||||
|
||||
<tr>
|
||||
<td> WITH_NATIVE
|
||||
<td>
|
||||
Optimize for the instruction set of the build machine. This is
|
||||
a good idea if you are building the library on the same machine
|
||||
as you will be using the library. Default is ON.
|
||||
|
||||
<tr>
|
||||
<td> WHOLE_PROG_OPTIM
|
||||
<td>
|
||||
Perform an extra round of optimization when linking the program.
|
||||
(Usually the compiler only optimizes within the translation unit).
|
||||
If your compiler supports this, it usually leads to a faster runtime.
|
||||
Default is OFF.
|
||||
|
||||
</table>
|
||||
|
||||
## Modules Reference
|
||||
|
||||
### Project-specific Files
|
||||
|
||||
All of these files are in the project root.
|
||||
|
||||
<table><thead><tr><th>File<th>Description<tbody>
|
||||
<tr>
|
||||
<td> CMakeLists.txt
|
||||
<td>
|
||||
Project-specific customizations to the build, such as filtering out source
|
||||
files based on the availability of prerequisites, or adding configuration
|
||||
variables only the implementation depends on.
|
||||
Prefer to do customizations in the hooks available to this file rather than
|
||||
adding ad-hoc code to the build system itself, to keep the `cmake/` directory
|
||||
unified across projects.
|
||||
|
||||
<tr>
|
||||
<td> CMakeLists_files.txt
|
||||
<td>
|
||||
List of all compilation modules in the project, test cases and public
|
||||
headers that should be installed in the distribution package. The contents
|
||||
of these lists are distributed to project-specific variables by the build
|
||||
system.
|
||||
|
||||
<tr>
|
||||
<td> CTestConfig.cmake
|
||||
<td>
|
||||
Settings for submitting result of tests to CDash. The default is setup
|
||||
to submit to [the official CDash panel](http://www.opm-project.org/CDash/)
|
||||
and does not need to be changed if your module has a panel there.
|
||||
|
||||
<tr>
|
||||
<td> dune.module
|
||||
<td>
|
||||
Information about the project such as name, release label, link version
|
||||
and maintainer. Also specify dependencies to other OPM/DUNE-projects so
|
||||
that dunecontrol can build in correct order. (Note that the full list of
|
||||
dependencies is taken from opm-xxx-prereqs.cmake and not from here).
|
||||
Since this file must be present before the build starts (for dunecontrol),
|
||||
the version information is kept here.
|
||||
|
||||
</table>
|
||||
|
||||
### Project Modules
|
||||
|
||||
These modules contains the dependency information for this project, so
|
||||
the build system can set up the prerequisite list correctly and probe
|
||||
for other modules automatically. (This replaces hard-coded calls to
|
||||
find_library in the CMakeLists.txt file).
|
||||
|
||||
<table><thead><tr><th>File (.cmake)<th>Description<tbody>
|
||||
<tr>
|
||||
<td> xxx-prereqs
|
||||
<td>
|
||||
List prerequisite modules and defines used in public headers. Each module
|
||||
must have such a "declaration", and this must be made available to every
|
||||
other projects as well (which is why this is located in `cmake/Modules`).
|
||||
|
||||
<tr>
|
||||
<td> Findxxx
|
||||
<td>
|
||||
CMake modules which locates module `xxx` in the system directories. As
|
||||
the `opm-xxx-config.cmake` is made available together with the libraries
|
||||
and headers, these modules are not really needed (for OPM modules).
|
||||
|
||||
</table>
|
||||
|
||||
### Generated Files
|
||||
|
||||
These files are generated by the build system and exists in the _build_ tree,
|
||||
not in the source tree. They are documented here to make developers aware of
|
||||
their role in the build system.
|
||||
|
||||
<table><thead><tr><th>File<th>Description<tbody>
|
||||
<tr>
|
||||
<td> config.h
|
||||
<td>
|
||||
Settings variables which the build system has configured and make available
|
||||
to the source code. This file is **not** installed amongst the headers, so
|
||||
you should never include this in a public header, even if you need the value
|
||||
in one of these variables. Instead, you must rely on the client code to
|
||||
configure this variable for you.
|
||||
|
||||
<tr>
|
||||
<td> opm-xxx.pc
|
||||
<td>
|
||||
pkg-config information file to locate the **build** tree. This is used by
|
||||
the autotools build files, but can also be handy when manually building
|
||||
small test programs for which you don't generate an own build system.
|
||||
|
||||
<tr>
|
||||
<td> opm-xxx-config.cmake
|
||||
<td>
|
||||
CMake information file to locate the **build** tree. This file is imported
|
||||
when this project is set up as a prerequisite.
|
||||
|
||||
<tr>
|
||||
<td> opm-xxx-install.pc
|
||||
<td>
|
||||
pkg-config information file to locate the **installation** tree. It is
|
||||
the same as `opm-xxx.pc` except that the paths are switched. When the
|
||||
project is installed, this file is installed instead (under `lib/pkgconfig`
|
||||
relative to the installation root). This directory should hence be put
|
||||
in the search path to pkg-config to use the installed package. Before
|
||||
installation, this file is worthless and should not be included, because
|
||||
it does not refer to the build tree at all. (Be careful not to mix
|
||||
the build and the installation tree).
|
||||
Notice that the build system will forward a bunch of public definitions
|
||||
which should be available to compile code referring to this library.
|
||||
|
||||
<tr>
|
||||
<td> opm-xxx-install.cmake
|
||||
<td>
|
||||
CMake information file to locate the **installation** tree. It is the
|
||||
same as `opm-xxx-config.cmake` except that the paths are switched. When
|
||||
the project is installed, this file is installed instead (under `share/cmake`
|
||||
relative to the installation root).
|
||||
|
||||
<tr>
|
||||
<td> opm-xxx-config-version.cmake
|
||||
<td>
|
||||
CMake wants to include this into the build _before_ it is determined whether
|
||||
the library was found successfully (depending on the version number perhaps),
|
||||
so this information is put in its own file. Since it is the same for the
|
||||
build tree and the installation tree, it is shared in both those locations.
|
||||
|
||||
</table>
|
||||
|
||||
### Utility Modules
|
||||
|
||||
These modules consists of useful routines which is not OPM-specific and
|
||||
that could be used in any projects. They don't depend on any other parts
|
||||
of the build system.
|
||||
|
||||
<table><thead><tr><th>File (.cmake)<th>Description<tbody><tr>
|
||||
<td> AddOptions
|
||||
<td>
|
||||
Functions to add options to compiler command line (e.g. 'CXXFLAGS').
|
||||
This macro can add options to more than one language and/or configuration
|
||||
at a time, and also automatically removes duplicates.
|
||||
|
||||
<tr>
|
||||
<td> ConfigVars
|
||||
<td>
|
||||
Functions to write values of selected variables to `config.h`. The
|
||||
advantage of using this compared to a template file, is that other
|
||||
modules can add their own variables to be written (a project doesn't
|
||||
need to know which variables a prerequisite wants to have in config.h).
|
||||
|
||||
<tr>
|
||||
<td> DuneCompat
|
||||
<td>
|
||||
Modify `Makefile` so dunecontrol can infer source directory from it.
|
||||
dunecontrol infers the source location of prerequisites from textual
|
||||
analysis of the Makefile in their build tree. (dunecontrol cannot build
|
||||
with Ninja anyway, so that is not a problem).
|
||||
|
||||
<tr>
|
||||
<td> Duplicates
|
||||
<td>
|
||||
Functions to remove duplicate values from a list of libraries, which
|
||||
must always be done from the beginning in order to link correctly.
|
||||
|
||||
<tr>
|
||||
<td> LibtoolArchives
|
||||
<td>
|
||||
Write .la file which will make libtool find our library. This enables
|
||||
users of our library to use libtool even if we did not do so ourselves.
|
||||
|
||||
</table>
|
||||
|
||||
### Build System Modules
|
||||
|
||||
These are the modules which comprises the OPM-specific parts of the
|
||||
build system. The overall flow through the stages of the build is best
|
||||
captured by reading through the `OpmLibMain.cmake` module.
|
||||
|
||||
<table><thead><tr><th>File (.cmake)<th>Description<tbody>
|
||||
<tr>
|
||||
<td> configure
|
||||
<td>
|
||||
Wrapper script which emulates an autotools front-end, making the build
|
||||
system usable with dunecontrol. There is one in the project root directory
|
||||
which just forwards everything to the main script in `cmake/Scripts`.
|
||||
|
||||
<tr>
|
||||
<td> OpmAliases
|
||||
<td>
|
||||
Copy variables which are probed by our find modules to the names which
|
||||
are expected by DUNE.
|
||||
|
||||
<tr>
|
||||
<td> OpmCompile
|
||||
<td>
|
||||
Set up a compilation target for the library itself. It is assumed that
|
||||
each OPM project build exactly one library file containing all its code.
|
||||
The files and compiler options are passed through the project variables
|
||||
(see the section [Variables Reference](#variables-reference) below).
|
||||
|
||||
<tr>
|
||||
<td> OpmDefaults
|
||||
<td>
|
||||
If optimization and debugging settings are not given on the command line,
|
||||
supply a set of reasonable defaults for the detected platform and
|
||||
compiler.
|
||||
|
||||
<tr>
|
||||
<td> OpmDistClean
|
||||
<td>
|
||||
Add a target (`make distclean`) to the build system which can remove the
|
||||
build files themselves from the build directory tree.
|
||||
|
||||
<tr>
|
||||
<td> OpmDoc
|
||||
<td>
|
||||
Add target for building documentation, primarily Doxygen class reference
|
||||
from the code.
|
||||
|
||||
<tr>
|
||||
<td> OpmFiles
|
||||
<td>
|
||||
Load list of files from `CMakeLists_files.txt` and put into the applicable
|
||||
variables.
|
||||
|
||||
<tr>
|
||||
<td> OpmGrid
|
||||
<td>
|
||||
Adds the grid type selection code to config.h which is needed by dune-grid
|
||||
if you want to set up a default grid. This is currently not needed by any
|
||||
OPM project, and is provided only for porting client projects which previously
|
||||
used this functionality from the autotools version.
|
||||
|
||||
<tr>
|
||||
<td> OpmInit
|
||||
<td>
|
||||
Read the version information and project name from `dune.module`.
|
||||
|
||||
<tr>
|
||||
<td> OpmInstall
|
||||
<td>
|
||||
Setup installation of the main library, public headers and debug symbols.
|
||||
|
||||
<tr>
|
||||
<td> OpmKnown
|
||||
<td>
|
||||
Marks as "used" all configuration variables which is used only by some of
|
||||
the OPM projects, so they don't generate warnings in the rest of them.
|
||||
|
||||
<tr>
|
||||
<td> OpmLibMain
|
||||
<td>
|
||||
Driver module for the build process. First reads the list of prerequisites
|
||||
and options, then set up the compiles and installations.
|
||||
|
||||
<tr>
|
||||
<td> OpmProject
|
||||
<td>
|
||||
Set up pkg-config and CMake information files (see [Generated Files]
|
||||
(#generated-files)) for this project, based on configuration.
|
||||
|
||||
<tr>
|
||||
<td> OpmSatellites
|
||||
<td>
|
||||
Build test programs and examples for a library that is bundled in the project.
|
||||
</table>
|
||||
|
||||
### Wrapper Modules
|
||||
|
||||
These modules wrap the CMake `find_library` function and adds the information
|
||||
retrieved from the imported prerequisite to module-specific variables, so that
|
||||
these can be added to the build in batch afterwards.
|
||||
|
||||
<table><thead><tr><th>File (.cmake)<th>Description<tbody>
|
||||
<tr>
|
||||
<td> OpmFind
|
||||
<td>
|
||||
Wrapper around `find_package`. Searches in various locations relative to this
|
||||
project as well as in the system directories for a CMake module which can
|
||||
locate the package. If it is found, adds the project variables (see
|
||||
[Variables Reference](#variables-reference)) for this project into this one,
|
||||
for instance include and library directories are added to the compile and link
|
||||
command-line for this project.
|
||||
|
||||
<tr>
|
||||
<td> OpmPackage
|
||||
<td>
|
||||
Typical way of finding an OPM package; searches for the header and library,
|
||||
and tries to compile a test program. This is the general implementation of
|
||||
a CMake find module, and is used to locate those of the prerequisites that
|
||||
fits the pattern.
|
||||
|
||||
</table>
|
||||
|
||||
### Configuration Modules
|
||||
|
||||
These are modules for altering the compiler and/or linker option in some way,
|
||||
or get information from the system. They are not tied to the OPM projects.
|
||||
|
||||
<table><thead><tr><th>File (.cmake)<th>Description<tbody>
|
||||
<tr>
|
||||
<td> UseCompVer
|
||||
<td>
|
||||
Get the version of GCC that is used to compile the project. This is used in
|
||||
other modules to enable features that are known to exist/work only in certain
|
||||
versions of GCC.
|
||||
|
||||
<tr>
|
||||
<td> UseDebugSymbols
|
||||
<td>
|
||||
Set up the compile to generate debug symbols for the code. This is done also
|
||||
if a release build was requested, to be able to do post-mortem debugging of
|
||||
production code. (The debug symbols does not inhibit optimization).
|
||||
|
||||
<tr>
|
||||
<td> UseDuneVer
|
||||
<td>
|
||||
Retrieve the version of DUNE which is available.
|
||||
|
||||
<tr>
|
||||
<td> UseDynamicBoost
|
||||
<td>
|
||||
Determine if Boost is linked statically or dynamically (shared). This is
|
||||
necessary to know for the unit tests.
|
||||
|
||||
<tr>
|
||||
<td> UseFastBuilds
|
||||
<td>
|
||||
Enable certain techniques which is known to speed up the build itself.
|
||||
|
||||
<tr>
|
||||
<td> UseFortranWrappers
|
||||
<td>
|
||||
Provide a macro for declaration of external symbols which is located in
|
||||
Fortran libraries. It is not necessary to have a Fortran compiler present
|
||||
to use this macro.
|
||||
|
||||
<tr>
|
||||
<td> UseMultiArch
|
||||
<td>
|
||||
Check if the system uses the multi-arch scheme for organizing libraries
|
||||
(currently derivatives of Debian do this).
|
||||
|
||||
<tr>
|
||||
<td> UseOnlyNeeded
|
||||
<td>
|
||||
Only link to libraries which is actually used by the project. Some
|
||||
platforms provide "under-linked" libraries (they need other libraries
|
||||
but doesn't state so explicitly, but rather imply that the executable
|
||||
must link to these itself), and this is also handled.
|
||||
|
||||
<tr>
|
||||
<td> UseOpenMP
|
||||
<td>
|
||||
Add OpenMP features to the build. Since OpenMP is activated by pragmas
|
||||
in the code, compiler options instead of libraries are needed.
|
||||
|
||||
<tr>
|
||||
<td> UseOptimization
|
||||
<td>
|
||||
Compile with more extensive optimization that what is the default in
|
||||
CMake.
|
||||
|
||||
<tr>
|
||||
<td> UsePrecompHeaders
|
||||
<td>
|
||||
Set up precompiled headers if the project has a `opm/xxx/opm-xxx-pch.hpp`
|
||||
header. Due to problems across various compilers, this is currently an
|
||||
opt-in feature.
|
||||
|
||||
<tr>
|
||||
<td> UseSystemInfo
|
||||
<td>
|
||||
Retrieve information about the system the build is performed on. This is
|
||||
printed in the configuration log and can be helpful to troubleshoot
|
||||
problems from error reports.
|
||||
|
||||
<tr>
|
||||
<td> UseVCSInfo
|
||||
<td>
|
||||
Retrieve information about which Git revision is compiled. This is useful
|
||||
to figure out which version an error report refers to.
|
||||
|
||||
<tr>
|
||||
<td> UseVersion
|
||||
<td>
|
||||
Add version information for this project into the library binary, making
|
||||
it available for query at runtime.
|
||||
|
||||
<tr>
|
||||
<td> UseWarnings
|
||||
<td>
|
||||
Enable a more extensive set of warnings to be reported by the compiler
|
||||
than what is the default in CMake.
|
||||
|
||||
</table>
|
||||
|
||||
## Variables Reference
|
||||
|
||||
The build system will setup variables with names of the pattern `xxx_YYY`
|
||||
where xxx is the project name (here including the suite; e.g. "opm-core")
|
||||
and yyy is the suffix in the list below. The project name is used verbatim,
|
||||
i.e. there is no translation of dashes and case ("opm-core" and not "OPM_CORE").
|
||||
|
||||
<table><thead><tr><th>Suffix<th>Description<tbody>
|
||||
<tr>
|
||||
<td> _DEFINITIONS
|
||||
<td>
|
||||
Macro defines (of the type `-DFOO`) that needs to be added to the compile
|
||||
of translation units contained in this library. This also includes defines
|
||||
that must be present to headers which is included by this library.
|
||||
|
||||
<tr>
|
||||
<td> _CONFIG_VARS
|
||||
<td>
|
||||
Defines which should be present in `config.h` of the project which
|
||||
includes this library (client code). Only the names of the variables
|
||||
are listed here; the actual values must be found by the configuration
|
||||
script of the client.
|
||||
|
||||
<tr>
|
||||
<td> _CONFIG_IMPL_VARS
|
||||
<td>
|
||||
Defines which should be present in `config.h` but is only used by
|
||||
the internal code of the project itself. Use this list to get
|
||||
defines without imposing a requirement on client code to also probe
|
||||
for values.
|
||||
|
||||
<tr>
|
||||
<td> _INCLUDE_DIR
|
||||
<td>
|
||||
Directory where the public headers of this project are stored.
|
||||
|
||||
<tr>
|
||||
<td> _INCLUDE_DIRS
|
||||
<td>
|
||||
List of include directories that must be on the compiler search
|
||||
path to compile code which uses this project. In addition to the
|
||||
headers of this project itself, it also includes the transitive
|
||||
closure of paths for all prerequisites as well.
|
||||
|
||||
<tr>
|
||||
<td> _LABEL
|
||||
<td>
|
||||
Currently for OPM projects, this follows a pattern of `YYYY.MM`
|
||||
where YYYY is the year of the release and MM is the month. This
|
||||
gives information to humans about how up to date this instance
|
||||
of the library is (but doesn't provide a way to check for
|
||||
compatibility, which is why the VERSION alternatives exist).
|
||||
|
||||
<tr>
|
||||
<td> _LIBRARY
|
||||
<td>
|
||||
Name and path of the binary to link with.
|
||||
|
||||
<tr>
|
||||
<td> _LIBRARIES
|
||||
<td>
|
||||
Full list of the library of both this project, and all its
|
||||
prerequisites, that need to be included in the link. I.e. the
|
||||
client code should only include the transitive list from its
|
||||
immediate prerequisites and not know about the full dependency
|
||||
graph.
|
||||
|
||||
<tr>
|
||||
<td> _LIBRARY_DIRS
|
||||
<td>
|
||||
Directories that should be added to the linker search path when
|
||||
including this library.
|
||||
|
||||
<tr>
|
||||
<td> _LINKER_FLAGS
|
||||
<td>
|
||||
Flags that must be added to the link when including this library.
|
||||
|
||||
<tr>
|
||||
<td> _SOURCES
|
||||
<td>
|
||||
List of source files contained in this project. This enables libraries
|
||||
to be distributed in source form (e.g. CJSON and TinyXML) and linked
|
||||
directly into the project.
|
||||
|
||||
<tr>
|
||||
<td> _TARGET
|
||||
<td>
|
||||
Name of the library which is generated by this project. CMake and
|
||||
autotools do not like library names which contains dashes, so they
|
||||
are stripped out. By using a macro for this we are guaranteed uniform
|
||||
translation.
|
||||
|
||||
<tr>
|
||||
<td> _VERSION
|
||||
<td>
|
||||
Textual concatenation of all components of the version number (see below)
|
||||
with a dot inbetween. This form of version number can be compared using
|
||||
CMake VERSION_{LESS|EQUAL|GREATER} operators.
|
||||
|
||||
<tr>
|
||||
<td> _VERSION_MAJOR
|
||||
<td>
|
||||
Major version of the library. If the major versions doesn't match, then
|
||||
compatibility with existing code cannot be reckoned.
|
||||
|
||||
<tr>
|
||||
<td> _VERSION_MINOR
|
||||
<td>
|
||||
Minor version of the library. Libraries with newer minor version can
|
||||
have more features, but should be able to run old code.
|
||||
|
||||
<tr>
|
||||
<td> _VERSION_REVISION
|
||||
<td>
|
||||
Micro version of the library. This number is generally incremented
|
||||
whenever bugfixes or performance improvements are made.
|
||||
</table>
|
||||
84
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/CheckCommits.cmake
vendored
Normal file
84
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/CheckCommits.cmake
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
macro(sanity_check message)
|
||||
if(status_code)
|
||||
message(FATAL_ERROR "${message}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Check that there are no changes in working-tree
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} diff --quiet
|
||||
RESULT_VARIABLE status_code
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
sanity_check("Cannot run with working tree changes. Commit, stash or drop them.")
|
||||
|
||||
# Setup base of tests
|
||||
set(check_base $ENV{CHECK_BASE})
|
||||
if(NOT check_base)
|
||||
set(check_base origin/master)
|
||||
endif()
|
||||
|
||||
# Setup end of tests
|
||||
set(check_head $ENV{CHECK_HEAD})
|
||||
if(NOT check_head)
|
||||
set(check_head HEAD)
|
||||
endif()
|
||||
|
||||
# Setup target to build
|
||||
set(check_target $ENV{CHECK_TARGET})
|
||||
if(NOT check_target)
|
||||
set(check_target all;test)
|
||||
endif()
|
||||
|
||||
# Build threads
|
||||
include(ProcessorCount)
|
||||
set(build_threads $ENV{CHECK_THREADS})
|
||||
if(NOT build_threads)
|
||||
ProcessorCount(build_threads)
|
||||
if(build_threads EQUAL 0)
|
||||
set(build_threads 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Record current HEAD
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE current_branch
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
|
||||
string(REGEX REPLACE "(\r?\n)+$" "" current_branch "${current_branch}")
|
||||
|
||||
# Grab revision list
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-list ${check_base}..${check_head} --reverse
|
||||
OUTPUT_VARIABLE rev_list
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
|
||||
string(REPLACE "\n" ";" rev_list ${rev_list})
|
||||
foreach(rev ${rev_list})
|
||||
# Checkout
|
||||
message("Testing revision ${rev}")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${rev}
|
||||
RESULT_VARIABLE status_code
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
sanity_check("Failed to checkout ${rev}")
|
||||
|
||||
# Build
|
||||
foreach(tgt ${check_target})
|
||||
if(build_threads GREATER 2)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} "--build" "${CMAKE_BINARY_DIR}" "--target" "${tgt}" "--use-stderr" "--" "-j${build_threads}"
|
||||
RESULT_VARIABLE status_code)
|
||||
else()
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} "--build" "${CMAKE_BINARY_DIR}" "--target" "${tgt}" "--use-stderr"
|
||||
RESULT_VARIABLE status_code)
|
||||
endif()
|
||||
sanity_check("Failed to build target '${tgt}'")
|
||||
endforeach()
|
||||
if(status_code)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${current_branch}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
endif()
|
||||
sanity_check("Failed to build target for revision ${rev}")
|
||||
endforeach()
|
||||
|
||||
message("Everything checks out fine")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${current_branch}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
25
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/DuneCompat2.cmake
vendored
Normal file
25
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/DuneCompat2.cmake
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# - Emulate a rule to patch the Makefile, adding a line to the source
|
||||
# tree and write a marker file indicating it is done.
|
||||
|
||||
set (base_dir ".")
|
||||
set (marker_file "${base_dir}/CMakeFiles/marker")
|
||||
set (makefile "${base_dir}/Makefile")
|
||||
|
||||
# if the Makefile has changed, then update it
|
||||
if ("${makefile}" IS_NEWER_THAN "${marker_file}")
|
||||
# only add the string once, so it does not return multiple
|
||||
# results for the command line (will lead to syntax error)
|
||||
file (STRINGS "${makefile}" abs_top_srcdir_FOUND
|
||||
REGEX "^abs_top_srcdir = "
|
||||
)
|
||||
if (NOT abs_top_srcdir_FOUND)
|
||||
file (APPEND "${makefile}"
|
||||
"abs_top_srcdir = ${CMAKE_HOME_DIRECTORY}\n"
|
||||
)
|
||||
endif (NOT abs_top_srcdir_FOUND)
|
||||
# touch the marker so that we won't update the Makefile again
|
||||
execute_process (COMMAND
|
||||
${CMAKE_COMMAND} -E touch "${marker_file}"
|
||||
)
|
||||
endif ("${makefile}" IS_NEWER_THAN "${marker_file}")
|
||||
|
||||
15
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/RemoveEmptyDir.cmake
vendored
Normal file
15
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/RemoveEmptyDir.cmake
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# - Remove a directory if and only if it contains no files
|
||||
#
|
||||
# Pass the name of the directory as the DIR variable
|
||||
|
||||
if (DIR)
|
||||
# check if empty
|
||||
file (GLOB_RECURSE files "${DIR}/*")
|
||||
|
||||
# remove only if
|
||||
if (NOT files)
|
||||
execute_process (COMMAND
|
||||
${CMAKE_COMMAND} -E remove_directory "${DIR}"
|
||||
)
|
||||
endif (NOT files)
|
||||
endif (DIR)
|
||||
75
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/WriteVerSHA.cmake
vendored
Normal file
75
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/WriteVerSHA.cmake
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
# - This script must be passed the following information
|
||||
#
|
||||
# GIT_EXECUTABLE Path to the Git executable
|
||||
# PROJECT_SOURCE_DIR Path to the source directory
|
||||
# PROJECT_BINARY_DIR Path to the build directory
|
||||
# PROJECT_LABEL String that identifies the minor
|
||||
# version of the project, e.g. "2013.03"
|
||||
#
|
||||
|
||||
# get hash code
|
||||
exec_program (
|
||||
${GIT_EXECUTABLE} ${PROJECT_SOURCE_DIR}
|
||||
ARGS rev-parse --short --verify HEAD
|
||||
OUTPUT_VARIABLE sha1
|
||||
RETURN_VALUE has_sha
|
||||
)
|
||||
|
||||
# exec_program unfortunately mashes together both output
|
||||
# and error streams, so we must use the return code to make
|
||||
# sure that we only get the output
|
||||
if (NOT ${has_sha} EQUAL 0)
|
||||
set (sha1 "")
|
||||
endif ()
|
||||
|
||||
# check for local changes
|
||||
if (sha1)
|
||||
# unstaged
|
||||
exec_program (
|
||||
${GIT_EXECUTABLE} ${PROJECT_SOURCE_DIR}
|
||||
ARGS diff --no-ext-diff --quiet --exit-code
|
||||
RETURN_VALUE dirty
|
||||
OUTPUT_VARIABLE _dummy
|
||||
)
|
||||
|
||||
# staged
|
||||
exec_program (
|
||||
${GIT_EXECUTABLE} ${PROJECT_SOURCE_DIR}
|
||||
ARGS diff-index --no-ext-diff --cached --quiet --exit-code HEAD --
|
||||
RETURN_VALUE staged
|
||||
OUTPUT_VARIABLE _dummy
|
||||
)
|
||||
|
||||
# if we found any changes, then append an asterisk to
|
||||
# the SHA1 so we know that it cannot be trusted
|
||||
if (dirty OR staged)
|
||||
set (sha1 "${sha1}*")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
|
||||
|
||||
# write the content to a temporary file in a C compatible format
|
||||
file (WRITE "${PROJECT_BINARY_DIR}/project-version.tmp"
|
||||
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||
"#define OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||
"#define PROJECT_VERSION_NAME \"${PROJECT_LABEL}\"\n"
|
||||
"#define PROJECT_VERSION_HASH \"${sha1}\"\n"
|
||||
"#define PROJECT_VERSION \"${PROJECT_LABEL} (${sha1})\"\n"
|
||||
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||
)
|
||||
|
||||
# only commit this to source code if it actually changed. here
|
||||
# we use execute_process instead of exec_program to avoid having
|
||||
# it printed on the console every time
|
||||
execute_process (COMMAND
|
||||
${CMAKE_COMMAND} -E copy_if_different "${PROJECT_BINARY_DIR}/project-version.tmp" "${PROJECT_BINARY_DIR}/project-version.h"
|
||||
)
|
||||
|
||||
# Write header file with build timestamp
|
||||
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
|
||||
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
||||
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
||||
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
|
||||
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
||||
)
|
||||
23
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/clang-check-test.sh.in
vendored
Normal file
23
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/clang-check-test.sh.in
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script performs a single analysis using clang-check
|
||||
# It is used by the 'make test' target in the buildsystems
|
||||
# Usually you should use 'ctest -C clang-check' rather than calling this script directly
|
||||
#
|
||||
# Parameters: $1 = Application binary
|
||||
# $2 = Source file to process
|
||||
|
||||
clangcheck_cmd=$1
|
||||
source_file=$2
|
||||
|
||||
tmpfil=`mktemp`
|
||||
$clangcheck_cmd -p @CMAKE_BINARY_DIR@ -analyze $source_file &> $tmpfil
|
||||
cat $tmpfil
|
||||
if test -s $tmpfil
|
||||
then
|
||||
rm $tmpfil
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm $tmpfil
|
||||
exit 0
|
||||
30
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/cppcheck-test.sh
vendored
Normal file
30
ThirdParty/custom-opm-common/opm-common/cmake/Scripts/cppcheck-test.sh
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script performs a single analysis using cppcheck
|
||||
# It is used by the 'make test' target in the buildsystems
|
||||
# Usually you should use 'ctest -C cppcheck' rather than calling this script directly
|
||||
#
|
||||
# Parameters: $1 = Application binary
|
||||
# $2 = Source file to process
|
||||
# $3..$N = include path parameters (-I dir1 -I dir2 ...)
|
||||
|
||||
cppcheck_cmd=$1
|
||||
source_file=$2
|
||||
shift 2
|
||||
|
||||
tmpfil=`mktemp`
|
||||
$cppcheck_cmd $@ --enable=all --suppress=unusedFunction $source_file &> $tmpfil
|
||||
nmatch=`cat $tmpfil | grep "\[.*\]" | wc -l`
|
||||
nsys=`cat $tmpfil | grep "\[/usr.*\]" | wc -l`
|
||||
nnone=`cat $tmpfil | grep "\[\\*]" | wc -l`
|
||||
ndef=`cat $tmpfil | grep "\[.*Too many #ifdef" | wc -l`
|
||||
let "nval=$nmatch-$nsys-$nnone-$ndef"
|
||||
if test $nval -gt 0
|
||||
then
|
||||
cat $tmpfil
|
||||
rm $tmpfil
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm $tmpfil
|
||||
exit 0
|
||||
185
ThirdParty/custom-opm-common/opm-common/cmake/Templates/DoxygenLayout.xml
vendored
Normal file
185
ThirdParty/custom-opm-common/opm-common/cmake/Templates/DoxygenLayout.xml
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
<doxygenlayout version="1.0">
|
||||
<!-- Navigation index tabs for HTML output -->
|
||||
<navindex>
|
||||
<tab type="mainpage" visible="yes" title="OPM"/>
|
||||
<tab type="pages" visible="yes" title="Tutorials" intro=""/>
|
||||
<tab type="modules" visible="yes" title="" intro=""/>
|
||||
<tab type="namespaces" visible="yes" title="">
|
||||
<tab type="namespaces" visible="yes" title="" intro=""/>
|
||||
<tab type="namespacemembers" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="classes" visible="yes" title="">
|
||||
<tab type="classes" visible="yes" title="" intro=""/>
|
||||
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||
<tab type="hierarchy" visible="yes" title="" intro=""/>
|
||||
<tab type="classmembers" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="files" visible="yes" title="">
|
||||
<tab type="files" visible="yes" title="" intro=""/>
|
||||
<tab type="globals" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="dirs" visible="yes" title="" intro=""/>
|
||||
<tab type="examples" visible="yes" title="" intro=""/>
|
||||
</navindex>
|
||||
|
||||
<!-- Layout definition for a class page -->
|
||||
<class>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||
<inheritancegraph visible="$CLASS_GRAPH"/>
|
||||
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
|
||||
<allmemberslink visible="yes"/>
|
||||
<memberdecl>
|
||||
<nestedclasses visible="yes" title=""/>
|
||||
<publictypes title=""/>
|
||||
<publicslots title=""/>
|
||||
<signals title=""/>
|
||||
<publicmethods title=""/>
|
||||
<publicstaticmethods title=""/>
|
||||
<publicattributes title=""/>
|
||||
<publicstaticattributes title=""/>
|
||||
<protectedtypes title=""/>
|
||||
<protectedslots title=""/>
|
||||
<protectedmethods title=""/>
|
||||
<protectedstaticmethods title=""/>
|
||||
<protectedattributes title=""/>
|
||||
<protectedstaticattributes title=""/>
|
||||
<packagetypes title=""/>
|
||||
<packagemethods title=""/>
|
||||
<packagestaticmethods title=""/>
|
||||
<packageattributes title=""/>
|
||||
<packagestaticattributes title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
<privatetypes title=""/>
|
||||
<privateslots title=""/>
|
||||
<privatemethods title=""/>
|
||||
<privatestaticmethods title=""/>
|
||||
<privateattributes title=""/>
|
||||
<privatestaticattributes title=""/>
|
||||
<friends title=""/>
|
||||
<related title="" subtitle=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<constructors title=""/>
|
||||
<functions title=""/>
|
||||
<related title=""/>
|
||||
<variables title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
</memberdef>
|
||||
<usedfiles visible="$SHOW_USED_FILES"/>
|
||||
<authorsection visible="yes"/>
|
||||
</class>
|
||||
|
||||
<!-- Layout definition for a namespace page -->
|
||||
<namespace>
|
||||
<briefdescription visible="yes"/>
|
||||
<memberdecl>
|
||||
<nestednamespaces visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</namespace>
|
||||
|
||||
<!-- Layout definition for a file page -->
|
||||
<file>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||
<includegraph visible="$INCLUDE_GRAPH"/>
|
||||
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
|
||||
<sourcelink visible="yes"/>
|
||||
<memberdecl>
|
||||
<classes visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection/>
|
||||
</file>
|
||||
|
||||
<!-- Layout definition for a group page -->
|
||||
<group>
|
||||
<briefdescription visible="yes"/>
|
||||
<groupgraph visible="$GROUP_GRAPHS"/>
|
||||
<memberdecl>
|
||||
<classes visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<dirs visible="yes" title=""/>
|
||||
<nestedgroups visible="yes" title=""/>
|
||||
<files visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<signals title=""/>
|
||||
<publicslots title=""/>
|
||||
<protectedslots title=""/>
|
||||
<privateslots title=""/>
|
||||
<events title=""/>
|
||||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<pagedocs/>
|
||||
<inlineclasses title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<signals title=""/>
|
||||
<publicslots title=""/>
|
||||
<protectedslots title=""/>
|
||||
<privateslots title=""/>
|
||||
<events title=""/>
|
||||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</group>
|
||||
|
||||
<!-- Layout definition for a directory page -->
|
||||
<directory>
|
||||
<briefdescription visible="yes"/>
|
||||
<directorygraph visible="yes"/>
|
||||
<memberdecl>
|
||||
<dirs visible="yes"/>
|
||||
<files visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
</directory>
|
||||
</doxygenlayout>
|
||||
41
ThirdParty/custom-opm-common/opm-common/cmake/Templates/la.in
vendored
Normal file
41
ThirdParty/custom-opm-common/opm-common/cmake/Templates/la.in
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# lib@target@.la - a libtool library file
|
||||
# Generated by libtool (GNU libtool) @ltversion@
|
||||
#
|
||||
# Please DO NOT delete this file!
|
||||
# It is necessary for linking the library.
|
||||
|
||||
# The name that we can dlopen(3).
|
||||
dlname='@dlname@'
|
||||
|
||||
# Names of this library.
|
||||
library_names='@library_names@'
|
||||
|
||||
# The name of the static archive.
|
||||
old_library='@old_library@'
|
||||
|
||||
# Linker flags that can not go in dependency_libs.
|
||||
inherited_linker_flags='@inherited_linker_flags@'
|
||||
|
||||
# Libraries that this one depends upon.
|
||||
dependency_libs='@dependency_libs@'
|
||||
|
||||
# Names of additional weak libraries provided by this library
|
||||
weak_library_names=''
|
||||
|
||||
# Version information for lib@target@.
|
||||
current=@current@
|
||||
age=@age@
|
||||
revision=0
|
||||
|
||||
# Is this an already installed library?
|
||||
installed=no
|
||||
|
||||
# Should we warn about portability when linking against -modules?
|
||||
shouldnotlink=no
|
||||
|
||||
# Files to dlopen/dlpreopen
|
||||
dlopen=''
|
||||
dlpreopen=''
|
||||
|
||||
# Directory that this library needs to be installed in:
|
||||
libdir='@libdir@'
|
||||
28
ThirdParty/custom-opm-common/opm-common/cmake/Templates/opm-project-config-version.cmake.in
vendored
Normal file
28
ThirdParty/custom-opm-common/opm-common/cmake/Templates/opm-project-config-version.cmake.in
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# - CMake version file for @opm-project_NAME@
|
||||
#
|
||||
# Determine if requested version matches exactly or is compatible with
|
||||
# the installed package. It sets the following variables:
|
||||
#
|
||||
# PACKAGE_VERSION Full provided version string
|
||||
# PACKAGE_VERSION_COMPATIBLE True if version is compatible
|
||||
# PACKAGE_VERSION_EXACT True if version is exact match
|
||||
|
||||
# This file is used by find_package to see if the installed version of a
|
||||
# package can be used by the client, before the main -config.cmake file
|
||||
# is loaded.
|
||||
# see <http://www.cmake.org/Wiki/CMake/Tutorials/Packaging#Package_Version_Files>
|
||||
|
||||
# this is the version that is installed
|
||||
set (PACKAGE_VERSION @opm-project_VERSION@)
|
||||
|
||||
# if we wanted this exact version, then everything's fine
|
||||
if (PACKAGE_VERSION VERSION_EQUAL PACKAGE_FIND_VERSION)
|
||||
set (PACKAGE_VERSION_EXACT TRUE)
|
||||
endif (PACKAGE_VERSION VERSION_EQUAL PACKAGE_FIND_VERSION)
|
||||
|
||||
# in general, we assume that there is going to be API breakage between
|
||||
# released versions; this will hopefully change in the future
|
||||
## compatible versions
|
||||
#if (NOT PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
# set (PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
#endif (NOT PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user