Files
opm-core/cmake/Templates/opm-project-config.cmake.in
Roland Kaufmann 097068f9c1 Move now generic templates into cmake/ directory
Templates can now be reused across projects. The output files are still
put in the root of the output tree because that is where the client
programs will look for them.
2013-02-11 23:06:39 +01:00

63 lines
3.1 KiB
CMake

# - @opm-project_DESCRIPTION@ config mode
#
# Defines the following variables:
# @opm-project_NAME@_FOUND - true
# @opm-project_NAME@_VERSION - version of the @opm-project_NAME@ library found, e.g. 0.2
# @opm-project_NAME@_DEFINITIONS - defines to be made on the command line
# @opm-project_NAME@_INCLUDE_DIRS - header directories with which to compile
# @opm-project_NAME@_LINKER_FLAGS - flags that must be passed to the linker
# @opm-project_NAME@_LIBRARIES - names of the libraries with which to link
# @opm-project_NAME@_LIBRARY_DIRS - directories in which the libraries are situated
#
# You should put lines like this in your CMakeLists.txt
# set (@opm-project_NAME@_DIR "${PROJECT_BINARY_DIR}/../@opm-project_NAME@" CACHE LOCATION "Build tree of @opm-project_NAME@")
# find_package (@opm-project_NAME@)
# configure_vars (
# FILE CXX "${PROJECT_BINARY_DIR}/config.h"
# WRITE ${@opm-project_NAME@_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-project_NAME@_VERSION "@opm-project_VERSION@")
set (@opm-project_NAME@_DEFINITIONS "@opm-project_DEFINITIONS@")
set (@opm-project_NAME@_INCLUDE_DIRS "@opm-project_INCLUDE_DIRS@")
set (@opm-project_NAME@_LIBRARY_DIRS "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
set (@opm-project_NAME@_LINKER_FLAGS "@opm-project_LINKER_FLAGS@")
set (@opm-project_NAME@_CONFIG_VARS "@opm-project_CONFIG_VARS@")
# libraries come from the build tree where this file was generated
set (@opm-project_NAME@_LIBRARY "@opm-project_LIBRARY@")
set (@opm-project_NAME@_LIBRARIES ${@opm-project_NAME@_LIBRARY} "@opm-project_LIBRARIES@")
mark_as_advanced (@opm-project_NAME@_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 (@opm-project_TARGET@ UNKNOWN IMPORTED)
set_property (TARGET @opm-project_TARGET@ PROPERTY IMPORTED_LOCATION "${@opm-project_NAME@_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: