diff options
author | Allen Winter <winter@kde.org> | 2008-04-28 17:49:49 +0000 |
---|---|---|
committer | Allen Winter <winter@kde.org> | 2008-04-28 17:49:49 +0000 |
commit | 7dc75baf29c628fddc1f29c1e5fdf41073ac01f4 (patch) | |
tree | b6a18727a459569e0f6aa0bd2839358f36d27612 /modules | |
parent | 0dbc5e2878e907c671d7460920bf57d1368a37c3 (diff) | |
download | extra-cmake-modules-7dc75baf29c628fddc1f29c1e5fdf41073ac01f4.tar.gz extra-cmake-modules-7dc75baf29c628fddc1f29c1e5fdf41073ac01f4.tar.bz2 |
major rewrite:
- Nepomuk depends on Soprano, so we check for Soprano too, if not already
checked for. IOW: you no longer need to check for Soprano separately
first in order to successfully use Nepomuk.
- use FindPackageHandleStandardArgs()
svn path=/trunk/KDE/kdelibs/; revision=802159
Diffstat (limited to 'modules')
-rw-r--r-- | modules/FindNepomuk.cmake | 79 |
1 files changed, 43 insertions, 36 deletions
diff --git a/modules/FindNepomuk.cmake b/modules/FindNepomuk.cmake index c8c4aec5..1aa42408 100644 --- a/modules/FindNepomuk.cmake +++ b/modules/FindNepomuk.cmake @@ -1,44 +1,51 @@ # Once done this will define # +# Nepomuk requires Soprano, so this module checks for Soprano too. +# # NEPOMUK_FOUND - system has Nepomuk # NEPOMUK_INCLUDE_DIR - the Nepomuk include directory # NEPOMUK_LIBRARIES - Link these to use Nepomuk # NEPOMUK_DEFINITIONS - Compiler switches required for using Nepomuk # -FIND_PATH(NEPOMUK_INCLUDE_DIR - NAMES - nepomuk/resource.h - PATHS - ${KDE4_INCLUDE_DIR} - ${INCLUDE_INSTALL_DIR} - ) - -FIND_LIBRARY(NEPOMUK_LIBRARY - NAMES - nepomuk - PATHS - ${KDE4_LIB_DIR} - ${LIB_INSTALL_DIR} - ) - -set(NEPOMUK_LIBRARIES ${NEPOMUK_LIBRARY}) - -if(NEPOMUK_INCLUDE_DIR AND NEPOMUK_LIBRARIES) - set(Nepomuk_FOUND TRUE) -endif(NEPOMUK_INCLUDE_DIR AND NEPOMUK_LIBRARIES) - -if(Nepomuk_FOUND) - if(NOT Nepomuk_FIND_QUIETLY) - message(STATUS "Found Nepomuk: ${NEPOMUK_LIBRARIES}") - endif(NOT Nepomuk_FIND_QUIETLY) -else(Nepomuk_FOUND) - if(Nepomuk_FIND_REQUIRED) - if(NOT NEPOMUK_INCLUDE_DIR) - message(FATAL_ERROR "Could not find Nepomuk includes.") - endif(NOT NEPOMUK_INCLUDE_DIR) - if(NOT NEPOMUK_LIBRARIES) - message(FATAL_ERROR "Could not find Nepomuk library.") - endif(NOT NEPOMUK_LIBRARIES) - endif(Nepomuk_FIND_REQUIRED) -endif(Nepomuk_FOUND) +if (NOT DEFINED Soprano_FOUND) + macro_optional_find_package(Soprano) + macro_log_feature(Soprano_FOUND "Soprano" "Semantic Desktop Storing" "" FALSE "" "Soprano is needed for Nepomuk") +endif (NOT DEFINED Soprano_FOUND) + +if (Soprano_FOUND) + + set (NEPOMUK_FIND_REQUIRED ${Nepomuk_FIND_REQUIRED}) + if (NEPOMUK_INCLUDE_DIR AND NEPOMUK_LIBRARIES) + + # Already in cache, be silent + set(NEPOMUK_FIND_QUIETLY TRUE) + + else (NEPOMUK_INCLUDE_DIR AND NEPOMUK_LIBRARIES) + find_path(NEPOMUK_INCLUDE_DIR + NAMES + nepomuk/resource.h + PATHS + ${KDE4_INCLUDE_DIR} + ${INCLUDE_INSTALL_DIR} + ) + + find_library(NEPOMUK_LIBRARIES + NAMES + nepomuk + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} + ) + + mark_as_advanced(NEPOMUK_INCLUDE_DIR NEPOMUK_LIBRARIES) + + endif (NEPOMUK_INCLUDE_DIR AND NEPOMUK_LIBRARIES) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(NEPOMUK DEFAULT_MSG + NEPOMUK_LIBRARIES NEPOMUK_INCLUDE_DIR) + #to retain backward compatibility + set (Nepomuk_FOUND ${NEPOMUK_FOUND}) + +endif (Soprano_FOUND) |