Warning, /graphics/digikam/project/bundles/3rdparty/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # Rules to build 3rd-party libraries for digiKam bundles.
0002 #
0003 # SPDX-FileCopyrightText: 2015-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0004 #
0005 # SPDX-License-Identifier: BSD-3-Clause
0006 #
0007
0008 # Lower minimal version of cmake required by Ubuntu 18.04.
0009 cmake_minimum_required(VERSION 3.3.2)
0010
0011 project(digikam-bundles)
0012
0013 if(POLICY CMP0135)
0014
0015 cmake_policy(SET CMP0135 OLD)
0016
0017 endif()
0018
0019 function(JoinListAsString VALUES GLUE OUTPUT)
0020 string(REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
0021 set(${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
0022 endfunction()
0023
0024 if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
0025 message(FATAL_ERROR "Compiling in the source directory is not supported. Use for example 'mkdir build; cd build; cmake ..'.")
0026 endif()
0027
0028 # Tools must be obtained to work with:
0029 include (ExternalProject)
0030
0031 # allow specification of a directory with pre-downloaded
0032 # requirements
0033 if(NOT IS_DIRECTORY ${EXTERNALS_DOWNLOAD_DIR})
0034 message(FATAL_ERROR "No externals download dir set. Use -DEXTERNALS_DOWNLOAD_DIR")
0035 endif()
0036
0037 if(NOT IS_DIRECTORY ${INSTALL_ROOT})
0038 message(FATAL_ERROR "No install dir set. Use -DINSTALL_ROOT")
0039 endif()
0040
0041 set(TOP_INST_DIR ${INSTALL_ROOT})
0042 set(EXTPREFIX "${TOP_INST_DIR}")
0043 set(CMAKE_PREFIX_PATH "${EXTPREFIX}")
0044
0045 message(STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}")
0046 message(STATUS "CMAKE_CL_64: ${CMAKE_CL_64}")
0047
0048 set(GLOBAL_BUILD_TYPE RelWithDebInfo)
0049 set(GLOBAL_PROFILE ${GLOBAL_PROFILE} -DBUILD_TESTING=false)
0050 set(PATCH_COMMAND patch)
0051
0052 # Function to get MD5 sums from download area for a KF5 application
0053 # The sum is available in ${KF5_APPLICATION_MD5SUM}
0054 function(GetKF5ApplicationMd5Sums
0055 name
0056 version)
0057
0058 if(MINGW)
0059
0060 # Extract MD5 sums of KF5 application directly from server.
0061 execute_process(COMMAND
0062 wget -q -O - -o /dev/null https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz.md5
0063 COMMAND
0064 grep "tar.xz"
0065 COMMAND
0066 cut -d " " -f1
0067 RESULT_VARIABLE
0068 wgetresult
0069 OUTPUT_VARIABLE
0070 md5sm
0071 OUTPUT_STRIP_TRAILING_WHITESPACE
0072 )
0073
0074 elseif(APPLE)
0075
0076 # Extract MD5 sums of KF5 application directly from server.
0077 execute_process(COMMAND
0078 wget -q -O - -o /dev/null https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz.md5
0079 COMMAND
0080 grep "tar.xz"
0081 COMMAND
0082 cut -d " " -f1
0083 RESULT_VARIABLE
0084 wgetresult
0085 OUTPUT_VARIABLE
0086 md5sm
0087 OUTPUT_STRIP_TRAILING_WHITESPACE
0088 )
0089
0090 else() # Linux
0091
0092 # Extract MD5 sums of KF5 application directly from server.
0093 execute_process(COMMAND
0094 wget -q -O - -o /dev/null https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz.md5
0095 COMMAND
0096 grep "tar.xz"
0097 COMMAND
0098 cut -d " " -f1
0099 RESULT_VARIABLE
0100 wgetresult
0101 OUTPUT_VARIABLE
0102 md5sm
0103 OUTPUT_STRIP_TRAILING_WHITESPACE
0104 )
0105
0106 endif()
0107
0108 message(STATUS "--------------------------------")
0109 message(STATUS "KDE application : ${name}")
0110 message(STATUS "application version: ${version}")
0111 message(STATUS "application MD5 : ${md5sm}")
0112
0113 set(${KF5_APPLICATION_MD5SUM} ${md5sm} PARENT_SCOPE)
0114
0115 endfunction()
0116
0117 # Function to get MD5 sums from download area for a Plasma component
0118 # The sum is available in ${KF5_PLASMA_MD5SUM}
0119 function(GetKF5PlasmaMd5Sums
0120 name
0121 version)
0122
0123 if(MINGW)
0124
0125 # Extract MD5 sums of KF5 Plasma component directly from server.
0126 execute_process(COMMAND
0127 wget -q -O - -o /dev/null https://download.kde.org/stable/plasma/${version}/${name}-${version}.tar.xz.md5
0128 COMMAND
0129 grep "tar.xz"
0130 COMMAND
0131 cut -d " " -f1
0132 RESULT_VARIABLE
0133 wgetresult
0134 OUTPUT_VARIABLE
0135 md5sm
0136 OUTPUT_STRIP_TRAILING_WHITESPACE
0137 )
0138
0139 elseif(APPLE)
0140
0141 # Extract MD5 sums of KF5 Plasma component directly from server.
0142 execute_process(COMMAND
0143 wget -q -O - -o /dev/null https://download.kde.org/stable/plasma/${version}/${name}-${version}.tar.xz.md5
0144 COMMAND
0145 grep "tar.xz"
0146 COMMAND
0147 cut -d " " -f1
0148 RESULT_VARIABLE
0149 wgetresult
0150 OUTPUT_VARIABLE
0151 md5sm
0152 OUTPUT_STRIP_TRAILING_WHITESPACE
0153 )
0154
0155 else() # Linux
0156
0157 # Extract MD5 sums of KF5 Plasma component directly from server.
0158 execute_process(COMMAND
0159 wget -q -O - -o /dev/null https://download.kde.org/stable/plasma/${version}/${name}-${version}.tar.xz.md5
0160 COMMAND
0161 grep "tar.xz"
0162 COMMAND
0163 cut -d " " -f1
0164 RESULT_VARIABLE
0165 wgetresult
0166 OUTPUT_VARIABLE
0167 md5sm
0168 OUTPUT_STRIP_TRAILING_WHITESPACE
0169 )
0170
0171 endif()
0172
0173 message(STATUS "--------------------------------")
0174 message(STATUS "KDE Plasma component: ${name}")
0175 message(STATUS "component version : ${version}")
0176 message(STATUS "component MD5 : ${md5sm}")
0177
0178 set(${KF5_PLASMA_MD5SUM} ${md5sm} PARENT_SCOPE)
0179
0180 endfunction()
0181
0182 # this list must be dependency-ordered
0183
0184 add_subdirectory(ext_cmake)
0185 add_subdirectory(ext_jpeg)
0186 add_subdirectory(ext_jasper)
0187 add_subdirectory(ext_png)
0188 add_subdirectory(ext_tiff)
0189 add_subdirectory(ext_heif)
0190 add_subdirectory(ext_libgphoto2)
0191 add_subdirectory(ext_libde265)
0192 add_subdirectory(ext_libaom)
0193 add_subdirectory(ext_libavif)
0194 add_subdirectory(ext_libicu)
0195 add_subdirectory(ext_liblqr)
0196 add_subdirectory(ext_libjxl)
0197 add_subdirectory(ext_sane)
0198 add_subdirectory(ext_exiv2)
0199 add_subdirectory(ext_boost)
0200 add_subdirectory(ext_opencv)
0201 add_subdirectory(ext_openssl)
0202 add_subdirectory(ext_lensfun)
0203 add_subdirectory(ext_qt${ENABLE_QTVERSION})
0204 add_subdirectory(ext_qtwebkit)
0205 add_subdirectory(ext_fcitx-qt)
0206 add_subdirectory(ext_ffmpeg)
0207 add_subdirectory(ext_drmingw)
0208 add_subdirectory(ext_imagemagick)
0209 add_subdirectory(ext_uchardet)
0210
0211 add_subdirectory(ext_kf${ENABLE_QTVERSION})
0212 add_subdirectory(ext_mosaicwall)
0213 add_subdirectory(ext_flowview)
0214 add_subdirectory(ext_gmicqt)
0215
0216 if (${ENABLE_QTVERSION} MATCHES "5")
0217
0218 # included in KF6 target.
0219 add_subdirectory(ext_plasma-wayland-protocols)
0220 add_subdirectory(ext_libksane)
0221 add_subdirectory(ext_breeze)
0222 add_subdirectory(ext_marble)
0223
0224 endif()