Use custom version scheme instead of fragile CMake one

CMake will not be able to make sense out of the YYYY.MM versioning
convention (since the "major" versions are not related), and we
expect API breakage in the short term anyway.
This commit is contained in:
Roland Kaufmann 2013-01-22 21:29:47 +01:00
parent 4aa523e534
commit 6a92569070
2 changed files with 33 additions and 6 deletions

View File

@ -192,16 +192,15 @@ configure_file (
${PROJECT_BINARY_DIR}/opm-core-config.cmake ${PROJECT_BINARY_DIR}/opm-core-config.cmake
@ONLY @ONLY
) )
configure_file (
${PROJECT_SOURCE_DIR}/opm-core-config-version.cmake.in
${PROJECT_BINARY_DIR}/opm-core-config-version.cmake
@ONLY
)
configure_vars ( configure_vars (
FILE CMAKE "${PROJECT_BINARY_DIR}/opm-core-config.cmake" FILE CMAKE "${PROJECT_BINARY_DIR}/opm-core-config.cmake"
APPEND "${opm-core_CONFIG_VARS}" APPEND "${opm-core_CONFIG_VARS}"
) )
include (WriteBasicConfigVersionFile)
write_basic_config_version_file (
"${PROJECT_BINARY_DIR}/opm-core-config-version.cmake"
VERSION ${opm-core_VERSION}
COMPATIBILITY SameMajorVersion
)
### installation ### ### installation ###
string (LENGTH ${PROJECT_SOURCE_DIR} _prefix_length) string (LENGTH ${PROJECT_SOURCE_DIR} _prefix_length)

View File

@ -0,0 +1,28 @@
# - CMake version file for OPM-core
#
# 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-core_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)