From bd69cdeea9aef1f254b7d83dd137a4de955151b7 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sat, 27 Dec 2014 15:28:39 +0000 Subject: 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 --- modules/ECMSetupVersion.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'modules/ECMSetupVersion.cmake') 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 # [SOVERSION ] # [VERSION_HEADER ] -# [PACKAGE_VERSION_FILE ] ) +# [PACKAGE_VERSION_FILE [COMPATIBILITY ]] ) # # 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) -- cgit v1.2.1