diff options
author | Andreas Pakulat <apaku@gmx.de> | 2008-08-15 23:50:11 +0000 |
---|---|---|
committer | Andreas Pakulat <apaku@gmx.de> | 2008-08-15 23:50:11 +0000 |
commit | 29d21f3abbfc6b6e9f9c44ac699443fe880fba7d (patch) | |
tree | cbc8523f249ce66f66960b8b10190d45cef246a5 | |
parent | 605c7c4a491fa6014e005d00e6a1d02a63aa2d51 (diff) | |
download | extra-cmake-modules-29d21f3abbfc6b6e9f9c44ac699443fe880fba7d.tar.gz extra-cmake-modules-29d21f3abbfc6b6e9f9c44ac699443fe880fba7d.tar.bz2 |
Allow to use a minimum version with cmake's find_package() call, like
find_package(KDE4 4.2.0 REQUIRED). Include some documentation for it.
svn path=/trunk/KDE/kdelibs/; revision=847677
-rw-r--r-- | modules/FindKDE4Internal.cmake | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index d99c131d..f3a1d93c 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -216,6 +216,12 @@ # without going all over the place, but still produce better performance. # It's also important to note that gcc cannot detect all warning conditions # unless the optimiser is active. +# +# This module allows to depend on a particular minimum version of kdelibs. +# To acomplish that one should use the apropriate cmake syntax for +# find_package. For example to depend on kdelibs >= 4.1.0 one should use +# +# find_package(KDE4 4.1.0 REQUIRED) # _KDE4_PLATFORM_INCLUDE_DIRS is used only internally # _KDE4_PLATFORM_DEFINITIONS is used only internally @@ -352,7 +358,25 @@ else (_kdeBootStrapping) # we need at least this version: if (NOT KDE_MIN_VERSION) - set(KDE_MIN_VERSION "3.9.0") + if (KDE4_FIND_VERSION_MAJOR) + message("${KDE4_FIND_VERSION_MAJOR}") + if (${KDE4_FIND_VERSION_MAJOR} EQUAL 4) + if (KDE4_FIND_VERSION_MINOR) + set(KDE_MIN_VERSION "4.${KDE4_FIND_VERSION_MINOR}") + else (KDE4_FIND_VERSION_MINOR) + set(KDE_MIN_VERSION "4.0") + endif (KDE4_FIND_VERSION_MINOR) + if (KDE4_FIND_VERSION_PATCH) + set(KDE_MIN_VERSION "${KDE_MIN_VERSION}.${KDE4_FIND_VERSION_PATCH}") + else (KDE4_FIND_VERSION_PATCH) + set(KDE_MIN_VERSION "${KDE_MIN_VERSION}.0") + endif (KDE4_FIND_VERSION_PATCH) + else (${KDE4_FIND_VERSION_MAJOR} EQUAL 4) + message(FATAL_ERROR "FindKDE4 can only be used with KDE 4") + endif (${KDE4_FIND_VERSION_MAJOR} EQUAL 4) + else (KDE4_FIND_VERSION_MAJOR) + set (KDE_MIN_VERSION "4.0.0") + endif (KDE4_FIND_VERSION_MAJOR) endif (NOT KDE_MIN_VERSION) #message(STATUS "KDE_MIN_VERSION=${KDE_MIN_VERSION} found ${KDEVERSION}") |