| 1 |
# Rules to build 3rd-party libraries for digiKam bundles. |
| 2 |
# |
| 3 |
# SPDX-FileCopyrightText: 2015-2026 by Gilles Caulier <caulier dot gilles at gmail dot com> |
| 4 |
# |
| 5 |
# SPDX-License-Identifier: BSD-3-Clause |
| 6 |
# |
| 7 |
|
| 8 |
# Lower minimal version of cmake required by Ubuntu 20.04. |
| 9 |
cmake_minimum_required(VERSION 3.6) |
| 10 |
|
| 11 |
project(digikam-bundles) |
| 12 |
|
| 13 |
if(POLICY CMP0135) |
| 14 |
|
| 15 |
cmake_policy(SET CMP0135 OLD) |
| 16 |
|
| 17 |
endif() |
| 18 |
|
| 19 |
function(JoinListAsString VALUES GLUE OUTPUT) |
| 20 |
string(REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}") |
| 21 |
set(${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) |
| 22 |
endfunction() |
| 23 |
|
| 24 |
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |
| 25 |
message(FATAL_ERROR "Compiling in the source directory is not supported. Use for example 'mkdir build; cd build; cmake ..'.") |
| 26 |
endif() |
| 27 |
|
| 28 |
# Tools must be obtained to work with: |
| 29 |
include (ExternalProject) |
| 30 |
|
| 31 |
# allow specification of a directory with pre-downloaded |
| 32 |
# requirements |
| 33 |
if(NOT IS_DIRECTORY ${EXTERNALS_DOWNLOAD_DIR}) |
| 34 |
message(FATAL_ERROR "No externals download dir set. Use -DEXTERNALS_DOWNLOAD_DIR") |
| 35 |
endif() |
| 36 |
|
| 37 |
if(NOT IS_DIRECTORY ${INSTALL_ROOT}) |
| 38 |
message(FATAL_ERROR "No install dir set. Use -DINSTALL_ROOT") |
| 39 |
endif() |
| 40 |
|
| 41 |
set(TOP_INST_DIR ${INSTALL_ROOT}) |
| 42 |
set(EXTPREFIX "${TOP_INST_DIR}") |
| 43 |
set(CMAKE_PREFIX_PATH "${EXTPREFIX}") |
| 44 |
|
| 45 |
message(STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}") |
| 46 |
message(STATUS "CMAKE_CL_64: ${CMAKE_CL_64}") |
| 47 |
|
| 48 |
set(GLOBAL_BUILD_TYPE RelWithDebInfo) |
| 49 |
set(GLOBAL_PROFILE ${GLOBAL_PROFILE} -DBUILD_TESTING=false) |
| 50 |
set(PATCH_COMMAND patch) |
| 51 |
|
| 52 |
# Function to get MD5 sums from download area for a KF5 application |
| 53 |
# The sum is available in ${KF5_APPLICATION_MD5SUM} |
| 54 |
function(GetKF5ApplicationMd5Sums |
| 55 |
name |
| 56 |
version) |
| 57 |
|
| 58 |
if(APPLE) |
| 59 |
|
| 60 |
# Extract MD5 sums of KF5 application directly from server. |
| 61 |
execute_process(COMMAND |
| 62 |
wget -q -O - -o /dev/null https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz.md5 |
| 63 |
COMMAND |
| 64 |
grep "tar.xz" |
| 65 |
COMMAND |
| 66 |
cut -d " " -f1 |
| 67 |
RESULT_VARIABLE |
| 68 |
wgetresult |
| 69 |
OUTPUT_VARIABLE |
| 70 |
md5sm |
| 71 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
| 72 |
) |
| 73 |
|
| 74 |
else() # Linux and Windows |
| 75 |
|
| 76 |
# Extract MD5 sums of KF5 application directly from server. |
| 77 |
execute_process(COMMAND |
| 78 |
wget -q -O - -o /dev/null https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz.md5 |
| 79 |
COMMAND |
| 80 |
grep "tar.xz" |
| 81 |
COMMAND |
| 82 |
cut -d " " -f1 |
| 83 |
RESULT_VARIABLE |
| 84 |
wgetresult |
| 85 |
OUTPUT_VARIABLE |
| 86 |
md5sm |
| 87 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
| 88 |
) |
| 89 |
|
| 90 |
endif() |
| 91 |
|
| 92 |
message(STATUS "--------------------------------") |
| 93 |
message(STATUS "KDE application : ${name}") |
| 94 |
message(STATUS "application version: ${version}") |
| 95 |
message(STATUS "application MD5 : ${md5sm}") |
| 96 |
|
| 97 |
set(${KF5_APPLICATION_MD5SUM} ${md5sm} PARENT_SCOPE) |
| 98 |
|
| 99 |
endfunction() |
| 100 |
|
| 101 |
# Function to get MD5 sums from download area for a Plasma component |
| 102 |
# The sum is available in ${KF5_PLASMA_MD5SUM} |
| 103 |
function(GetKF5PlasmaMd5Sums |
| 104 |
name |
| 105 |
version) |
| 106 |
|
| 107 |
if(APPLE) |
| 108 |
|
| 109 |
# Extract MD5 sums of KF5 Plasma component directly from server. |
| 110 |
execute_process(COMMAND |
| 111 |
wget -q -O - -o /dev/null https://download.kde.org/stable/plasma/${version}/${name}-${version}.tar.xz.md5 |
| 112 |
COMMAND |
| 113 |
grep "tar.xz" |
| 114 |
COMMAND |
| 115 |
cut -d " " -f1 |
| 116 |
RESULT_VARIABLE |
| 117 |
wgetresult |
| 118 |
OUTPUT_VARIABLE |
| 119 |
md5sm |
| 120 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
| 121 |
) |
| 122 |
|
| 123 |
else() # Linux |
| 124 |
|
| 125 |
# Extract MD5 sums of KF5 Plasma component directly from server. |
| 126 |
execute_process(COMMAND |
| 127 |
wget -q -O - -o /dev/null https://download.kde.org/stable/plasma/${version}/${name}-${version}.tar.xz.md5 |
| 128 |
COMMAND |
| 129 |
grep "tar.xz" |
| 130 |
COMMAND |
| 131 |
cut -d " " -f1 |
| 132 |
RESULT_VARIABLE |
| 133 |
wgetresult |
| 134 |
OUTPUT_VARIABLE |
| 135 |
md5sm |
| 136 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
| 137 |
) |
| 138 |
|
| 139 |
endif() |
| 140 |
|
| 141 |
message(STATUS "--------------------------------") |
| 142 |
message(STATUS "KDE Plasma component: ${name}") |
| 143 |
message(STATUS "component version : ${version}") |
| 144 |
message(STATUS "component MD5 : ${md5sm}") |
| 145 |
|
| 146 |
set(${KF5_PLASMA_MD5SUM} ${md5sm} PARENT_SCOPE) |
| 147 |
|
| 148 |
endfunction() |
| 149 |
|
| 150 |
# this list must be dependency-ordered |
| 151 |
|
| 152 |
add_subdirectory(ext_cmake) |
| 153 |
add_subdirectory(ext_jpeg) |
| 154 |
add_subdirectory(ext_jasper) |
| 155 |
add_subdirectory(ext_png) |
| 156 |
add_subdirectory(ext_tiff) |
| 157 |
add_subdirectory(ext_heif) |
| 158 |
add_subdirectory(ext_libgphoto2) |
| 159 |
add_subdirectory(ext_libde265) |
| 160 |
add_subdirectory(ext_libaom) |
| 161 |
add_subdirectory(ext_libavif) |
| 162 |
add_subdirectory(ext_libicu) |
| 163 |
add_subdirectory(ext_libjxl) |
| 164 |
add_subdirectory(ext_sane) |
| 165 |
add_subdirectory(ext_exiv2) |
| 166 |
add_subdirectory(ext_boost) |
| 167 |
add_subdirectory(ext_opencv) |
| 168 |
add_subdirectory(ext_openssl) |
| 169 |
add_subdirectory(ext_lensfun) |
| 170 |
add_subdirectory(ext_qt${ENABLE_QTVERSION}) |
| 171 |
add_subdirectory(ext_fcitx-qt) |
| 172 |
add_subdirectory(ext_ffmpeg) |
| 173 |
add_subdirectory(ext_imagemagick) |
| 174 |
|
| 175 |
add_subdirectory(ext_kf${ENABLE_QTVERSION}) |
| 176 |
add_subdirectory(ext_mosaicwall) |
| 177 |
add_subdirectory(ext_flowview) |
| 178 |
add_subdirectory(ext_gmicqt) |
| 179 |
|
| 180 |
if (${ENABLE_QTVERSION} MATCHES "5") |
| 181 |
|
| 182 |
# included in KF6 target. |
| 183 |
add_subdirectory(ext_plasma-wayland-protocols) |
| 184 |
add_subdirectory(ext_libksane) |
| 185 |
add_subdirectory(ext_breeze) |
| 186 |
|
| 187 |
endif() |