This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via a948b62ff8c0f72f89f2638222986d782cba47f1 (commit) via e390f87dd197c18e560fb7381f9dad8d15a31297 (commit) via 5d1822391765f1466a07884810919c8549556e0a (commit) via 1c69cd8febb41c45d4269d6fef24277a60ed3733 (commit) via 71c16e457c795bc6635515f026c5f9f8d952b59d (commit) from ab8fc0f1e52eb47d7d1443e2ca2bed9e01daa61c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a948b62ff8c0f72f89f2638222986d782cba47f1 commit a948b62ff8c0f72f89f2638222986d782cba47f1 Merge: ab8fc0f e390f87 Author: Alexander Neundorf <neund...@kde.org> AuthorDate: Sat Mar 10 10:27:59 2012 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Sat Mar 10 10:27:59 2012 -0500 Merge topic 'ExactVersionModeForVersionFile' into next e390f87 WriteBasicConfigVersionFile: add test for ExactVersion mode 5d18223 write_basic_package_version_file: add ExactVersion mode 1c69cd8 write_basic_package_version_file(): improve documentation 71c16e4 KWSys Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e390f87dd197c18e560fb7381f9dad8d15a31297 commit e390f87dd197c18e560fb7381f9dad8d15a31297 Author: Alex Neundorf <neund...@kde.org> AuthorDate: Sat Mar 10 16:19:02 2012 +0100 Commit: Alex Neundorf <neund...@kde.org> CommitDate: Sat Mar 10 16:19:02 2012 +0100 WriteBasicConfigVersionFile: add test for ExactVersion mode Alex diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index a4f213b..73f24e0 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -421,3 +421,73 @@ endif() if(PACKAGE_VERSION_UNSUITABLE) message(SEND_ERROR "PACKAGE_VERSION_UNSUITABLE set, but must not be !") endif() + +####################### + +write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/Bar123ConfigVersion.cmake + VERSION 1.2.3.17 + COMPATIBILITY ExactVersion) + +set(PACKAGE_VERSION_EXACT FALSE) +set(PACKAGE_FIND_VERSION 2.3.4) +include(${CMAKE_CURRENT_BINARY_DIR}/Bar123ConfigVersion.cmake) +if(PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Found Bar123 with version 1.2.3 (2.3.4 was requested) !") +endif() +if(PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be !") +endif() + +set(PACKAGE_FIND_VERSION 1.2) +include(${CMAKE_CURRENT_BINARY_DIR}/Bar123ConfigVersion.cmake) +if(PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Found Bar123 with version 1.2.3 (1.2 was requested) !") +endif() +if(PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be !") +endif() + +set(PACKAGE_FIND_VERSION 1) +include(${CMAKE_CURRENT_BINARY_DIR}/Bar123ConfigVersion.cmake) +if(PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Found Bar123 with version 1.2.3 (1 was requested) !") +endif() +if(PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be !") +endif() + +set(PACKAGE_FIND_VERSION 1.2.3.4) +include(${CMAKE_CURRENT_BINARY_DIR}/Bar123ConfigVersion.cmake) +if(NOT PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Did not find Bar123 with version 1.2.3 (1.2.3.4 was requested) !") +endif() +if(PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be !") +endif() + +set(PACKAGE_FIND_VERSION 1.2.3) +set(PACKAGE_VERSION_EXACT FALSE) +set(PACKAGE_VERSION_COMPATIBLE FALSE) +include(${CMAKE_CURRENT_BINARY_DIR}/Bar123ConfigVersion.cmake) +if(NOT PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Did not find Bar123 with version 1.2.3 (1.2.3 was requested) !") +endif() +if(PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be !") +endif() + + +set(PACKAGE_FIND_VERSION 1.2.3.17) +set(PACKAGE_VERSION_EXACT FALSE) +set(PACKAGE_VERSION_COMPATIBLE FALSE) +include(${CMAKE_CURRENT_BINARY_DIR}/Bar123ConfigVersion.cmake) +if(NOT PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Did not find Bar123 with version 1.2.3 (1.2.3.17 was requested) !") +endif() +if(NOT PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT not set, although it should be !") +endif() + +if(PACKAGE_VERSION_UNSUITABLE) + message(SEND_ERROR "PACKAGE_VERSION_UNSUITABLE set, but must not be !") +endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d1822391765f1466a07884810919c8549556e0a commit 5d1822391765f1466a07884810919c8549556e0a Author: Alex Neundorf <neund...@kde.org> AuthorDate: Sat Mar 10 16:05:19 2012 +0100 Commit: Alex Neundorf <neund...@kde.org> CommitDate: Sat Mar 10 16:10:52 2012 +0100 write_basic_package_version_file: add ExactVersion mode This mode is for packages which consider themselves only compatible if exactly the same version is requested. The tweak version is ignored. Alex diff --git a/Modules/BasicConfigVersion-ExactVersion.cmake.in b/Modules/BasicConfigVersion-ExactVersion.cmake.in new file mode 100644 index 0000000..c610baa --- /dev/null +++ b/Modules/BasicConfigVersion-ExactVersion.cmake.in @@ -0,0 +1,42 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is equal to the requested version. +# The tweak version component is ignored. +# The variable CVF_VERSION must be set before calling configure_file(). + + +set(PACKAGE_VERSION "@CVF_VERSION@") + +if("@CVF_VERSION@" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version + set(CVF_VERSION_NO_TWEAK "${CMAKE_MATCH_1}") +else() + set(CVF_VERSION_NO_TWEAK "@CVF_VERSION@") +endif() + +if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version + set(REQUESTED_VERSION_NO_TWEAK "${CMAKE_MATCH_1}") +else() + set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}") +endif() + +if("${REQUESTED_VERSION_NO_TWEAK}" STREQUAL "${CVF_VERSION_NO_TWEAK}") + set(PACKAGE_VERSION_COMPATIBLE TRUE) +else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) +endif() + +if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) +endif() + + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") + math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index 4b1eba4..98cd560 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -61,7 +61,7 @@ # For an example see below the documentation for WRITE_BASIC_PACKAGE_VERSION_FILE(). # # -# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion) ) +# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) ) # # Writes a file for use as <package>ConfigVersion.cmake file to <filename>. # See the documentation of FIND_PACKAGE() for details on this. @@ -76,6 +76,10 @@ # not be considered compatible if 1.0 is requested. # This mode should be used for packages which guarantee backward compatibility within the # same major version. +# If ExactVersion is used, then the package is only considered compatible if the requested +# version matches exactly its own version number (not considering the tweak version). +# For example, version 1.2.3 of a package is only considered compatible to requested version 1.2.3. +# This mode is for packages without compatibility guarantees. # If your project has more elaborated version matching rules, you will need to write your # own custom ConfigVersion.cmake file instead of using this macro. # http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c69cd8febb41c45d4269d6fef24277a60ed3733 commit 1c69cd8febb41c45d4269d6fef24277a60ed3733 Author: Alex Neundorf <neund...@kde.org> AuthorDate: Sat Mar 10 16:07:07 2012 +0100 Commit: Alex Neundorf <neund...@kde.org> CommitDate: Sat Mar 10 16:09:17 2012 +0100 write_basic_package_version_file(): improve documentation add notes when which mode should be used Alex diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index b174e98..4b1eba4 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -69,9 +69,13 @@ # major.minor.patch is the version number of the project to be installed # The COMPATIBILITY mode AnyNewerVersion means that the installed package version # will be considered compatible if it is newer or exactly the same as the requested version. +# This mode should be used for packages which are fully backward compatible, +# also across major versions. # If SameMajorVersion is used instead, then the behaviour differs from AnyNewerVersion # in that the major version number must be the same as requested, e.g. version 2.0 will # not be considered compatible if 1.0 is requested. +# This mode should be used for packages which guarantee backward compatibility within the +# same major version. # If your project has more elaborated version matching rules, you will need to write your # own custom ConfigVersion.cmake file instead of using this macro. # ----------------------------------------------------------------------- Summary of changes: Modules/BasicConfigVersion-ExactVersion.cmake.in | 42 +++++++++++++ Modules/CMakePackageConfigHelpers.cmake | 10 +++- Source/kwsys/kwsysDateStamp.cmake | 2 +- Tests/FindPackageTest/CMakeLists.txt | 70 ++++++++++++++++++++++ 4 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 Modules/BasicConfigVersion-ExactVersion.cmake.in hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits