PROJECT(kipi-plugins) # ======================================================= # Information to update before to release this package. # kipi-plugins version #SET(KIPIPLUGINS_MAJOR_VERSION "1") #SET(KIPIPLUGINS_MINOR_VERSION "0") #SET(KIPIPLUGINS_PATCH_VERSION "0") # kipi-plugins release date #SET (KIPIPLUGINS_RELEASE_DATE "2009-12-21") # Suffix to add at end of version string. Usual values are: # "-svn" : alpha code unstable from svn. Do not use in production # "-beta1" : beta1 release. # "-beta2" : beta2 release. # "-beta3" : beta3 release. # "-rc" : release candidate. # "" : final relase. Can be used in production. #SET(KIPIPLUGINS_SUFFIX_VERSION "") # ======================================================= # Set env. variables accordinly. SET(KIPIPLUGINS_VERSION_STRING "0.0.1-piwigo" ) # ======================================================= FIND_PACKAGE(KDE4 REQUIRED) INCLUDE(MacroOptionalFindPackage) INCLUDE(FindPackageHandleStandardArgs) INCLUDE(KDE4Defaults) INCLUDE(MacroLibrary) # Depencies detection required by all plugins FIND_PACKAGE(Kexiv2 REQUIRED) FIND_PACKAGE(Kdcraw REQUIRED) FIND_PACKAGE(Kipi REQUIRED) FIND_PACKAGE(JPEG REQUIRED) FIND_PACKAGE(PNG REQUIRED) FIND_PACKAGE(TIFF REQUIRED) # Optional depencies detection required by some plugins SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) #MACRO_OPTIONAL_FIND_PACKAGE(EXPAT) # For DNGConverter: XMP SDK need Expat library to compile. #MACRO_OPTIONAL_FIND_PACKAGE(Threads) # For DNGConverter: DNG SDK need native threads support. #MACRO_OPTIONAL_FIND_PACKAGE(LibXml2) # For Htmlexport. #MACRO_OPTIONAL_FIND_PACKAGE(LibXslt) # For Htmlexport. #MACRO_OPTIONAL_FIND_PACKAGE(OpenGL) # For AdvancedSlideshow and ImageViewer. #MACRO_OPTIONAL_FIND_PACKAGE(OpenCV) # For RemoveRedEyes. #MACRO_OPTIONAL_FIND_PACKAGE(Gpod) # For ipodexport. #MACRO_OPTIONAL_FIND_PACKAGE(Gdk) # For ipodexport. #MACRO_OPTIONAL_FIND_PACKAGE(GLIB2) # For ipodexport. #MACRO_OPTIONAL_FIND_PACKAGE(GObject) # For ipodexport. #MACRO_OPTIONAL_FIND_PACKAGE(KdepimLibs) # For Calendar (libkcal). #MACRO_OPTIONAL_FIND_PACKAGE(QCA2) # For Shwup. #MACRO_OPTIONAL_FIND_PACKAGE(KSane) # For AcquireImages. IF(NOT WIN32) # Check KDcraw version installed to compile fine DngConverter plugin. FIND_PACKAGE(PkgConfig) PKG_CHECK_MODULES(Kdcraw libkdcraw>=0.4.0) IF(Kdcraw_FOUND) SET(KDCRAW_FOR_DNGCONVERTER TRUE) ELSE(Kdcraw_FOUND) SET(KDCRAW_FOR_DNGCONVERTER FALSE) ENDIF(Kdcraw_FOUND) ELSE(NOT WIN32) SET(KDCRAW_FOR_DNGCONVERTER TRUE) ENDIF(NOT WIN32) INCLUDE(MacroOptionalDependPackage) # ================================================================================================== # Log messages MESSAGE(STATUS "") MESSAGE(STATUS "----------------------------------------------------------------------------------") MESSAGE(STATUS " kipi-plugins ${KIPIPLUGINS_VERSION_STRING} dependencies results ") MESSAGE(STATUS "") # Require shared libraries results. IF(JPEG_FOUND) MESSAGE(STATUS " libjpeg library found............... YES") ELSE(JPEG_FOUND) MESSAGE(STATUS " libjpeg library found............... NO") MESSAGE(STATUS "") MESSAGE(SEND_ERROR " kipi-plugins needs libjpeg. You need to install the libjpeg development package.") MESSAGE(STATUS " libjpeg website is at http://www.ijg.org") MESSAGE(STATUS "") ENDIF(JPEG_FOUND) IF(TIFF_FOUND) MESSAGE(STATUS " libtiff library found............... YES") ELSE(TIFF_FOUND) MESSAGE(STATUS " libtiff library found............... NO") MESSAGE(STATUS "") MESSAGE(SEND_ERROR " kipi-plugins needs libtiff. You need to install the libtiff development package.") MESSAGE(STATUS " libtiff website is at http://www.remotesensing.org/libtiff") MESSAGE(STATUS "") ENDIF(TIFF_FOUND) IF(PNG_FOUND) MESSAGE(STATUS " libpng library found................ YES") ELSE(PNG_FOUND) MESSAGE(STATUS " libpng library found................ NO") MESSAGE(STATUS "") MESSAGE(SEND_ERROR " kipi-plugins needs libpng. You need to install the correct version (>= 1.2.7).") MESSAGE(STATUS " Libpng website is at http://www.libpng.org/pub/png/libpng.html") MESSAGE(STATUS "") ENDIF(PNG_FOUND) IF(KIPI_FOUND) MESSAGE(STATUS " libkipi library found............... YES") ELSE(KIPI_FOUND) MESSAGE(STATUS " libkipi library found............... NO") MESSAGE(STATUS "") MESSAGE(SEND_ERROR " kipi-plugins needs libkipi library >= 0.2.0. You need to install libkipi first") MESSAGE(STATUS " libkipi website is at http://www.digikam.org/sharedlibs") MESSAGE(STATUS "") ENDIF(KIPI_FOUND) IF(KEXIV2_FOUND) MESSAGE(STATUS " libkexiv2 library found............. YES") ELSE(KEXIV2_FOUND) MESSAGE(STATUS " libkexiv2 library found............. NO") MESSAGE(STATUS "") MESSAGE(SEND_ERROR " kipi-plugins needs libkexiv2 library >= 0.2.0. You need to install libkexiv2 first") MESSAGE(STATUS " libkexiv2 website is at http://www.digikam.org/sharedlibs") MESSAGE(STATUS "") ENDIF(KEXIV2_FOUND) IF(KDCRAW_FOUND) MESSAGE(STATUS " libkdcraw library found............. YES") ELSE(KDCRAW_FOUND) MESSAGE(STATUS " libkdcraw library found............. NO") MESSAGE(STATUS "") MESSAGE(SEND_ERROR " kipi-plugins needs libkdcraw library >= 0.4.0. You need to install libkdcraw first") MESSAGE(STATUS " libkdcraw website is at http://www.digikam.org/sharedlibs") MESSAGE(STATUS "") ENDIF(KDCRAW_FOUND) # Optional plugins results ---------------------------------------------------------------------------- MESSAGE(STATUS "") IF(JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND KDCRAW_FOUND AND KEXIV2_FOUND AND KIPI_FOUND) MESSAGE(STATUS " kipi-plugins will be compiled....... YES") SET(KIPIPLUGINS_CAN_BE_COMPILED true) ELSE(JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND KDCRAW_FOUND AND KEXIV2_FOUND AND KIPI_FOUND) MESSAGE(FATAL_ERROR " kipi-plugins will not be compiled! Look README file for more details about dependencies...") SET(KIPIPLUGINS_CAN_BE_COMPILED false) ENDIF(JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND KDCRAW_FOUND AND KEXIV2_FOUND AND KIPI_FOUND) MESSAGE(STATUS "----------------------------------------------------------------------------------") MESSAGE(STATUS "") # ================================================================================================== IF(KIPIPLUGINS_CAN_BE_COMPILED) # ================================================================================================== # Create svn version header # See http://public.kitware.com/pipermail/cmake/2006-July/010299.html # We only do this IF we are in a .svn dir FIND_FILE(SVN_MARKER entries PATHS ${CMAKE_SOURCE_DIR}/.svn) IF(NOT SVN_MARKER) SET (SVN_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt) # Dummy file ENDIF(NOT SVN_MARKER) # Add a custom command to drive the svn script whenever the svn entries # file changes. CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/svnscript.cmake.in_cmake" "${CMAKE_CURRENT_BINARY_DIR}/svnscript.cmake" @ONLY) ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins/svnversion.h" DEPENDS ${SVN_MARKER} COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/svnscript.cmake") # Add a custom target to drive the custom command. ADD_CUSTOM_TARGET(kipiplugins-svnversion ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins/svnversion.h") # ================================================================================================== INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins ${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins ${KEXIV2_INCLUDE_DIR} ${KDCRAW_INCLUDE_DIR} ${KIPI_INCLUDE_DIR} ${KDE4_INCLUDES} ${QT4_INCLUDES} ) # debug settings SET(AREA_CODE_GENERAL "51000") SET(AREA_CODE_LOADING "51001") ADD_DEFINITIONS(-DKDE_DEFAULT_DEBUG_AREA=${AREA_CODE_GENERAL}) ADD_DEFINITIONS(-DAREA_CODE_GENERAL=${AREA_CODE_GENERAL}) ADD_DEFINITIONS(-DAREA_CODE_LOADING=${AREA_CODE_LOADING}) # Plugins which will be always compiled #ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(piwigoexport) #ADD_SUBDIRECTORY(picasawebexport) IF(NOT WIN32) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/kipi-plugins.lsm.cmake ${CMAKE_CURRENT_BINARY_DIR}/kipi-plugins.lsm) ENDIF(NOT WIN32) ENDIF(KIPIPLUGINS_CAN_BE_COMPILED) include(MacroOptionalAddSubdirectory) macro_optional_add_subdirectory( po )