79553333da
If the OpenMP flag is added to the build, this should probably be propagated to the user programs as well.
63 lines
2.8 KiB
CMake
63 lines
2.8 KiB
CMake
# - Open Porous Media Initiative Core Library config mode
|
|
#
|
|
# Defines the following variables:
|
|
# opm-core_FOUND - true
|
|
# opm-core_VERSION - version of the opm-core library found, e.g. 0.2
|
|
# opm-core_DEFINITIONS - defines to be made on the command line
|
|
# opm-core_INCLUDE_DIRS - header directories with which to compile
|
|
# opm-core_LINKER_FLAGS - flags that must be passed to the linker
|
|
# opm-core_LIBRARIES - names of the libraries with which to link
|
|
# opm-core_LIBRARY_DIRS - directories in which the libraries are situated
|
|
#
|
|
# You should put lines like this in your CMakeLists.txt
|
|
# set (opm-core_DIR "${PROJECT_BINARY_DIR}/../opm-core" CACHE LOCATION "Build tree of opm-core")
|
|
# find_package (opm-core)
|
|
# configure_vars (
|
|
# FILE CXX "${PROJECT_BINARY_DIR}/config.h"
|
|
# WRITE ${opm-core_CONFIG_VARS}
|
|
# )
|
|
|
|
# <http://www.vtk.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file>
|
|
|
|
# propagate these properties from one build system to the other
|
|
set (opm-core_VERSION "@opm-core_VERSION@")
|
|
set (opm-core_DEFINITIONS "@opm-core_DEFINITIONS@")
|
|
set (opm-core_INCLUDE_DIRS "@opm-core_INCLUDE_DIRS@")
|
|
set (opm-core_LIBRARY_DIRS "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
|
|
set (opm-core_LINKER_FLAGS "@opm-core_LINKER_FLAGS@")
|
|
set (opm-core_CONFIG_VARS "@opm-core_CONFIG_VARS@")
|
|
|
|
# libraries come from the build tree where this file was generated
|
|
set (opm-core_LIBRARY "@opm-core_LIBRARY@")
|
|
set (opm-core_LIBRARIES ${opm-core_LIBRARY} "@opm-core_LIBRARIES@")
|
|
mark_as_advanced (opm-core_LIBRARY)
|
|
|
|
# add the library as a target, so that other things in the project including
|
|
# this file may depend on it and get rebuild if this library changes.
|
|
add_library (opmcore UNKNOWN IMPORTED)
|
|
set_property (TARGET opmcore PROPERTY IMPORTED_LOCATION "${opm-core_LIBRARY}")
|
|
|
|
# ensure that we build with support for C++11 to preserve ABI
|
|
string (REPLACE "@CXX_STD0X_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
|
|
set (CMAKE_CXX_FLAGS "@CXX_STD0X_FLAGS@ ${CMAKE_CXX_FLAGS}")
|
|
|
|
# same as above, but for C99
|
|
string (REPLACE "@C_STD99_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
|
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
|
|
set (CMAKE_C_FLAG "@C_STD99_FLAGS@ ${CMAKE_C_FLAGS}")
|
|
|
|
# build with OpenMP if that was found
|
|
if (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
|
|
string (REPLACE "@OpenMP_C_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
|
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
|
|
set (CMAKE_C_FLAG "@OpenMP_C_FLAGS@ ${CMAKE_C_FLAGS}")
|
|
endif (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
|
|
if (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "")
|
|
string (REPLACE "@OpenMP_CXX_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
|
|
set (CMAKE_C_FLAG "@OpenMP_CXX_FLAGS@ ${CMAKE_CXX_FLAGS}")
|
|
endif (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "")
|
|
|
|
# this is the contents of config.h as far as our probes can tell:
|