Warning, /graphics/digikam/project/bundles/3rdparty/ext_kf5/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # Script to build KDE Frameworks for digiKam bundle.
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 set(EXTPREFIX_frameworks "${EXTPREFIX}")
0009
0010 function(InstallKDEComponent
0011 name
0012 version
0013 argoptions
0014 patch)
0015
0016 if(MINGW)
0017
0018 # Extract MD5 sums of each KDE components directly from server.
0019 execute_process(COMMAND
0020 wget -q -O - -o /dev/null https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz.md5
0021 COMMAND
0022 grep "tar.xz"
0023 COMMAND
0024 cut -d " " -f1
0025 RESULT_VARIABLE
0026 wgetresult
0027 OUTPUT_VARIABLE
0028 md5sm
0029 OUTPUT_STRIP_TRAILING_WHITESPACE
0030 )
0031
0032 message(STATUS "--------------------------------")
0033 message(STATUS "KDE component : ${name}")
0034 message(STATUS "Component version: ${version}")
0035 message(STATUS "Component MD5 : ${md5sm}")
0036 message(STATUS "Configure options: ${argoptions}")
0037 message(STATUS "Patch to apply : ${patch}")
0038
0039 if(NOT "${patch}" STREQUAL "")
0040 set(patch "${PATCH_COMMAND};-p1;-i;${CMAKE_CURRENT_SOURCE_DIR}/${patch}")
0041 endif()
0042
0043 ExternalProject_Add(ext_${name}
0044 DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0045 URL https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz
0046 URL_MD5 ${md5sm}
0047
0048 INSTALL_DIR ${EXTPREFIX_frameworks}
0049
0050 CMAKE_ARGS -DMXE_TOOLCHAIN=${MXE_TOOLCHAIN}
0051 -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
0052 -DCMAKE_COLOR_MAKEFILE=ON
0053 -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
0054 -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
0055 -DCMAKE_TOOLCHAIN_FILE=${MXE_TOOLCHAIN}
0056 -DCMAKE_FIND_PREFIX_PATH=${CMAKE_PREFIX_PATH}
0057 -DCMAKE_SYSTEM_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include
0058 -DCMAKE_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include
0059 -DCMAKE_LIBRARY_PATH=${CMAKE_PREFIX_PATH}/lib
0060 -DBUILD_TESTING=OFF
0061 -DZLIB_ROOT=${CMAKE_PREFIX_PATH}
0062 -DINSTALL_ROOT=${MXE_INSTALL_PREFIX}
0063 ${GLOBAL_PROFILE}
0064 "${argoptions}"
0065 -Wno-dev
0066
0067 PATCH_COMMAND ${patch}
0068 UPDATE_COMMAND ""
0069 ALWAYS 0
0070 )
0071
0072 elseif(APPLE)
0073
0074 # Extract MD5 sums of each KDE components directly from server.
0075 execute_process(COMMAND
0076 wget -q -O - -o /dev/null https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz.md5
0077 COMMAND
0078 grep "tar.xz"
0079 COMMAND
0080 cut -d " " -f1
0081 RESULT_VARIABLE
0082 wgetresult
0083 OUTPUT_VARIABLE
0084 md5sm
0085 OUTPUT_STRIP_TRAILING_WHITESPACE
0086 )
0087
0088 message(STATUS "--------------------------------")
0089 message(STATUS "KDE component : ${name}")
0090 message(STATUS "Component version: ${version}")
0091 message(STATUS "Component MD5 : ${md5sm}")
0092 message(STATUS "Configure options: ${argoptions}")
0093 message(STATUS "Patch to apply : ${patch}")
0094
0095 if(NOT "${patch}" STREQUAL "")
0096 set(patch "${PATCH_COMMAND};-p1;-i;${CMAKE_CURRENT_SOURCE_DIR}/${patch};&&")
0097 endif()
0098
0099 ExternalProject_Add(ext_${name}
0100 DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0101 URL https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz
0102 URL_MD5 ${md5sm}
0103
0104 PATCH_COMMAND ${patch}
0105 cp ${CMAKE_CURRENT_SOURCE_DIR}/../../macports/fixbundledatapath.sh <SOURCE_DIR>/. &&
0106 <SOURCE_DIR>/fixbundledatapath.sh
0107
0108 CONFIGURE_COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.macports <SOURCE_DIR>/. &&
0109 sed -i '' -e "s/DBUILD_TESTING=ON/DBUILD_TESTING=OFF/g" <SOURCE_DIR>/bootstrap.macports &&
0110 <SOURCE_DIR>/bootstrap.macports ${EXTPREFIX_frameworks} debug x86_64 "${argoptions}"
0111
0112 BUILD_COMMAND cd <SOURCE_DIR>/build && $(MAKE)
0113
0114 INSTALL_COMMAND cd <SOURCE_DIR>/build && make install/fast
0115
0116 BUILD_IN_SOURCE 1
0117
0118 UPDATE_COMMAND ""
0119 ALWAYS 0
0120 )
0121
0122 else() # Linux
0123
0124 # Extract MD5 sums of each KDE components directly from server.
0125 execute_process(COMMAND
0126 wget -q -O - -o /dev/null https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz.md5
0127 COMMAND
0128 grep "tar.xz"
0129 COMMAND
0130 cut -d " " -f1
0131 RESULT_VARIABLE
0132 wgetresult
0133 OUTPUT_VARIABLE
0134 md5sm
0135 OUTPUT_STRIP_TRAILING_WHITESPACE
0136 )
0137
0138 message(STATUS "--------------------------------")
0139 message(STATUS "KDE component : ${name}")
0140 message(STATUS "Component version: ${version}")
0141 message(STATUS "Component MD5 : ${md5sm}")
0142 message(STATUS "Configure options: ${argoptions}")
0143 message(STATUS "Patch to apply : ${patch}")
0144
0145 if(NOT "${patch}" STREQUAL "")
0146 set(patch "${PATCH_COMMAND};-p1;-i;${CMAKE_CURRENT_SOURCE_DIR}/${patch}")
0147 endif()
0148
0149 ExternalProject_Add(ext_${name}
0150 DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0151 URL https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz
0152 URL_MD5 ${md5sm}
0153
0154 PATCH_COMMAND ${patch}
0155
0156 INSTALL_DIR ${EXTPREFIX_frameworks}
0157 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
0158 -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
0159 ${GLOBAL_PROFILE}
0160 -DCMAKE_SYSTEM_PREFIX_PATH=${EXTPREFIX}
0161 -DBUILD_TESTING=OFF
0162 "${argoptions}"
0163 -Wno-dev
0164 UPDATE_COMMAND ""
0165 ALWAYS 0
0166 )
0167
0168 endif()
0169
0170 endfunction()
0171
0172 if(APPLE)
0173 set(MacosThreadWeaverPatch threadweaver-macports.patch)
0174 set(MacosKauthBackend -DKAUTH_BACKEND_NAME=Apple)
0175 else()
0176 set(KCalendarCorePatch kcalendarcore-libical.patch)
0177 endif()
0178
0179 if(MINGW)
0180 set(MacosCoreAddonsPatch kcoreaddons-mingw.patch)
0181 set(BreezeIconsOptions -DBINARY_ICONS_RESOURCE=OFF)
0182 else()
0183 set(BreezeIconsOptions -DBINARY_ICONS_RESOURCE=ON)
0184 endif()
0185
0186 if(NOT APPLE AND NOT MINGW AND NOT WIN32)
0187 set(AppImageServicePatch kservice-sycoca.patch)
0188 endif()
0189
0190 if (${ENABLE_QTVERSION} MATCHES "6.*")
0191 set(Qt6CommonOptions -DQT_MAJOR_VERSION=6 -DBUILD_WITH_QT6=ON -DEXCLUDE_DEPRECATED_BEFORE_AND_AT=5.94.0)
0192 endif()
0193
0194 InstallKDEComponent(extra-cmake-modules ${KDE_VERSION} "${Qt6CommonOptions}" "extracmakemodules-compiler-options.patch")
0195 InstallKDEComponent(kconfig ${KDE_VERSION} "${Qt6CommonOptions}" "")
0196 InstallKDEComponent(breeze-icons ${KDE_VERSION} "${Qt6CommonOptions};${BreezeIconsOptions}" "breeze-dropsvg-rccprefix.patch")
0197 InstallKDEComponent(solid ${KDE_VERSION} "${Qt6CommonOptions}" "")
0198 InstallKDEComponent(kcoreaddons ${KDE_VERSION} "${Qt6CommonOptions}" "kcoreaddons-mingw.patch")
0199 InstallKDEComponent(threadweaver ${KDE_VERSION} "${Qt6CommonOptions}" "${MacosThreadWeaverPatch}")
0200 InstallKDEComponent(kwindowsystem ${KDE_VERSION} "${Qt6CommonOptions}" "")
0201 InstallKDEComponent(karchive ${KDE_VERSION} "${Qt6CommonOptions}" "")
0202 InstallKDEComponent(kdbusaddons ${KDE_VERSION} "${Qt6CommonOptions}" "")
0203 InstallKDEComponent(ki18n ${KDE_VERSION} "${Qt6CommonOptions}" "ki18n-mingw.patch")
0204 InstallKDEComponent(kcrash ${KDE_VERSION} "${Qt6CommonOptions}" "")
0205 InstallKDEComponent(kcodecs ${KDE_VERSION} "${Qt6CommonOptions}" "")
0206 InstallKDEComponent(kauth ${KDE_VERSION} "${Qt6CommonOptions};${MacosKauthBackend}" "")
0207 InstallKDEComponent(kguiaddons ${KDE_VERSION} "${Qt6CommonOptions};-DWITH_WAYLAND=OFF" "kguiaddons-mingw.patch")
0208 InstallKDEComponent(kwidgetsaddons ${KDE_VERSION} "${Qt6CommonOptions}" "")
0209 InstallKDEComponent(kitemviews ${KDE_VERSION} "${Qt6CommonOptions}" "")
0210 InstallKDEComponent(kcompletion ${KDE_VERSION} "${Qt6CommonOptions}" "")
0211 InstallKDEComponent(kconfigwidgets ${KDE_VERSION} "${Qt6CommonOptions}" "")
0212 InstallKDEComponent(kiconthemes ${KDE_VERSION} "${Qt6CommonOptions}" "")
0213 InstallKDEComponent(kservice ${KDE_VERSION} "${Qt6CommonOptions}" "")
0214 InstallKDEComponent(kglobalaccel ${KDE_VERSION} "${Qt6CommonOptions}" "")
0215 InstallKDEComponent(kcalendarcore ${KDE_VERSION} "${Qt6CommonOptions}" "${KCalendarCorePatch}")
0216 InstallKDEComponent(kxmlgui ${KDE_VERSION} "${Qt6CommonOptions}" "")
0217 InstallKDEComponent(kbookmarks ${KDE_VERSION} "${Qt6CommonOptions}" "")
0218 InstallKDEComponent(kimageformats ${KDE_VERSION} "${Qt6CommonOptions}" "")
0219 InstallKDEComponent(knotifyconfig ${KDE_VERSION} "${Qt6CommonOptions}" "knotifyconfig-drop-phonon.patch")
0220 InstallKDEComponent(knotifications ${KDE_VERSION} "${Qt6CommonOptions}" "knotifications-drop-phonon.patch")
0221 InstallKDEComponent(kjobwidgets ${KDE_VERSION} "${Qt6CommonOptions}" "")
0222 InstallKDEComponent(sonnet ${KDE_VERSION} "${Qt6CommonOptions}" "")
0223 InstallKDEComponent(ktextwidgets ${KDE_VERSION} "${Qt6CommonOptions}" "")
0224 InstallKDEComponent(kio ${KDE_VERSION} "${Qt6CommonOptions}" "kio-drop-ktextwidgets.patch")
0225 InstallKDEComponent(kinit ${KDE_VERSION} "${Qt6CommonOptions}" "")