diff options
| author | Helio Castro <helio@kde.org> | 2008-11-11 20:25:04 +0000 | 
|---|---|---|
| committer | Helio Castro <helio@kde.org> | 2008-11-11 20:25:04 +0000 | 
| commit | 044ccedb3df4f40ae1d8d7488d4dbc3b0c09484f (patch) | |
| tree | 7453868eb75b636ebceba9ed0b018d8367fd41b7 /modules/FindKdcraw.cmake | |
| parent | ea83b56d11ff7db0e6604b75e4a4e083300f4cd7 (diff) | |
| download | extra-cmake-modules-044ccedb3df4f40ae1d8d7488d4dbc3b0c09484f.tar.gz extra-cmake-modules-044ccedb3df4f40ae1d8d7488d4dbc3b0c09484f.tar.bz2 | |
- Made changes requested by Alex
svn path=/trunk/KDE/kdelibs/; revision=882988
Diffstat (limited to 'modules/FindKdcraw.cmake')
| -rw-r--r-- | modules/FindKdcraw.cmake | 34 | 
1 files changed, 26 insertions, 8 deletions
| diff --git a/modules/FindKdcraw.cmake b/modules/FindKdcraw.cmake index 4e265ce6..5527a5f4 100644 --- a/modules/FindKdcraw.cmake +++ b/modules/FindKdcraw.cmake @@ -1,23 +1,41 @@ -# - Try to find the Kdcraw library using cmake pkg_check_modules +# - Try to find the Kdcraw library using cmake pkg_check_modulesi otherwise fallback to standard search +# Once done this will define: +# +#  KDCRAW_FOUND - system has libkdcraw +#  KDCRAW_INCLUDEDIR - the libkdcraw include directory +#  KDCRAW_LIBRARIES - Link these to use libkdcraw +#  KDCRAW_DEFINITIONS - Compiler switches required for using libkdcraw +  if (KDCRAW_INCLUDEDIR AND KDCRAW_LIBRARIES)      # in cache already      SET(KDCRAW_FOUND TRUE)  else (KDCRAW_INCLUDEDIR AND KDCRAW_LIBRARIES)      if(NOT WIN32) -        find_package(PkgConfig REQUIRED) -        if (Kdcraw_FIND_REQUIRED) -            pkg_check_modules(KDCRAW REQUIRED libkdcraw>=0.2.0) -        else (Kdcraw_FIND_REQUIRED) +        find_package(PkgConfig) +        if(PKG_CONFIG_EXECUTABLE)              pkg_check_modules(KDCRAW libkdcraw>=0.2.0) -        endif (Kdcraw_FIND_REQUIRED) -    else(NOT WIN32) -        set(KDCRAW_FOUND TRUE) +        endif(PKG_CONFIG_EXECUTABLE)      endif(NOT WIN32) + +    if(NOT KDCRAW_FOUND) +        find_path(KDCRAW_INCLUDEDIR libkdcraw/version.h) +        find_library(KDCRAW_LIBRARIES NAMES kdcraw) +        if (KDCRAW_INCLUDEDIR AND KDCRAW_LIBRARIES) +            set(KDCRAW_FOUND TRUE) +        endif (KDCRAW_INCLUDEDIR AND KDCRAW_LIBRARIES) +    endif(NOT KDCRAW_FOUND) +          if(KDCRAW_FOUND)          set(KDCRAW_DEFINITIONS ${KDCRAW_CFLAGS})          if (NOT Kdcraw_FIND_QUIETLY)              message(STATUS "Found libkdcraw: ${KDCRAW_LIBRARIES}")          endif (NOT Kdcraw_FIND_QUIETLY) +        set(KDCRAW_INCLUDE_DIR ${KDCRAW_INCLUDEDIR}) +        mark_as_advanced( KDCRAW_INCLUDE_DIR ) +    else(KDCRAW_FOUND) +        if (Kdcraw_FIND_REQUIRED) +            message(FATAL_ERROR "Not found required libkdcraw") +        endif (Kdcraw_FIND_REQUIRED)      endif (KDCRAW_FOUND)  endif (KDCRAW_INCLUDEDIR AND KDCRAW_LIBRARIES) | 
