Replace hardcoded opm-core name with variable
This commit is contained in:
parent
e7e53cedbf
commit
f472f2e8ef
@ -2,15 +2,16 @@
|
|||||||
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
|
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
|
||||||
|
|
||||||
# key information about the library
|
# key information about the library
|
||||||
set (opm-core_NAME "opm-core")
|
set (project "opm-core")
|
||||||
set (opm-core_DESCRIPTION "Open Porous Media Initiative Core Library")
|
set (${project}_NAME "${project}")
|
||||||
set (opm-core_DIR "opm")
|
set (${project}_DESCRIPTION "Open Porous Media Initiative Core Library")
|
||||||
set (opm-core_VERSION_MAJOR 1)
|
set (${project}_DIR "opm")
|
||||||
set (opm-core_VERSION_MINOR 0)
|
set (${project}_VERSION_MAJOR 1)
|
||||||
|
set (${project}_VERSION_MINOR 0)
|
||||||
set (doxy_dir "Documentation")
|
set (doxy_dir "Documentation")
|
||||||
|
|
||||||
# defines that must be present in config.h for our headers
|
# defines that must be present in config.h for our headers
|
||||||
set (opm-core_CONFIG_VAR
|
set (${project}_CONFIG_VAR
|
||||||
HAVE_AGMG
|
HAVE_AGMG
|
||||||
HAVE_DUNE_ISTL
|
HAVE_DUNE_ISTL
|
||||||
HAVE_DYNAMIC_BOOST_TEST
|
HAVE_DYNAMIC_BOOST_TEST
|
||||||
@ -21,7 +22,7 @@ set (opm-core_CONFIG_VAR
|
|||||||
)
|
)
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
set (opm-core_DEPS
|
set (${project}_DEPS
|
||||||
# compile with C99 support if available
|
# compile with C99 support if available
|
||||||
"C99"
|
"C99"
|
||||||
# compile with C++0x/11 support if available
|
# compile with C++0x/11 support if available
|
||||||
@ -46,13 +47,13 @@ set (opm-core_DEPS
|
|||||||
|
|
||||||
# C++ project
|
# C++ project
|
||||||
cmake_minimum_required (VERSION 2.8)
|
cmake_minimum_required (VERSION 2.8)
|
||||||
project (${opm-core_NAME})
|
project (${${project}_NAME})
|
||||||
enable_language (C)
|
enable_language (C)
|
||||||
enable_language (CXX)
|
enable_language (CXX)
|
||||||
|
|
||||||
# additional search modules
|
# additional search modules
|
||||||
set (opm-core_MODULE_DIR "${PROJECT_SOURCE_DIR}/cmake/Modules")
|
set (${project}_MODULE_DIR "${PROJECT_SOURCE_DIR}/cmake/Modules")
|
||||||
list (APPEND CMAKE_MODULE_PATH ${opm-core_MODULE_DIR})
|
list (APPEND CMAKE_MODULE_PATH ${${project}_MODULE_DIR})
|
||||||
|
|
||||||
# print system information to better pinpoint issues from log alone
|
# print system information to better pinpoint issues from log alone
|
||||||
include (UseSystemInfo)
|
include (UseSystemInfo)
|
||||||
@ -65,12 +66,12 @@ vcs_info ()
|
|||||||
# include special
|
# include special
|
||||||
if (CMAKE_VERSION VERSION_LESS "2.8.7")
|
if (CMAKE_VERSION VERSION_LESS "2.8.7")
|
||||||
message (STATUS "Enabling backward compatibility modules for CMake ${CMAKE_VERSION}")
|
message (STATUS "Enabling backward compatibility modules for CMake ${CMAKE_VERSION}")
|
||||||
list (APPEND CMAKE_MODULE_PATH "${opm-core_MODULE_DIR}/compat-2.8.7")
|
list (APPEND CMAKE_MODULE_PATH "${${project}_MODULE_DIR}/compat-2.8.7")
|
||||||
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
|
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
|
||||||
|
|
||||||
# default settings: build static debug library
|
# default settings: build static debug library
|
||||||
include (OpmDefaults)
|
include (OpmDefaults)
|
||||||
opm_defaults (opm-core)
|
opm_defaults (${project})
|
||||||
message (STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
message (STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
# use tricks to do faster builds
|
# use tricks to do faster builds
|
||||||
@ -81,11 +82,11 @@ include (UsePrecompHeaders)
|
|||||||
|
|
||||||
# macro to set standard variables (INCLUDE_DIRS, LIBRARIES etc.)
|
# macro to set standard variables (INCLUDE_DIRS, LIBRARIES etc.)
|
||||||
include (OpmFind)
|
include (OpmFind)
|
||||||
find_and_append_package_list_to (opm-core ${opm-core_DEPS})
|
find_and_append_package_list_to (${project} ${${project}_DEPS})
|
||||||
|
|
||||||
# remove the dependency on the testing framework from the main library;
|
# remove the dependency on the testing framework from the main library;
|
||||||
# it is not possible to query for Boost twice with different components.
|
# it is not possible to query for Boost twice with different components.
|
||||||
list (REMOVE_ITEM opm-core_LIBRARIES ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
|
list (REMOVE_ITEM ${project}_LIBRARIES ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
|
||||||
|
|
||||||
# don't import more libraries than we need to
|
# don't import more libraries than we need to
|
||||||
include (UseOnlyNeeded)
|
include (UseOnlyNeeded)
|
||||||
@ -113,7 +114,7 @@ opm_auto_dirs ()
|
|||||||
opm_out_dirs ()
|
opm_out_dirs ()
|
||||||
|
|
||||||
# identify the compilation units in the library
|
# identify the compilation units in the library
|
||||||
opm_sources (opm-core)
|
opm_sources (${project})
|
||||||
|
|
||||||
# enumerate all testing programs in test/ directory
|
# enumerate all testing programs in test/ directory
|
||||||
opm_find_tests ()
|
opm_find_tests ()
|
||||||
@ -193,11 +194,11 @@ endif (NOT HAVE_ERT)
|
|||||||
# is required by this project alone, plural version transitively
|
# is required by this project alone, plural version transitively
|
||||||
# includes the necessary defines by the dependencies
|
# includes the necessary defines by the dependencies
|
||||||
include (ConfigVars)
|
include (ConfigVars)
|
||||||
list (APPEND opm-core_CONFIG_VARS ${opm-core_CONFIG_VAR})
|
list (APPEND ${project}_CONFIG_VARS ${${project}_CONFIG_VAR})
|
||||||
set (CONFIG_H "${PROJECT_BINARY_DIR}/config.h")
|
set (CONFIG_H "${PROJECT_BINARY_DIR}/config.h")
|
||||||
configure_vars (
|
configure_vars (
|
||||||
FILE CXX ${CONFIG_H}
|
FILE CXX ${CONFIG_H}
|
||||||
WRITE ${opm-core_CONFIG_VARS}
|
WRITE ${${project}_CONFIG_VARS}
|
||||||
)
|
)
|
||||||
include (UseFortranWrappers)
|
include (UseFortranWrappers)
|
||||||
define_fc_func (
|
define_fc_func (
|
||||||
@ -206,24 +207,24 @@ define_fc_func (
|
|||||||
|
|
||||||
# compile main library; pull in all required includes and libraries
|
# compile main library; pull in all required includes and libraries
|
||||||
include (OpmCompile)
|
include (OpmCompile)
|
||||||
opm_compile (opm-core)
|
opm_compile (${project})
|
||||||
|
|
||||||
# installation target: copy the library together with debug and
|
# installation target: copy the library together with debug and
|
||||||
# configuration files to system directories
|
# configuration files to system directories
|
||||||
include (OpmInstall)
|
include (OpmInstall)
|
||||||
opm_install (opm-core)
|
opm_install (${project})
|
||||||
message (STATUS "This build defaults to installing in ${CMAKE_INSTALL_PREFIX}")
|
message (STATUS "This build defaults to installing in ${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
# installation of CMake modules to help user programs locate the library
|
# installation of CMake modules to help user programs locate the library
|
||||||
include (OpmProject)
|
include (OpmProject)
|
||||||
opm_cmake_config (opm-core)
|
opm_cmake_config (${project})
|
||||||
|
|
||||||
# routines to build satellites such as tests, tutorials and samples
|
# routines to build satellites such as tests, tutorials and samples
|
||||||
include (OpmSatellites)
|
include (OpmSatellites)
|
||||||
|
|
||||||
# tutorial programs are found in the tutorials/ directory
|
# tutorial programs are found in the tutorials/ directory
|
||||||
opm_compile_satellites (opm-core tutorial "" "")
|
opm_compile_satellites (${project} tutorial "" "")
|
||||||
opm_compile_satellites (opm-core examples "" "")
|
opm_compile_satellites (${project} examples "" "")
|
||||||
|
|
||||||
# infrastructure for testing
|
# infrastructure for testing
|
||||||
enable_testing ()
|
enable_testing ()
|
||||||
@ -245,7 +246,7 @@ cond_disable_test ("ERT")
|
|||||||
|
|
||||||
# make datafiles necessary for tests available in output directory
|
# make datafiles necessary for tests available in output directory
|
||||||
opm_data (tests datafiles "${tests_DIR}" "*.xml")
|
opm_data (tests datafiles "${tests_DIR}" "*.xml")
|
||||||
opm_compile_satellites (opm-core tests "" "${tests_REGEXP}")
|
opm_compile_satellites (${project} tests "" "${tests_REGEXP}")
|
||||||
|
|
||||||
# use this target to run all tests
|
# use this target to run all tests
|
||||||
add_custom_target (check
|
add_custom_target (check
|
||||||
@ -258,16 +259,16 @@ add_custom_target (check
|
|||||||
# generate documentation from source code with Doxygen;
|
# generate documentation from source code with Doxygen;
|
||||||
# setup install target for this documentation
|
# setup install target for this documentation
|
||||||
include (OpmDoc)
|
include (OpmDoc)
|
||||||
opm_doc (opm-core ${doxy_dir})
|
opm_doc (${project} ${doxy_dir})
|
||||||
|
|
||||||
# provide compatibility with using this build in dunecontrol
|
# provide compatibility with using this build in dunecontrol
|
||||||
include (DuneCompat)
|
include (DuneCompat)
|
||||||
include (LibtoolArchives)
|
include (LibtoolArchives)
|
||||||
configure_la (opm-core ${opm-core_TARGET} opm-core_LIBTOOL_ARCHIVE)
|
configure_la (${project} ${${project}_TARGET} ${project}_LIBTOOL_ARCHIVE)
|
||||||
|
|
||||||
### clean in-source builds ###
|
### clean in-source builds ###
|
||||||
include (OpmDistClean)
|
include (OpmDistClean)
|
||||||
opm_dist_clean (opm-core)
|
opm_dist_clean (${project})
|
||||||
|
|
||||||
# smart wrapper that auto-parallelizes builds
|
# smart wrapper that auto-parallelizes builds
|
||||||
file (COPY
|
file (COPY
|
||||||
|
Loading…
Reference in New Issue
Block a user