[4770] | 1 | PROJECT(kipi-plugins) |
---|
| 2 | |
---|
| 3 | # ======================================================= |
---|
| 4 | # Information to update before to release this package. |
---|
| 5 | |
---|
| 6 | # kipi-plugins version |
---|
| 7 | #SET(KIPIPLUGINS_MAJOR_VERSION "1") |
---|
| 8 | #SET(KIPIPLUGINS_MINOR_VERSION "0") |
---|
| 9 | #SET(KIPIPLUGINS_PATCH_VERSION "0") |
---|
| 10 | |
---|
| 11 | # kipi-plugins release date |
---|
| 12 | #SET (KIPIPLUGINS_RELEASE_DATE "2009-12-21") |
---|
| 13 | |
---|
| 14 | # Suffix to add at end of version string. Usual values are: |
---|
| 15 | # "-svn" : alpha code unstable from svn. Do not use in production |
---|
| 16 | # "-beta1" : beta1 release. |
---|
| 17 | # "-beta2" : beta2 release. |
---|
| 18 | # "-beta3" : beta3 release. |
---|
| 19 | # "-rc" : release candidate. |
---|
| 20 | # "" : final relase. Can be used in production. |
---|
| 21 | #SET(KIPIPLUGINS_SUFFIX_VERSION "") |
---|
| 22 | |
---|
| 23 | # ======================================================= |
---|
| 24 | # Set env. variables accordinly. |
---|
| 25 | |
---|
| 26 | SET(KIPIPLUGINS_VERSION_STRING |
---|
| 27 | "0.0.1-piwigo" |
---|
| 28 | ) |
---|
| 29 | |
---|
| 30 | # ======================================================= |
---|
| 31 | |
---|
| 32 | FIND_PACKAGE(KDE4 REQUIRED) |
---|
| 33 | |
---|
| 34 | INCLUDE(MacroOptionalFindPackage) |
---|
| 35 | INCLUDE(FindPackageHandleStandardArgs) |
---|
| 36 | INCLUDE(KDE4Defaults) |
---|
| 37 | INCLUDE(MacroLibrary) |
---|
| 38 | |
---|
| 39 | # Depencies detection required by all plugins |
---|
| 40 | FIND_PACKAGE(Kexiv2 REQUIRED) |
---|
| 41 | FIND_PACKAGE(Kdcraw REQUIRED) |
---|
| 42 | FIND_PACKAGE(Kipi REQUIRED) |
---|
| 43 | FIND_PACKAGE(JPEG REQUIRED) |
---|
| 44 | FIND_PACKAGE(PNG REQUIRED) |
---|
| 45 | FIND_PACKAGE(TIFF REQUIRED) |
---|
| 46 | |
---|
| 47 | # Optional depencies detection required by some plugins |
---|
| 48 | |
---|
| 49 | SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) |
---|
| 50 | |
---|
| 51 | #MACRO_OPTIONAL_FIND_PACKAGE(EXPAT) # For DNGConverter: XMP SDK need Expat library to compile. |
---|
| 52 | #MACRO_OPTIONAL_FIND_PACKAGE(Threads) # For DNGConverter: DNG SDK need native threads support. |
---|
| 53 | #MACRO_OPTIONAL_FIND_PACKAGE(LibXml2) # For Htmlexport. |
---|
| 54 | #MACRO_OPTIONAL_FIND_PACKAGE(LibXslt) # For Htmlexport. |
---|
| 55 | #MACRO_OPTIONAL_FIND_PACKAGE(OpenGL) # For AdvancedSlideshow and ImageViewer. |
---|
| 56 | #MACRO_OPTIONAL_FIND_PACKAGE(OpenCV) # For RemoveRedEyes. |
---|
| 57 | #MACRO_OPTIONAL_FIND_PACKAGE(Gpod) # For ipodexport. |
---|
| 58 | #MACRO_OPTIONAL_FIND_PACKAGE(Gdk) # For ipodexport. |
---|
| 59 | #MACRO_OPTIONAL_FIND_PACKAGE(GLIB2) # For ipodexport. |
---|
| 60 | #MACRO_OPTIONAL_FIND_PACKAGE(GObject) # For ipodexport. |
---|
| 61 | #MACRO_OPTIONAL_FIND_PACKAGE(KdepimLibs) # For Calendar (libkcal). |
---|
| 62 | #MACRO_OPTIONAL_FIND_PACKAGE(QCA2) # For Shwup. |
---|
| 63 | #MACRO_OPTIONAL_FIND_PACKAGE(KSane) # For AcquireImages. |
---|
| 64 | |
---|
| 65 | IF(NOT WIN32) |
---|
| 66 | # Check KDcraw version installed to compile fine DngConverter plugin. |
---|
| 67 | FIND_PACKAGE(PkgConfig) |
---|
| 68 | PKG_CHECK_MODULES(Kdcraw libkdcraw>=0.4.0) |
---|
| 69 | IF(Kdcraw_FOUND) |
---|
| 70 | SET(KDCRAW_FOR_DNGCONVERTER TRUE) |
---|
| 71 | ELSE(Kdcraw_FOUND) |
---|
| 72 | SET(KDCRAW_FOR_DNGCONVERTER FALSE) |
---|
| 73 | ENDIF(Kdcraw_FOUND) |
---|
| 74 | ELSE(NOT WIN32) |
---|
| 75 | SET(KDCRAW_FOR_DNGCONVERTER TRUE) |
---|
| 76 | ENDIF(NOT WIN32) |
---|
| 77 | |
---|
| 78 | INCLUDE(MacroOptionalDependPackage) |
---|
| 79 | |
---|
| 80 | # ================================================================================================== |
---|
| 81 | # Log messages |
---|
| 82 | |
---|
| 83 | MESSAGE(STATUS "") |
---|
| 84 | MESSAGE(STATUS "----------------------------------------------------------------------------------") |
---|
| 85 | MESSAGE(STATUS " kipi-plugins ${KIPIPLUGINS_VERSION_STRING} dependencies results <http://www.kipi-plugins.org>") |
---|
| 86 | MESSAGE(STATUS "") |
---|
| 87 | |
---|
| 88 | # Require shared libraries results. |
---|
| 89 | |
---|
| 90 | IF(JPEG_FOUND) |
---|
| 91 | MESSAGE(STATUS " libjpeg library found............... YES") |
---|
| 92 | ELSE(JPEG_FOUND) |
---|
| 93 | MESSAGE(STATUS " libjpeg library found............... NO") |
---|
| 94 | MESSAGE(STATUS "") |
---|
| 95 | MESSAGE(SEND_ERROR " kipi-plugins needs libjpeg. You need to install the libjpeg development package.") |
---|
| 96 | MESSAGE(STATUS " libjpeg website is at http://www.ijg.org") |
---|
| 97 | MESSAGE(STATUS "") |
---|
| 98 | ENDIF(JPEG_FOUND) |
---|
| 99 | |
---|
| 100 | IF(TIFF_FOUND) |
---|
| 101 | MESSAGE(STATUS " libtiff library found............... YES") |
---|
| 102 | ELSE(TIFF_FOUND) |
---|
| 103 | MESSAGE(STATUS " libtiff library found............... NO") |
---|
| 104 | MESSAGE(STATUS "") |
---|
| 105 | MESSAGE(SEND_ERROR " kipi-plugins needs libtiff. You need to install the libtiff development package.") |
---|
| 106 | MESSAGE(STATUS " libtiff website is at http://www.remotesensing.org/libtiff") |
---|
| 107 | MESSAGE(STATUS "") |
---|
| 108 | ENDIF(TIFF_FOUND) |
---|
| 109 | |
---|
| 110 | IF(PNG_FOUND) |
---|
| 111 | MESSAGE(STATUS " libpng library found................ YES") |
---|
| 112 | ELSE(PNG_FOUND) |
---|
| 113 | MESSAGE(STATUS " libpng library found................ NO") |
---|
| 114 | MESSAGE(STATUS "") |
---|
| 115 | MESSAGE(SEND_ERROR " kipi-plugins needs libpng. You need to install the correct version (>= 1.2.7).") |
---|
| 116 | MESSAGE(STATUS " Libpng website is at http://www.libpng.org/pub/png/libpng.html") |
---|
| 117 | MESSAGE(STATUS "") |
---|
| 118 | ENDIF(PNG_FOUND) |
---|
| 119 | |
---|
| 120 | IF(KIPI_FOUND) |
---|
| 121 | MESSAGE(STATUS " libkipi library found............... YES") |
---|
| 122 | ELSE(KIPI_FOUND) |
---|
| 123 | MESSAGE(STATUS " libkipi library found............... NO") |
---|
| 124 | MESSAGE(STATUS "") |
---|
| 125 | MESSAGE(SEND_ERROR " kipi-plugins needs libkipi library >= 0.2.0. You need to install libkipi first") |
---|
| 126 | MESSAGE(STATUS " libkipi website is at http://www.digikam.org/sharedlibs") |
---|
| 127 | MESSAGE(STATUS "") |
---|
| 128 | ENDIF(KIPI_FOUND) |
---|
| 129 | |
---|
| 130 | IF(KEXIV2_FOUND) |
---|
| 131 | MESSAGE(STATUS " libkexiv2 library found............. YES") |
---|
| 132 | ELSE(KEXIV2_FOUND) |
---|
| 133 | MESSAGE(STATUS " libkexiv2 library found............. NO") |
---|
| 134 | MESSAGE(STATUS "") |
---|
| 135 | MESSAGE(SEND_ERROR " kipi-plugins needs libkexiv2 library >= 0.2.0. You need to install libkexiv2 first") |
---|
| 136 | MESSAGE(STATUS " libkexiv2 website is at http://www.digikam.org/sharedlibs") |
---|
| 137 | MESSAGE(STATUS "") |
---|
| 138 | ENDIF(KEXIV2_FOUND) |
---|
| 139 | |
---|
| 140 | IF(KDCRAW_FOUND) |
---|
| 141 | MESSAGE(STATUS " libkdcraw library found............. YES") |
---|
| 142 | ELSE(KDCRAW_FOUND) |
---|
| 143 | MESSAGE(STATUS " libkdcraw library found............. NO") |
---|
| 144 | MESSAGE(STATUS "") |
---|
| 145 | MESSAGE(SEND_ERROR " kipi-plugins needs libkdcraw library >= 0.4.0. You need to install libkdcraw first") |
---|
| 146 | MESSAGE(STATUS " libkdcraw website is at http://www.digikam.org/sharedlibs") |
---|
| 147 | MESSAGE(STATUS "") |
---|
| 148 | ENDIF(KDCRAW_FOUND) |
---|
| 149 | |
---|
| 150 | # Optional plugins results ---------------------------------------------------------------------------- |
---|
| 151 | |
---|
| 152 | MESSAGE(STATUS "") |
---|
| 153 | |
---|
| 154 | IF(JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND KDCRAW_FOUND AND KEXIV2_FOUND AND KIPI_FOUND) |
---|
| 155 | MESSAGE(STATUS " kipi-plugins will be compiled....... YES") |
---|
| 156 | SET(KIPIPLUGINS_CAN_BE_COMPILED true) |
---|
| 157 | ELSE(JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND KDCRAW_FOUND AND KEXIV2_FOUND AND KIPI_FOUND) |
---|
| 158 | MESSAGE(FATAL_ERROR " kipi-plugins will not be compiled! Look README file for more details about dependencies...") |
---|
| 159 | SET(KIPIPLUGINS_CAN_BE_COMPILED false) |
---|
| 160 | ENDIF(JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND KDCRAW_FOUND AND KEXIV2_FOUND AND KIPI_FOUND) |
---|
| 161 | |
---|
| 162 | MESSAGE(STATUS "----------------------------------------------------------------------------------") |
---|
| 163 | MESSAGE(STATUS "") |
---|
| 164 | |
---|
| 165 | # ================================================================================================== |
---|
| 166 | |
---|
| 167 | IF(KIPIPLUGINS_CAN_BE_COMPILED) |
---|
| 168 | |
---|
| 169 | # ================================================================================================== |
---|
| 170 | # Create svn version header |
---|
| 171 | |
---|
| 172 | # See http://public.kitware.com/pipermail/cmake/2006-July/010299.html |
---|
| 173 | # We only do this IF we are in a .svn dir |
---|
| 174 | |
---|
| 175 | FIND_FILE(SVN_MARKER entries PATHS ${CMAKE_SOURCE_DIR}/.svn) |
---|
| 176 | |
---|
| 177 | IF(NOT SVN_MARKER) |
---|
| 178 | SET (SVN_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt) # Dummy file |
---|
| 179 | ENDIF(NOT SVN_MARKER) |
---|
| 180 | |
---|
| 181 | # Add a custom command to drive the svn script whenever the svn entries |
---|
| 182 | # file changes. |
---|
| 183 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/svnscript.cmake.in_cmake" |
---|
| 184 | "${CMAKE_CURRENT_BINARY_DIR}/svnscript.cmake" |
---|
| 185 | @ONLY) |
---|
| 186 | |
---|
| 187 | ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins/svnversion.h" |
---|
| 188 | DEPENDS ${SVN_MARKER} |
---|
| 189 | COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/svnscript.cmake") |
---|
| 190 | |
---|
| 191 | # Add a custom target to drive the custom command. |
---|
| 192 | ADD_CUSTOM_TARGET(kipiplugins-svnversion |
---|
| 193 | ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins/svnversion.h") |
---|
| 194 | |
---|
| 195 | # ================================================================================================== |
---|
| 196 | |
---|
| 197 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins |
---|
| 198 | ${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins |
---|
| 199 | ${KEXIV2_INCLUDE_DIR} |
---|
| 200 | ${KDCRAW_INCLUDE_DIR} |
---|
| 201 | ${KIPI_INCLUDE_DIR} |
---|
| 202 | ${KDE4_INCLUDES} |
---|
| 203 | ${QT4_INCLUDES} |
---|
| 204 | ) |
---|
| 205 | |
---|
| 206 | # debug settings |
---|
| 207 | SET(AREA_CODE_GENERAL "51000") |
---|
| 208 | SET(AREA_CODE_LOADING "51001") |
---|
| 209 | ADD_DEFINITIONS(-DKDE_DEFAULT_DEBUG_AREA=${AREA_CODE_GENERAL}) |
---|
| 210 | ADD_DEFINITIONS(-DAREA_CODE_GENERAL=${AREA_CODE_GENERAL}) |
---|
| 211 | ADD_DEFINITIONS(-DAREA_CODE_LOADING=${AREA_CODE_LOADING}) |
---|
| 212 | |
---|
| 213 | # Plugins which will be always compiled |
---|
| 214 | |
---|
| 215 | #ADD_SUBDIRECTORY(common) |
---|
| 216 | ADD_SUBDIRECTORY(piwigoexport) |
---|
| 217 | #ADD_SUBDIRECTORY(picasawebexport) |
---|
| 218 | |
---|
| 219 | IF(NOT WIN32) |
---|
| 220 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/kipi-plugins.lsm.cmake ${CMAKE_CURRENT_BINARY_DIR}/kipi-plugins.lsm) |
---|
| 221 | ENDIF(NOT WIN32) |
---|
| 222 | |
---|
| 223 | ENDIF(KIPIPLUGINS_CAN_BE_COMPILED) |
---|
| 224 | include(MacroOptionalAddSubdirectory) |
---|
| 225 | macro_optional_add_subdirectory( po ) |
---|