diff options
author | Alex Merry <alex.merry@kde.org> | 2014-12-27 15:28:39 +0000 |
---|---|---|
committer | Alex Merry <alex.merry@kde.org> | 2014-12-28 15:03:31 +0000 |
commit | bd69cdeea9aef1f254b7d83dd137a4de955151b7 (patch) | |
tree | f31fa1f7730fa6cf5aa64b506d5aaa306d3c1891 /modules | |
parent | fe771709d774402e4cdeb883c2783f64b6e62d65 (diff) | |
download | extra-cmake-modules-bd69cdeea9aef1f254b7d83dd137a4de955151b7.tar.gz extra-cmake-modules-bd69cdeea9aef1f254b7d83dd137a4de955151b7.tar.bz2 |
Add COMPATIBILITY argument to ecm_setup_version().
Lots of libraries will want to use SameMajorVersion to make sure
searching for version 1 of a library doesn't give you version 2, for
example.
We may want to add another, custom compatibility mode for
KDE Frameworks-style versioning, where version x.90.z to x.99.z are
alpha/beta releases for version (x+1).
REVIEW: 121696
Diffstat (limited to 'modules')
-rw-r--r-- | modules/ECMSetupVersion.cmake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/ECMSetupVersion.cmake b/modules/ECMSetupVersion.cmake index 2aff0ae0..83d7d798 100644 --- a/modules/ECMSetupVersion.cmake +++ b/modules/ECMSetupVersion.cmake @@ -10,7 +10,7 @@ # VARIABLE_PREFIX <prefix> # [SOVERSION <soversion>] # [VERSION_HEADER <filename>] -# [PACKAGE_VERSION_FILE <filename>] ) +# [PACKAGE_VERSION_FILE <filename> [COMPATIBILITY <compat>]] ) # # This parses a version string and sets up a standard set of version variables. # It can optionally also create a C version header file and a CMake package @@ -55,7 +55,9 @@ # file is created using the write_basic_package_version_file() macro provided by # CMake. It should be installed in the same location as the Config.cmake file of # the library so that it can be found by find_package(). If the filename is a -# relative path, it is interpreted as relative to CMAKE_CURRENT_BINARY_DIR. +# relative path, it is interpreted as relative to CMAKE_CURRENT_BINARY_DIR. The +# optional COMPATIBILITY option is forwarded to +# write_basic_package_version_file(), and defaults to AnyNewerVersion. # # If CMake policy CMP0048 is NEW, an alternative form of the command is # available:: @@ -94,7 +96,7 @@ set(_ECM_SETUP_VERSION_HEADER_TEMPLATE "${CMAKE_CURRENT_LIST_DIR}/ECMVersionHead function(ECM_SETUP_VERSION _version) set(options ) - set(oneValueArgs VARIABLE_PREFIX SOVERSION VERSION_HEADER PACKAGE_VERSION_FILE) + set(oneValueArgs VARIABLE_PREFIX SOVERSION VERSION_HEADER PACKAGE_VERSION_FILE COMPATIBILITY) set(multiValueArgs ) cmake_parse_arguments(ESV "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -175,7 +177,10 @@ function(ECM_SETUP_VERSION _version) endif() if(ESV_PACKAGE_VERSION_FILE) - write_basic_package_version_file("${ESV_PACKAGE_VERSION_FILE}" VERSION ${_version} COMPATIBILITY AnyNewerVersion) + if(NOT ESV_COMPATIBILITY) + set(ESV_COMPATIBILITY AnyNewerVersion) + endif() + write_basic_package_version_file("${ESV_PACKAGE_VERSION_FILE}" VERSION ${_version} COMPATIBILITY ${ESV_COMPATIBILITY}) endif() if(should_set_prefixed_vars) |