Warning, /graphics/kipi-plugins/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #
0002 # Copyright (c) 2010-2018 by Gilles Caulier, <caulier dot gilles at gmail dot com>
0003 #
0004 # Redistribution and use is allowed according to the terms of the BSD license.
0005 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0006 #
0007 
0008 cmake_minimum_required(VERSION 3.16.0)
0009 
0010 project(kipi-plugins)
0011 
0012 message(STATUS "----------------------------------------------------------------------------------")
0013 message(STATUS "Starting CMake configuration for: ${PROJECT_NAME}")
0014 
0015 # =======================================================
0016 # Information to update before to release this package.
0017 
0018 # kipi-plugins version
0019 set(KIPIPLUGINS_MAJOR_VERSION "5")
0020 set(KIPIPLUGINS_MINOR_VERSION "9")
0021 set(KIPIPLUGINS_PATCH_VERSION "1")
0022 
0023 # Suffix to add at end of version string. Usual values are:
0024 # "-git"   : alpha code unstable from git. Do not use in production
0025 # "-beta1" : beta1 release.
0026 # "-beta2" : beta2 release.
0027 # "-beta3" : beta3 release.
0028 # "-rc"    : release candidate.
0029 # ""       : final relase. Can be used in production.
0030 set(KIPIPLUGINS_SUFFIX_VERSION "")
0031 
0032 # =======================================================
0033 # Set env. variables accordinly.
0034 
0035 set(KIPIPLUGINS_VERSION_STRING
0036     "${KIPIPLUGINS_MAJOR_VERSION}.${KIPIPLUGINS_MINOR_VERSION}.${KIPIPLUGINS_PATCH_VERSION}${KIPIPLUGINS_SUFFIX_VERSION}"
0037 )
0038 
0039 # NOTE: This string is used to set libkipiplugins SO version ID
0040 set(KIPIPLUGINS_LIB_SO_VERSION_STRING
0041     "${KIPIPLUGINS_MAJOR_VERSION}.${KIPIPLUGINS_MINOR_VERSION}.${KIPIPLUGINS_PATCH_VERSION}"
0042 )
0043 
0044 # =======================================================
0045 
0046 set(K5_MIN_VERSION       "5.85.0")
0047 set(QT_MIN_VERSION       "5.15.0")
0048 set(KIPI_MIN_VERSION     "5.0.0")
0049 set(MEDIAWIKI_MIN_VERSION "5.0.0")
0050 
0051 ############## ECM setup ######################
0052 
0053 find_package(ECM ${K5_MIN_VERSION} CONFIG REQUIRED)
0054 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0055 
0056 # KDE macros
0057 include(KDEInstallDirs)
0058 include(KDECMakeSettings)
0059 include(KDECompilerSettings)
0060 # Cmake macros
0061 include(GenerateExportHeader)
0062 include(CheckFunctionExists)
0063 include(FeatureSummary)
0064 # ECM macros
0065 include(ECMOptionalAddSubdirectory)
0066 include(ECMAddTests)
0067 include(ECMMarkNonGuiExecutable)
0068 include(ECMGenerateHeaders)
0069 include(ECMGeneratePriFile)
0070 include(ECMSetupVersion)
0071 include(ECMInstallIcons)
0072 include(ECMAddAppIcon)
0073 
0074 ##########################################################################
0075 
0076 option(ENABLE_LEGACY "Build Kipi-plugins with legacy plugins support (default=ON)" ON)
0077 
0078 ############## Find Packages ###################
0079 
0080 find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS
0081              Core
0082              Widgets
0083              PrintSupport
0084              Gui
0085              Xml
0086              XmlPatterns
0087              Svg
0088              Concurrent
0089              Network
0090 )
0091 
0092 if(BUILD_TESTING)
0093     find_package(Qt5Test ${QT_MIN_VERSION} REQUIRED NO_MODULE)
0094 endif()
0095 
0096 find_package(KF5 ${K5_MIN_VERSION} REQUIRED COMPONENTS
0097              Config
0098              WindowSystem
0099              XmlGui
0100              I18n
0101 )
0102 
0103 find_package(KF5KIO ${K5_MIN_VERSION})
0104 set_package_properties(KF5IO PROPERTIES PURPOSE "Required to build the RemoteStorage plugin")
0105 
0106 if(KF5KIO_FOUND)
0107     # Some tools rely only on KIO core, others need KIOWidgets too..
0108     get_target_property(KIOWidgets_INCLUDE_DIRS KF5::KIOWidgets INTERFACE_INCLUDE_DIRECTORIES)
0109     message(STATUS "KF5::KIOWidgets include dirs: ${KIOWidgets_INCLUDE_DIRS}")
0110 
0111     if(NOT KIOWidgets_INCLUDE_DIRS)
0112         message(STATUS "KF5::KIOWidgets not available in shared KIO library. Some tools will not be compiled.")
0113         set(KF5KIOWidgets_FOUND FALSE)
0114     else()
0115         set(KF5KIOWidgets_FOUND TRUE)
0116     endif()
0117 endif()
0118 
0119 # Dependencies detection required by all plugins
0120 
0121 find_package(KF5Kipi ${KIPI_MIN_VERSION} REQUIRED)
0122 
0123 get_target_property(KF5Kipi_INCLUDE_DIRS KF5::Kipi INTERFACE_INCLUDE_DIRECTORIES)
0124 
0125 # Detect libkipi so version used to compile kipi tool to identify if plugin can be loaded in memory by libkipi.
0126 # This will be used to populate plugin desktop files.
0127 
0128 foreach(var ${KF5Kipi_INCLUDE_DIRS})
0129     if(EXISTS "${var}/libkipi_config.h")
0130         set(KF5KipiConfig_FOUND "${var}/libkipi_config.h")
0131         message(STATUS "Libkipi config header: ${KF5KipiConfig_FOUND}")
0132         break()
0133     endif()
0134 endforeach()
0135 
0136 if(KF5KipiConfig_FOUND)
0137     file(READ ${KF5KipiConfig_FOUND} KIPI_CONFIG_H_CONTENT)
0138 
0139     string(REGEX REPLACE
0140             ".*static +const +int +kipi_binary_version += ([^ ;]+).*"
0141             "\\1"
0142             KIPI_LIB_SO_CUR_VERSION_FOUND
0143             "${KIPI_CONFIG_H_CONTENT}"
0144     )
0145 
0146     set(KIPI_LIB_SO_CUR_VERSION ${KIPI_LIB_SO_CUR_VERSION_FOUND} CACHE STRING "libkipi so version")
0147 else()
0148     message(FATAL_ERROR "Could not find libkipi SO version")
0149     set(KF5Kipi_FOUND FALSE)
0150 endif()
0151 
0152 message(STATUS "libkipi includes      : ${KF5Kipi_INCLUDE_DIRS}")
0153 message(STATUS "libkipi SO version    : ${KIPI_LIB_SO_CUR_VERSION}")
0154 
0155 # -- Optional dependencies detection required by some plugins -------------------------------------
0156 
0157 find_package(KF5MediaWiki ${MEDIAWIKI_MIN_VERSION})
0158 
0159 # ==================================================================================================
0160 # Create git version header
0161 
0162 # We only do this IF we are in a .git dir
0163 find_file(GIT_MARKER entries PATHS ${CMAKE_SOURCE_DIR}/.git)
0164 
0165 if(NOT GIT_MARKER)
0166     set (GIT_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt)  # Dummy file
0167 endif()
0168 
0169 # Add a custom command to drive the git script whenever the git entries
0170 # file changes.
0171 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/gitscript.cmake.in"
0172                 "${CMAKE_CURRENT_BINARY_DIR}/gitscript.cmake"
0173                 @ONLY)
0174 
0175 # Add a custom target to drive the custom command.
0176 add_custom_target(kipiplugins-gitversion
0177                     ALL COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/gitscript.cmake")
0178 
0179 # ==================================================================================================
0180 
0181 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins
0182                     ${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins
0183                     ${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/dialogs
0184                     ${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/widgets
0185                     ${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/tools
0186                     ${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/o2/src
0187                     ${KF5Kipi_INCLUDE_DIRS}
0188                 )
0189 
0190 # To prevent warnings from M$ compiler
0191 
0192 if(WIN32 AND MSVC)
0193     add_definitions(-D_CRT_SECURE_NO_WARNINGS)
0194     add_definitions(-D_ATL_SECURE_NO_WARNINGS)
0195     add_definitions(-D_AFX_SECURE_NO_WARNINGS)
0196 endif()
0197 
0198 # added with KDE_COMPILERSETTINGS_LEVEL 5.85.0
0199 remove_definitions(
0200     -DQT_NO_KEYWORDS
0201     -DQT_NO_FOREACH
0202 )
0203 
0204 # Remove pedantic GCC flag which generate a lots of warnings on the console with qCDebug()
0205 while(CMAKE_CXX_FLAGS MATCHES "-pedantic")
0206     string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
0207 endwhile()
0208 
0209 # Remove Wdate-time GCC flag which generate a lots of compile warnings
0210 while(CMAKE_CXX_FLAGS MATCHES "-Wdate-time")
0211     string(REPLACE "-Wdate-time" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
0212 endwhile()
0213 
0214 add_subdirectory(common)
0215 add_subdirectory(flickr)
0216 add_subdirectory(dropbox)
0217 add_subdirectory(facebook)
0218 add_subdirectory(imgur)
0219 add_subdirectory(piwigo)
0220 add_subdirectory(rajce)
0221 add_subdirectory(smug)
0222 add_subdirectory(imageshack)
0223 add_subdirectory(yandexfotki)
0224 add_subdirectory(googleservices)
0225 
0226 if(ENABLE_LEGACY)
0227     add_subdirectory(printimages)
0228     add_subdirectory(kmlexport)
0229     add_subdirectory(sendimages)
0230     add_subdirectory(jalbum)
0231 endif()
0232 
0233 if(KF5MediaWiki_FOUND)
0234     add_subdirectory(mediawiki)
0235 endif()
0236 
0237 if(KF5KIO_FOUND AND KF5KIOWidgets_FOUND)
0238     add_subdirectory(remotestorage)    # kioimportwindow.cpp, kioexportwindow.cpp
0239 endif()
0240 
0241 install(FILES org.kde.kipi_plugins.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0242 
0243 ki18n_install(po)
0244 
0245 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)