diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-11-29 22:37:07 +0100 |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-11-29 22:37:07 +0100 |
commit | 8912ed6d71bf5339518da9eff485d9c64330eeb8 (patch) | |
tree | 999239e3f56dfffb6751ec20caf39f008b4d8329 | |
parent | 5b2979f01ccffc07b39750313103e6097ee1e0c7 (diff) | |
download | extra-cmake-modules-8912ed6d71bf5339518da9eff485d9c64330eeb8.tar.gz extra-cmake-modules-8912ed6d71bf5339518da9eff485d9c64330eeb8.tar.bz2 |
-use the write_basic_config_version_file() macro from cmake 2.8.6
Alex
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | extra-cmake-modules-config-version.cmake.in | 24 |
2 files changed, 4 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ee25743..294d9921 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,10 @@ install(FILES ${installFiles} DESTINATION ${MODULES_INSTALL_DIR}) file(RELATIVE_PATH relInstallDir ${CMAKE_INSTALL_PREFIX}/${CMAKECONFIG_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}) configure_file(extra-cmake-modules-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/extra-cmake-modules-config.cmake @ONLY) -configure_file(extra-cmake-modules-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/extra-cmake-modules-config-version.cmake @ONLY) +include(WriteBasicConfigVersionFile) +write_basic_config_version_file( ${CMAKE_CURRENT_BINARY_DIR}/extra-cmake-modules-config-version.cmake + VERSION ${ECM_MAJOR_VERSION}.${ECM_MINOR_VERSION}.${ECM_PATCH_VERSION} + COMPATIBILITY AnyNewerVersion ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/extra-cmake-modules-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/extra-cmake-modules-config-version.cmake diff --git a/extra-cmake-modules-config-version.cmake.in b/extra-cmake-modules-config-version.cmake.in deleted file mode 100644 index 3117aeaf..00000000 --- a/extra-cmake-modules-config-version.cmake.in +++ /dev/null @@ -1,24 +0,0 @@ -# This is a very basic file for the new style find_package() search mode, -# i.e. Config-mode. -# In this mode find_package() searches for a <package>Config.cmake -# file and an associated <package>Version.cmake file, which it loads to check -# the version number. -# This file can be used with configure_file() to generate such a file for a project -# with very basic logic. -# It 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 >= requested version. -# If this is not good enough for your project, you need to write your own -# improved <package>Version.cmake file. - - -set(PACKAGE_VERSION @ECM_MAJOR_VERSION@.@ECM_MINOR_VERSION@.@ECM_PATCH_VERSION@) - -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") - set(PACKAGE_VERSION_COMPATIBLE FALSE) -else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if("${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") - set(PACKAGE_VERSION_EXACT TRUE) - endif() -endif() |