aboutsummaryrefslogtreecommitdiff
path: root/modules/BasicFindPackageVersion.cmake.in
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-12-14 23:11:35 +0000
committerAlexander Neundorf <neundorf@kde.org>2008-12-14 23:11:35 +0000
commit728a5895ce2bd160b3a8748ee15711d942d62ebb (patch)
treef4783c340a4f48b09d9d6ff366d55b599e2a4ebf /modules/BasicFindPackageVersion.cmake.in
parentd6452721669defdbf81eb43cdab8e08b4ef43ed7 (diff)
downloadextra-cmake-modules-728a5895ce2bd160b3a8748ee15711d942d62ebb.tar.gz
extra-cmake-modules-728a5895ce2bd160b3a8748ee15711d942d62ebb.tar.bz2
-rename the new kde4_write_basic_cmake_version_file() to macro_write_basic_cmake_version_file(), since
it is completely KDE-independent and can potentially be used in any other project remove the old macro, add the new renamed one, add it to the macro library, adjust kdepimlibs/CMakeLists.txt accordingly Alex svn path=/trunk/KDE/kdelibs/; revision=896999
Diffstat (limited to 'modules/BasicFindPackageVersion.cmake.in')
-rw-r--r--modules/BasicFindPackageVersion.cmake.in30
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/BasicFindPackageVersion.cmake.in b/modules/BasicFindPackageVersion.cmake.in
new file mode 100644
index 00000000..ae5d3125
--- /dev/null
+++ b/modules/BasicFindPackageVersion.cmake.in
@@ -0,0 +1,30 @@
+# This is a very basic file for the new style find_package() search mode,
+# i.e. Config-mode. It is used by MACRO_WRITE_BASIC_CMAKE_VERSION_FILE() from
+# MacroWriteBasicCMakeVersionFile.cmake.
+# 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.
+# This file requires the following three variables to be set:
+# PROJECT_VERSION_MAJOR
+# PROJECT_VERSION_MINOR
+# PROJECT_VERSION_PATCH
+
+
+set(PACKAGE_VERSION @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@)
+
+if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
+ set(PACKAGE_VERSION_EXACT TRUE)
+ endif( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
+endif("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+