diff options
author | Sebastian Trueg <sebastian@trueg.de> | 2008-01-19 08:43:16 +0000 |
---|---|---|
committer | Sebastian Trueg <sebastian@trueg.de> | 2008-01-19 08:43:16 +0000 |
commit | 15e41e39f4ff6ed259848d960a28cb1f277047b2 (patch) | |
tree | 3e8083e48a6206c42d674b09ecdc281a81a86cc5 | |
parent | 39c3e2344c4178f258f2a96133bd587938a7f686 (diff) | |
download | extra-cmake-modules-15e41e39f4ff6ed259848d960a28cb1f277047b2.tar.gz extra-cmake-modules-15e41e39f4ff6ed259848d960a28cb1f277047b2.tar.bz2 |
* Make the Soprano minimum version configurable with a default of 1.99 for backwards compatibility.
svn path=/trunk/KDE/kdelibs/; revision=763296
-rw-r--r-- | modules/FindSoprano.cmake | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/modules/FindSoprano.cmake b/modules/FindSoprano.cmake index ffa464df..2f726db9 100644 --- a/modules/FindSoprano.cmake +++ b/modules/FindSoprano.cmake @@ -1,4 +1,18 @@ - +# +# Find an installation of Soprano +# +# Sets the following variables: +# Soprano_FOUND - true is Soprano has been found +# SOPRANO_INCLUDE_DIR - The include directory +# SOPRANO_LIBRARIES - The Soprano core library to link to (libsoprano) +# SOPRANO_INDEX_LIBRARIES - The Soprano index library (libsopranoindex) +# SOPRANO_CLIENT_LIBRARIES - The Soprano client library (libsopranoclient) +# SOPRANO_SERVER_LIBRARIES - The Soprano server library (libsopranoserver) +# SOPRANO_VERSION - The Soprano version (string value) +# +# Options: +# Set SOPRANO_MIN_VERSION to set the minimum required Soprano version (default: 1.99) +# #if(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES AND SOPRANO_SERVER_LIBRARIES) @@ -55,7 +69,6 @@ ) # check for all the libs as required to make sure that we do not try to compile with an old version - # FIXME: introduce a Soprano version check if(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES) set(Soprano_FOUND TRUE) @@ -74,15 +87,21 @@ endif(Soprano_FOUND AND SOPRANO_SERVER_LIBRARIES) # check Soprano version + + # We set a default for the minimum required version to be backwards compatible + IF(NOT SOPRANO_MIN_VERSION) + SET(SOPRANO_MIN_VERSION "1.99") + ENDIF(NOT SOPRANO_MIN_VERSION) + if(Soprano_FOUND) FILE(READ ${SOPRANO_INCLUDE_DIR}/soprano/version.h SOPRANO_VERSION_CONTENT) STRING(REGEX MATCH "SOPRANO_VERSION_STRING \".*\"\n" SOPRANO_VERSION_MATCH ${SOPRANO_VERSION_CONTENT}) IF (SOPRANO_VERSION_MATCH) STRING(REGEX REPLACE "SOPRANO_VERSION_STRING \"(.*)\"\n" "\\1" SOPRANO_VERSION ${SOPRANO_VERSION_MATCH}) - if(SOPRANO_VERSION STRLESS "2.0") + if(SOPRANO_VERSION STRLESS "${SOPRANO_MIN_VERSION}") set(Soprano_FOUND FALSE) - message(FATAL_ERROR "Soprano version ${SOPRANO_VERSION} is too old. Please install 2.0 or newer") - endif(SOPRANO_VERSION STRLESS "2.0") + message(FATAL_ERROR "Soprano version ${SOPRANO_VERSION} is too old. Please install ${SOPRANO_MIN_VERSION} or newer") + endif(SOPRANO_VERSION STRLESS "${SOPRANO_MIN_VERSION}") ENDIF (SOPRANO_VERSION_MATCH) endif(Soprano_FOUND) |