1
0
Fork 0

Updated cmake sources to TDesktop version 3.5.2+95e806c

This commit is contained in:
Eric Kotato 2022-02-15 02:33:25 +03:00
commit edd3374526
44 changed files with 1447 additions and 1471 deletions

View file

@ -5,6 +5,9 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_subdirectory(external)
if (LINUX)
add_subdirectory(linux_jemalloc_helper)
endif()
if (LINUX AND NOT DESKTOP_APP_USE_PACKAGED)
add_subdirectory(linux_xcb_helper)
endif()

View file

@ -14,9 +14,6 @@ endmacro()
add_checked_subdirectory(angle)
add_checked_subdirectory(auto_updates)
add_checked_subdirectory(crash_reports)
if (LINUX AND NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION)
add_checked_subdirectory(dbusmenu_qt)
endif()
if (LINUX)
add_checked_subdirectory(dispatch)
endif()
@ -60,11 +57,9 @@ add_checked_subdirectory(qr_code_generator)
add_checked_subdirectory(ranges)
add_checked_subdirectory(rlottie)
add_checked_subdirectory(rnnoise)
if (LINUX AND NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION)
add_checked_subdirectory(statusnotifieritem)
endif()
add_checked_subdirectory(ton)
add_checked_subdirectory(variant)
add_checked_subdirectory(vpx)
add_checked_subdirectory(webrtc)
if (LINUX AND NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
add_checked_subdirectory(xcb)

View file

@ -24,9 +24,4 @@ else()
INTERFACE
lzma
)
target_link_libraries(external_xz
INTERFACE
${CMAKE_DL_LIBS}
)
endif()

View file

@ -1,82 +0,0 @@
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_dbusmenu_qt INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_dbusmenu_qt ALIAS external_dbusmenu_qt)
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_QT6)
if (DESKTOP_APP_USE_PACKAGED_LAZY)
find_package(dbusmenu-qt5 QUIET)
else()
find_package(dbusmenu-qt5)
endif()
if (dbusmenu-qt5_FOUND)
target_link_libraries(external_dbusmenu_qt INTERFACE dbusmenu-qt5)
endif()
endif()
if (NOT dbusmenu-qt5_FOUND)
add_library(external_dbusmenu_qt_bundled STATIC)
init_target(external_dbusmenu_qt_bundled "(external)")
set(dbusmenu_qt_VERSION_MAJOR 0)
set(dbusmenu_qt_VERSION_MINOR 9)
set(dbusmenu_qt_VERSION_PATCH 2)
set(dbusmenu_qt_loc ${third_party_loc}/libdbusmenu-qt/src)
set_target_properties(external_dbusmenu_qt_bundled PROPERTIES AUTOMOC ON)
# QIcon::name was introduced in Qt 4.7.
set(HAVE_QICON_NAME ON)
configure_file(${dbusmenu_qt_loc}/dbusmenu_config.h.in "${CMAKE_CURRENT_BINARY_DIR}/dbusmenu_config.h" @ONLY)
configure_file(${dbusmenu_qt_loc}/dbusmenu_version.h.in "${CMAKE_CURRENT_BINARY_DIR}/dbusmenu_version.h")
nice_target_sources(external_dbusmenu_qt_bundled ${dbusmenu_qt_loc}
PRIVATE
dbusmenu_p.cpp
dbusmenuexporter.cpp
dbusmenuexporterdbus_p.cpp
dbusmenuimporter.cpp
dbusmenutypes_p.cpp
dbusmenushortcut_p.cpp
utils.cpp
)
if (DESKTOP_APP_QT6)
qt6_add_dbus_adaptor(dbusmenu_adaptor
${dbusmenu_qt_loc}/com.canonical.dbusmenu.xml
${dbusmenu_qt_loc}/dbusmenuexporterdbus_p.h
DBusMenuExporterDBus
)
else()
qt5_add_dbus_adaptor(dbusmenu_adaptor
${dbusmenu_qt_loc}/com.canonical.dbusmenu.xml
${dbusmenu_qt_loc}/dbusmenuexporterdbus_p.h
DBusMenuExporterDBus
)
endif()
target_sources(external_dbusmenu_qt_bundled PRIVATE ${dbusmenu_adaptor})
target_include_directories(external_dbusmenu_qt_bundled
PUBLIC
${dbusmenu_qt_loc}
"${CMAKE_CURRENT_BINARY_DIR}"
)
target_link_libraries(external_dbusmenu_qt_bundled
PRIVATE
desktop-app::external_qt
)
target_link_libraries(external_dbusmenu_qt
INTERFACE
external_dbusmenu_qt_bundled
)
endif()

View file

@ -61,7 +61,6 @@ INTERFACE
target_link_libraries(external_dispatch_bundled
INTERFACE
${dispatch_binary_dir}/src/BlocksRuntime/libBlocksRuntime.a
pthread
)
target_link_libraries(external_dispatch

View file

@ -16,12 +16,11 @@ if (DESKTOP_APP_USE_PACKAGED)
if (tl-expected_FOUND)
target_link_libraries(external_expected INTERFACE tl::expected)
return()
endif()
endif()
if (NOT tl-expected_FOUND)
target_include_directories(external_expected SYSTEM
INTERFACE
${third_party_loc}/expected/include
)
endif()

View file

@ -7,7 +7,9 @@
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
add_library(external_fcitx5_qt INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_fcitx5_qt ALIAS external_fcitx5_qt)
else()
return()
endif()
add_library(external_fcitx5_qt STATIC)
add_library(desktop-app::external_fcitx5_qt ALIAS external_fcitx5_qt)
init_target(external_fcitx5_qt "(external)")
@ -82,4 +84,3 @@ else()
xkbcommon
)
endif()
endif()

View file

@ -7,7 +7,9 @@
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
add_library(external_fcitx5_qt_dbusaddons INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_fcitx5_qt_dbusaddons ALIAS external_fcitx5_qt_dbusaddons)
else()
return()
endif()
add_library(external_fcitx5_qt_dbusaddons STATIC)
add_library(desktop-app::external_fcitx5_qt_dbusaddons ALIAS external_fcitx5_qt_dbusaddons)
init_target(external_fcitx5_qt_dbusaddons "(external)")
@ -62,4 +64,3 @@ else()
PRIVATE
desktop-app::external_qt
)
endif()

View file

@ -7,7 +7,9 @@
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
add_library(external_fcitx_qt5 INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_fcitx_qt5 ALIAS external_fcitx_qt5)
else()
return()
endif()
add_library(external_fcitx_qt5 STATIC)
add_library(desktop-app::external_fcitx_qt5 ALIAS external_fcitx_qt5)
init_target(external_fcitx_qt5 "(external)")
@ -85,4 +87,3 @@ else()
xkbcommon
)
endif()
endif()

View file

@ -39,25 +39,14 @@ else()
${ffmpeg_lib_loc}/libswresample/libswresample.a
${ffmpeg_lib_loc}/libswscale/libswscale.a
${ffmpeg_lib_loc}/libavutil/libavutil.a
$<LINK_ONLY:desktop-app::external_opus>
$<TARGET_FILE:desktop-app::external_opus>
$<LINK_ONLY:desktop-app::external_vpx>
$<TARGET_FILE:desktop-app::external_vpx>
)
if (LINUX)
target_link_static_libraries(external_ffmpeg
INTERFACE
lzma
va-x11
va-drm
va
vdpau
Xv
Xext
Xfixes
drm
)
target_link_libraries(external_ffmpeg
INTERFACE
X11
pthread
)
if (APPLE)
target_link_libraries(external_ffmpeg INTERFACE bz2)
elseif (LINUX)
target_link_static_libraries(external_ffmpeg INTERFACE lzma)
endif()
endif()

View file

@ -16,12 +16,11 @@ if (DESKTOP_APP_USE_PACKAGED)
if (Microsoft.GSL_FOUND)
target_link_libraries(external_gsl INTERFACE Microsoft.GSL::GSL)
return()
endif()
endif()
if (NOT Microsoft.GSL_FOUND)
target_include_directories(external_gsl SYSTEM
INTERFACE
${third_party_loc}/GSL/include
)
endif()

View file

@ -7,7 +7,9 @@
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
add_library(external_hime_qt INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_hime_qt ALIAS external_hime_qt)
else()
return()
endif()
add_library(external_hime_qt STATIC)
add_library(desktop-app::external_hime_qt ALIAS external_hime_qt)
init_target(external_hime_qt "(external)")
@ -41,4 +43,3 @@ else()
desktop-app::external_hime_im_client
desktop-app::external_qt
)
endif()

View file

@ -7,7 +7,9 @@
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
add_library(external_hime_im_client INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_hime_im_client ALIAS external_hime_im_client)
else()
return()
endif()
add_library(external_hime_im_client STATIC)
add_library(desktop-app::external_hime_im_client ALIAS external_hime_im_client)
init_target(external_hime_im_client "(external)")
@ -32,9 +34,3 @@ else()
PRIVATE
${X11_INCLUDE_DIRS}
)
target_link_libraries(external_hime_im_client
PRIVATE
${CMAKE_DL_LIBS}
)
endif()

View file

@ -13,10 +13,10 @@ if (DESKTOP_APP_USE_PACKAGED)
if (HUNSPELL_FOUND)
target_link_libraries(external_hunspell INTERFACE PkgConfig::HUNSPELL)
return()
endif()
endif()
if (NOT HUNSPELL_FOUND)
add_library(external_hunspell_bundled STATIC)
init_target(external_hunspell_bundled "(external)")
@ -68,4 +68,3 @@ if (NOT HUNSPELL_FOUND)
INTERFACE
external_hunspell_bundled
)
endif()

View file

@ -13,22 +13,23 @@ endif()
if (DESKTOP_APP_USE_PACKAGED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(JEMALLOC IMPORTED_TARGET jemalloc)
pkg_check_modules(JEMALLOC jemalloc)
if (JEMALLOC_FOUND)
target_include_directories(external_jemalloc SYSTEM
INTERFACE
${JEMALLOC_INCLUDE_DIRS}
)
target_link_libraries(external_jemalloc
INTERFACE
-Wl,--no-as-needed
PkgConfig::JEMALLOC
${JEMALLOC_LINK_LIBRARIES}
-Wl,--as-needed
-Wl,--push-state,--no-as-needed,${JEMALLOC_LINK_LIBRARIES},--pop-state
)
return()
endif()
endif()
add_library(external_jemalloc_bundled STATIC IMPORTED)
include(ExternalProject)
ExternalProject_Add(jemalloc
URL ${third_party_loc}/jemalloc
@ -42,27 +43,14 @@ ExternalProject_Add(jemalloc
ExternalProject_Get_property(jemalloc SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
set_target_properties(external_jemalloc_bundled PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libjemalloc.a"
)
target_include_directories(external_jemalloc_bundled SYSTEM
target_include_directories(external_jemalloc SYSTEM
INTERFACE
${SOURCE_DIR}/include
)
target_link_libraries(external_jemalloc_bundled
INTERFACE
${CMAKE_DL_LIBS}
pthread
)
add_dependencies(external_jemalloc_bundled jemalloc-build)
target_link_libraries(external_jemalloc
INTERFACE
-Wl,--whole-archive
$<TARGET_FILE:external_jemalloc_bundled>
-Wl,--no-whole-archive
external_jemalloc_bundled
-Wl,--push-state,--whole-archive,${SOURCE_DIR}/lib/libjemalloc.a,--pop-state,-ldl
)
add_dependencies(external_jemalloc jemalloc-build)

View file

@ -18,12 +18,69 @@ endif()
add_library(external_kwayland_bundled STATIC IMPORTED)
include(ExternalProject)
ExternalProject_Add(extra-cmake-modules
URL ${third_party_loc}/extra-cmake-modules
CMAKE_GENERATOR Ninja
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=<BINARY_DIR>
-DCMAKE_INSTALL_DATADIR=share
-DBUILD_TESTING=OFF
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR>
COMMAND ${CMAKE_COMMAND} --install <BINARY_DIR>
STEP_TARGETS build
EXCLUDE_FROM_ALL TRUE
BUILD_BYPRODUCTS <BINARY_DIR>/share/ECM/cmake/ECMConfig.cmake
)
ExternalProject_Get_property(extra-cmake-modules BINARY_DIR)
set(extra_cmake_modules_binary_dir ${BINARY_DIR})
ExternalProject_Add(wayland-protocols
URL ${third_party_loc}/wayland-protocols
CONFIGURE_COMMAND meson
--prefix=<BINARY_DIR>
--libdir=lib
--buildtype=release
-Dtests=false
<BINARY_DIR> <SOURCE_DIR>
BUILD_COMMAND meson compile -C <BINARY_DIR>
COMMAND meson install -C <BINARY_DIR>
STEP_TARGETS build
EXCLUDE_FROM_ALL TRUE
BUILD_BYPRODUCTS <BINARY_DIR>/share/pkgconfig/wayland-protocols.pc
)
ExternalProject_Get_property(wayland-protocols BINARY_DIR)
set(wayland_protocols_binary_dir ${BINARY_DIR})
ExternalProject_Add(plasma-wayland-protocols
URL ${third_party_loc}/plasma-wayland-protocols
CMAKE_GENERATOR Ninja
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=<BINARY_DIR>
-DCMAKE_INSTALL_LIBDIR=lib
-DECM_DIR=${extra_cmake_modules_binary_dir}/share/ECM/cmake
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR>
COMMAND ${CMAKE_COMMAND} --install <BINARY_DIR>
STEP_TARGETS build
EXCLUDE_FROM_ALL TRUE
BUILD_BYPRODUCTS <BINARY_DIR>/lib/cmake/PlasmaWaylandProtocols/PlasmaWaylandProtocolsConfig.cmake
)
ExternalProject_Add_StepDependencies(plasma-wayland-protocols configure extra-cmake-modules-build)
ExternalProject_Get_property(plasma-wayland-protocols BINARY_DIR)
set(plasma_wayland_protocols_binary_dir ${BINARY_DIR})
set(kwayland_patch_command)
if (DESKTOP_APP_QT6)
set(kwayland_patch_command PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/kwayland-qt6.patch)
endif()
include(ExternalProject)
ExternalProject_Add(kwayland
URL ${third_party_loc}/kwayland
CMAKE_GENERATOR Ninja
@ -31,6 +88,9 @@ ExternalProject_Add(kwayland
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTING=OFF
-DCMAKE_PREFIX_PATH=${wayland_protocols_binary_dir}
-DECM_DIR=${extra_cmake_modules_binary_dir}/share/ECM/cmake
-DPlasmaWaylandProtocols_DIR=${plasma_wayland_protocols_binary_dir}/lib/cmake/PlasmaWaylandProtocols
${kwayland_patch_command}
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --target KF5WaylandClient
STEP_TARGETS build
@ -38,6 +98,10 @@ ExternalProject_Add(kwayland
BUILD_BYPRODUCTS <BINARY_DIR>/lib/libKF5WaylandClient.a
)
ExternalProject_Add_StepDependencies(kwayland configure extra-cmake-modules-build)
ExternalProject_Add_StepDependencies(kwayland configure wayland-protocols-build)
ExternalProject_Add_StepDependencies(kwayland configure plasma-wayland-protocols-build)
ExternalProject_Get_property(kwayland SOURCE_DIR)
ExternalProject_Get_property(kwayland BINARY_DIR)
@ -64,11 +128,7 @@ if (DESKTOP_APP_USE_PACKAGED)
pkg_check_modules(WAYLAND_CLIENT REQUIRED IMPORTED_TARGET wayland-client)
target_link_libraries(external_kwayland_bundled INTERFACE PkgConfig::WAYLAND_CLIENT)
else()
target_link_libraries(external_kwayland_bundled
INTERFACE
desktop-app::linux_wayland_helper
$<TARGET_FILE:desktop-app::linux_wayland_helper>
)
target_link_libraries(external_kwayland_bundled INTERFACE desktop-app::linux_wayland_helper)
endif()
add_dependencies(external_kwayland_bundled kwayland-build)

View file

@ -13,10 +13,10 @@ if (DESKTOP_APP_USE_PACKAGED)
if (LZ4_FOUND)
target_link_libraries(external_lz4 INTERFACE PkgConfig::LZ4)
return()
endif()
endif()
if (NOT LZ4_FOUND)
add_library(external_lz4_bundled STATIC)
init_target(external_lz4_bundled "(external)")
@ -44,4 +44,3 @@ if (NOT LZ4_FOUND)
INTERFACE
external_lz4_bundled
)
endif()

View file

@ -13,11 +13,18 @@ if (DESKTOP_APP_USE_PACKAGED)
if (MINIZIP_FOUND)
target_link_libraries(external_minizip INTERFACE PkgConfig::MINIZIP)
return()
endif()
endif()
if (NOT MINIZIP_FOUND)
if (NOT WIN32)
if (WIN32)
target_include_directories(external_minizip SYSTEM
INTERFACE
${libs_loc}/zlib/contrib/minizip
)
return()
endif()
add_library(external_minizip_bundled STATIC)
init_target(external_minizip_bundled "(external)")
@ -43,10 +50,3 @@ if (NOT MINIZIP_FOUND)
INTERFACE
external_minizip_bundled
)
else()
target_include_directories(external_minizip SYSTEM
INTERFACE
${libs_loc}/zlib/contrib/minizip
)
endif()
endif()

View file

@ -7,7 +7,9 @@
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
add_library(external_nimf_qt5 INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_nimf_qt5 ALIAS external_nimf_qt5)
else()
return()
endif()
add_library(external_nimf_qt5 STATIC)
add_library(desktop-app::external_nimf_qt5 ALIAS external_nimf_qt5)
init_target(external_nimf_qt5 "(external)")
@ -45,6 +47,4 @@ else()
target_link_libraries(external_nimf_qt5
PRIVATE
desktop-app::external_qt
${CMAKE_DL_LIBS}
)
endif()

View file

@ -12,11 +12,12 @@ if (DESKTOP_APP_USE_PACKAGED)
if (OPENAL_FOUND)
target_include_directories(external_openal SYSTEM INTERFACE ${OPENAL_INCLUDE_DIR})
target_link_libraries(external_openal INTERFACE ${OPENAL_LIBRARY})
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(OPENAL REQUIRED IMPORTED_TARGET openal)
target_link_libraries(external_openal INTERFACE PkgConfig::OPENAL)
return()
endif()
find_package(OpenAL REQUIRED CONFIG)
target_link_libraries(external_openal INTERFACE OpenAL::OpenAL)
return()
elseif (WIN32)
target_include_directories(external_openal SYSTEM
INTERFACE
@ -47,16 +48,9 @@ else()
INTERFACE
openal
)
target_link_libraries(external_openal
INTERFACE
${CMAKE_DL_LIBS}
pthread
)
endif()
if (NOT DESKTOP_APP_USE_PACKAGED)
target_compile_definitions(external_openal
INTERFACE
AL_LIBTYPE_STATIC
)
endif()

View file

@ -19,12 +19,4 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
${libs_loc}/openssl/include
)
endif()
if (LINUX)
target_link_libraries(external_openssl_common
INTERFACE
${CMAKE_DL_LIBS}
pthread
)
endif()
endif()

View file

@ -10,7 +10,9 @@ if (DESKTOP_APP_USE_PACKAGED)
find_package(OpenSSL REQUIRED)
target_link_libraries(external_openssl_crypto INTERFACE OpenSSL::Crypto)
else()
return()
endif()
add_library(external_openssl_crypto STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_openssl_crypto ALIAS external_openssl_crypto)
@ -28,4 +30,3 @@ else()
INTERFACE
desktop-app::external_openssl_common
)
endif()

View file

@ -10,7 +10,9 @@ if (DESKTOP_APP_USE_PACKAGED)
find_package(OpenSSL REQUIRED)
target_link_libraries(external_openssl_ssl INTERFACE OpenSSL::SSL)
else()
return()
endif()
add_library(external_openssl_ssl STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_openssl_ssl ALIAS external_openssl_ssl)
@ -28,4 +30,3 @@ else()
INTERFACE
desktop-app::external_openssl_common
)
endif()

View file

@ -12,7 +12,9 @@ if (DESKTOP_APP_USE_PACKAGED)
pkg_check_modules(OPUS IMPORTED_TARGET opus)
target_link_libraries(external_opus INTERFACE PkgConfig::OPUS)
else()
return()
endif()
add_library(external_opus STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_opus ALIAS external_opus)
@ -39,9 +41,8 @@ else()
INTERFACE
/usr/local/include/opus
)
find_library(OPUS_LIBRARY libopus.a)
find_library(OPUS_LIBRARY libopus.a REQUIRED)
set_target_properties(external_opus PROPERTIES
IMPORTED_LOCATION "${OPUS_LIBRARY}"
)
endif()
endif()

View file

@ -14,10 +14,10 @@ if (DESKTOP_APP_USE_PACKAGED)
if (QRCODE_LIBRARIES AND QRCODE_INCLUDE_DIRS)
target_include_directories(external_qr_code_generator SYSTEM INTERFACE ${QRCODE_INCLUDE_DIRS})
target_link_libraries(external_qr_code_generator INTERFACE ${QRCODE_LIBRARIES})
return()
endif()
endif()
if (NOT QRCODE_LIBRARIES OR NOT QRCODE_INCLUDE_DIRS)
add_library(external_qr_code_generator_bundled STATIC)
init_target(external_qr_code_generator_bundled "(external)")
@ -39,4 +39,3 @@ if (NOT QRCODE_LIBRARIES OR NOT QRCODE_INCLUDE_DIRS)
INTERFACE
external_qr_code_generator_bundled
)
endif()

View file

@ -27,6 +27,7 @@ if (DESKTOP_APP_USE_PACKAGED)
INTERFACE
${Qt5Core_PRIVATE_INCLUDE_DIRS}
${Qt5Gui_PRIVATE_INCLUDE_DIRS}
${Qt5Widgets_PRIVATE_INCLUDE_DIRS}
)
if (Qt5DBus_FOUND)
@ -50,7 +51,10 @@ if (DESKTOP_APP_USE_PACKAGED)
${Qt5WaylandClient_PRIVATE_INCLUDE_DIRS}
)
endif()
else()
return()
endif()
target_include_directories(external_qt SYSTEM
INTERFACE
${qt_loc}/include
@ -255,10 +259,12 @@ else()
target_link_libraries(external_qt
INTERFACE
${qt_libs_list}
$<LINK_ONLY:desktop-app::external_openssl>
$<TARGET_FILE:desktop-app::external_openssl_ssl>
$<TARGET_FILE:desktop-app::external_openssl_crypto>
desktop-app::external_jpeg
desktop-app::external_zlib
$<LINK_ONLY:desktop-app::external_jpeg>
$<LINK_ONLY:desktop-app::external_zlib>
$<TARGET_FILE:desktop-app::external_zlib>
)
if (LINUX)
@ -287,26 +293,20 @@ else()
xcb-util
xcb-render-util
xcb-keysyms
z
)
if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
target_link_libraries(external_qt
INTERFACE
desktop-app::linux_wayland_helper
$<TARGET_FILE:desktop-app::linux_wayland_helper>
)
endif()
target_link_libraries(external_qt
INTERFACE
desktop-app::linux_xcb_helper
$<TARGET_FILE:desktop-app::linux_xcb_helper>
fontconfig
freetype
xcb
X11
X11-xcb
${CMAKE_DL_LIBS}
pthread
)
endif()
endif()

View file

@ -38,7 +38,9 @@ if (LINUX)
endif()
endif()
if (NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION)
if ((NOT DESKTOP_APP_USE_PACKAGED
OR (DESKTOP_APP_USE_PACKAGED AND DESKTOP_APP_USE_PACKAGED_LAZY))
AND NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION)
if (DESKTOP_APP_QT6)
find_package(Qt6 COMPONENTS DBus REQUIRED)
else()

View file

@ -38,7 +38,10 @@ if (DESKTOP_APP_USE_PACKAGED)
${Qt6WaylandClient_PRIVATE_INCLUDE_DIRS}
)
endif()
else()
return()
endif()
target_include_directories(external_qt SYSTEM
INTERFACE
${qt_loc}/include
@ -231,10 +234,12 @@ else()
target_link_libraries(external_qt
INTERFACE
${qt_libs_list}
$<LINK_ONLY:desktop-app::external_openssl>
$<TARGET_FILE:desktop-app::external_openssl_ssl>
$<TARGET_FILE:desktop-app::external_openssl_crypto>
desktop-app::external_jpeg
desktop-app::external_zlib
$<LINK_ONLY:desktop-app::external_jpeg>
$<LINK_ONLY:desktop-app::external_zlib>
$<TARGET_FILE:desktop-app::external_zlib>
)
if (LINUX)
@ -262,26 +267,20 @@ else()
xcb-util
xcb-render-util
xcb-keysyms
z
)
if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
target_link_libraries(external_qt
INTERFACE
desktop-app::linux_wayland_helper
$<TARGET_FILE:desktop-app::linux_wayland_helper>
)
endif()
target_link_libraries(external_qt
INTERFACE
desktop-app::linux_xcb_helper
$<TARGET_FILE:desktop-app::linux_xcb_helper>
fontconfig
freetype
xcb
X11
X11-xcb
${CMAKE_DL_LIBS}
pthread
)
endif()
endif()

View file

@ -16,10 +16,10 @@ if (DESKTOP_APP_USE_PACKAGED)
if (range-v3_FOUND)
target_link_libraries(external_ranges INTERFACE range-v3::range-v3)
return()
endif()
endif()
if (NOT range-v3_FOUND)
target_include_directories(external_ranges SYSTEM
INTERFACE
${third_party_loc}/range-v3/include
@ -32,4 +32,3 @@ if (NOT range-v3_FOUND)
/wd5105 # needed for `/Zc:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior"
)
endif()
endif()

View file

@ -7,27 +7,19 @@
add_library(external_rlottie INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_rlottie ALIAS external_rlottie)
if (DESKTOP_APP_USE_PACKAGED)
if (DESKTOP_APP_USE_PACKAGED_RLOTTIE)
find_package(rlottie QUIET)
if (rlottie_FOUND)
target_link_libraries(external_rlottie INTERFACE rlottie::rlottie)
else()
return()
endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(RLOTTIE IMPORTED_TARGET rlottie)
if (RLOTTIE_FOUND)
pkg_check_modules(RLOTTIE REQUIRED IMPORTED_TARGET rlottie)
target_link_libraries(external_rlottie INTERFACE PkgConfig::RLOTTIE)
endif()
endif()
return()
endif()
if (rlottie_FOUND OR RLOTTIE_FOUND)
target_compile_definitions(external_rlottie
INTERFACE
DESKTOP_APP_USE_PACKAGED_RLOTTIE
)
else()
add_library(external_rlottie_bundled STATIC)
init_target(external_rlottie_bundled "(external)")
@ -133,13 +125,6 @@ else()
${rlottie_loc}/src/vector/freetype
)
if (LINUX)
target_link_libraries(external_rlottie_bundled
PRIVATE
pthread
)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(external_rlottie_bundled
PRIVATE
@ -152,4 +137,3 @@ else()
INTERFACE
external_rlottie_bundled
)
endif()

View file

@ -12,7 +12,9 @@ if (DESKTOP_APP_USE_PACKAGED)
pkg_check_modules(RNNOISE REQUIRED IMPORTED_TARGET rnnoise)
target_link_libraries(external_rnnoise INTERFACE PkgConfig::RNNOISE)
else()
return()
endif()
add_library(external_rnnoise STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_rnnoise ALIAS external_rnnoise)
@ -40,9 +42,8 @@ else()
INTERFACE
/usr/local/include
)
find_library(RNNOISE_LIBRARY librnnoise.a)
find_library(RNNOISE_LIBRARY librnnoise.a REQUIRED)
set_target_properties(external_rnnoise PROPERTIES
IMPORTED_LOCATION "${RNNOISE_LIBRARY}"
)
endif()
endif()

View file

@ -1,50 +0,0 @@
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_statusnotifieritem STATIC)
add_library(desktop-app::external_statusnotifieritem ALIAS external_statusnotifieritem)
init_target(external_statusnotifieritem "(external)")
set(statusnotifieritem_loc ${third_party_loc}/statusnotifieritem)
nice_target_sources(external_statusnotifieritem ${statusnotifieritem_loc}
PRIVATE
dbustypes.cpp
dbustypes.h
statusnotifieritem.cpp
statusnotifieritem.h
)
if (DESKTOP_APP_QT6)
qt6_add_dbus_adaptor(sni_adaptor
${statusnotifieritem_loc}/org.kde.StatusNotifierItem.xml
${statusnotifieritem_loc}/statusnotifieritem.h
StatusNotifierItem
)
else()
qt5_add_dbus_adaptor(sni_adaptor
${statusnotifieritem_loc}/org.kde.StatusNotifierItem.xml
${statusnotifieritem_loc}/statusnotifieritem.h
StatusNotifierItem
)
endif()
set_target_properties(external_statusnotifieritem PROPERTIES AUTOMOC ON)
target_sources(external_statusnotifieritem PRIVATE ${sni_adaptor})
target_include_directories(external_statusnotifieritem
PUBLIC
${statusnotifieritem_loc}
PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}"
)
target_link_libraries(external_statusnotifieritem
PRIVATE
desktop-app::external_dbusmenu_qt
desktop-app::external_qt
)

View file

@ -9,11 +9,16 @@ add_library(desktop-app::external_variant ALIAS external_variant)
if (DESKTOP_APP_USE_PACKAGED)
find_path(VARIANT_INCLUDE_DIRS mapbox/variant.hpp)
if (VARIANT_INCLUDE_DIRS)
target_include_directories(external_variant SYSTEM
INTERFACE
${VARIANT_INCLUDE_DIRS}
)
return()
endif()
endif()
if (NOT VARIANT_INCLUDE_DIRS)
target_include_directories(external_variant SYSTEM
INTERFACE
${third_party_loc}/variant/include
)
endif()

53
external/vpx/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,53 @@
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
if (DESKTOP_APP_USE_PACKAGED)
add_library(external_vpx INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_vpx ALIAS external_vpx)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBVPX IMPORTED_TARGET vpx>=1.10.0)
target_link_libraries(external_vpx INTERFACE PkgConfig::LIBVPX)
return()
endif()
add_library(external_vpx STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_vpx ALIAS external_vpx)
if (WIN32)
target_include_directories(external_vpx SYSTEM
INTERFACE
${libs_loc}/local/include
)
if (build_win64)
set(libvpx_release_folder x64)
else()
set(libvpx_release_folder Win32)
endif()
set(vpx_lib_loc ${libs_loc}/local/lib/${libvpx_release_folder})
set_target_properties(external_vpx PROPERTIES
IMPORTED_LOCATION "${vpx_lib_loc}/vpxmt.lib"
IMPORTED_LOCATION_DEBUG "${vpx_lib_loc}/vpxmt.lib"
)
elseif (APPLE)
target_include_directories(external_vpx SYSTEM
INTERFACE
${libs_loc}/local/include
)
set_target_properties(external_vpx PROPERTIES
IMPORTED_LOCATION ${libs_loc}/local/lib/libvpx.a
)
else()
target_include_directories(external_vpx SYSTEM
INTERFACE
/usr/local/include
)
find_library(VPX_LIBRARY libvpx.a REQUIRED)
set_target_properties(external_vpx PROPERTIES
IMPORTED_LOCATION "${VPX_LIBRARY}"
)
endif()

View file

@ -10,7 +10,9 @@ add_library(desktop-app::external_webrtc ALIAS external_webrtc)
if (DESKTOP_APP_USE_PACKAGED)
find_package(tg_owt REQUIRED)
target_link_libraries(external_webrtc INTERFACE tg_owt::tg_owt)
else()
return()
endif()
set(webrtc_loc ${libs_loc}/tg_owt/src)
set(webrtc_build_loc ${libs_loc}/tg_owt/out/$<IF:$<CONFIG:Debug>,Debug,Release>)
@ -85,9 +87,12 @@ else()
target_link_libraries(external_webrtc
INTERFACE
${webrtc_libs_list}
desktop-app::external_openssl
desktop-app::external_jpeg
desktop-app::external_opus
$<LINK_ONLY:desktop-app::external_openssl>
$<LINK_ONLY:desktop-app::external_jpeg>
$<LINK_ONLY:desktop-app::external_opus>
$<TARGET_FILE:desktop-app::external_opus>
$<LINK_ONLY:desktop-app::external_vpx>
$<TARGET_FILE:desktop-app::external_vpx>
)
if (WIN32)
@ -120,4 +125,3 @@ else()
glib-2.0
)
endif()
endif()

View file

@ -4,13 +4,19 @@
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
if (DESKTOP_APP_USE_PACKAGED)
add_library(external_zlib INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_zlib ALIAS external_zlib)
if (DESKTOP_APP_USE_PACKAGED)
find_package(ZLIB REQUIRED)
target_link_libraries(external_zlib INTERFACE ZLIB::ZLIB)
elseif (WIN32)
return()
endif()
add_library(external_zlib STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_zlib ALIAS external_zlib)
if (WIN32)
target_compile_definitions(external_zlib INTERFACE ZLIB_WINAPI)
target_include_directories(external_zlib SYSTEM INTERFACE ${libs_loc}/zlib)
if (build_win64)
@ -18,10 +24,18 @@ elseif (WIN32)
else()
set(zlib_config_folder x86)
endif()
set(zlib_lib_loc ${libs_loc}/zlib/contrib/vstudio/vc14/${zlib_config_folder}/ZlibStat$<IF:$<CONFIG:Debug>,Debug,ReleaseWithoutAsm>)
target_link_libraries(external_zlib INTERFACE ${zlib_lib_loc}/zlibstat.lib)
set(zlib_lib_loc ${libs_loc}/zlib/contrib/vstudio/vc14/${zlib_config_folder})
set_target_properties(external_zlib PROPERTIES
IMPORTED_LOCATION "${zlib_lib_loc}/ZlibStatReleaseWithoutAsm/zlibstat.lib"
IMPORTED_LOCATION_DEBUG "${zlib_lib_loc}/ZlibStatDebug/zlibstat.lib"
)
elseif (APPLE)
target_link_libraries(external_zlib INTERFACE ${libs_loc}/local/lib/libz.a)
set_target_properties(external_zlib PROPERTIES
IMPORTED_LOCATION ${libs_loc}/local/lib/libz.a
)
else()
target_link_static_libraries(external_zlib INTERFACE z)
find_library(ZLIB_LIBRARY libz.a REQUIRED)
set_target_properties(external_zlib PROPERTIES
IMPORTED_LOCATION "${ZLIB_LIBRARY}"
)
endif()

View file

@ -0,0 +1,19 @@
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(linux_jemalloc_helper OBJECT)
init_target(linux_jemalloc_helper "(external)")
add_library(desktop-app::linux_jemalloc_helper ALIAS linux_jemalloc_helper)
nice_target_sources(linux_jemalloc_helper ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
linux_jemalloc_helper.cpp
)
target_link_libraries(linux_jemalloc_helper
PRIVATE
desktop-app::external_jemalloc
)

View file

@ -0,0 +1,25 @@
// This file is part of Desktop App Toolkit,
// a set of libraries for developing nice desktop applications.
//
// For license and copyright information please follow this link:
// https://github.com/desktop-app/legal/blob/master/LEGAL
//
#ifdef __FreeBSD__
#include <malloc_np.h>
#else // __FreeBSD__
#include <jemalloc/jemalloc.h>
#endif // !__FreeBSD__
namespace {
class JemallocInitializer {
public:
JemallocInitializer() {
auto backgroundThread = true;
mallctl("background_thread", nullptr, nullptr, &backgroundThread, sizeof(bool));
}
};
static const JemallocInitializer initializer;
} // namespace

View file

@ -14,7 +14,6 @@ PRIVATE
)
target_link_libraries(linux_wayland_helper
PUBLIC
PRIVATE
desktop-app::external_gsl
${CMAKE_DL_LIBS}
)

View file

@ -12,8 +12,3 @@ nice_target_sources(linux_xcb_helper ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
linux_xcb_helper.cpp
)
target_link_libraries(linux_xcb_helper
PUBLIC
${CMAKE_DL_LIBS}
)

View file

@ -64,6 +64,13 @@ if (DESKTOP_APP_USE_PACKAGED_FONTS)
)
endif()
if (DESKTOP_APP_USE_PACKAGED_RLOTTIE)
target_compile_definitions(common_options
INTERFACE
DESKTOP_APP_USE_PACKAGED_RLOTTIE
)
endif()
if (NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
target_compile_definitions(common_options
INTERFACE

View file

@ -23,6 +23,7 @@ INTERFACE
target_compile_definitions(common_options
INTERFACE
$<IF:$<CONFIG:Debug>,,_FORTIFY_SOURCE=2>
_GLIBCXX_ASSERTIONS
)
target_link_options(common_options
@ -63,7 +64,9 @@ endif()
target_link_libraries(common_options
INTERFACE
desktop-app::external_jemalloc
desktop-app::linux_jemalloc_helper
$<TARGET_OBJECTS:desktop-app::linux_jemalloc_helper>
${CMAKE_DL_LIBS}
)
if (DESKTOP_APP_USE_ALLOCATION_TRACER)
@ -80,7 +83,7 @@ if (DESKTOP_APP_USE_ALLOCATION_TRACER)
-Wl,-wrap,aligned_alloc
-Wl,-wrap,posix_memalign
-Wl,-wrap,free
-Wl,--no-as-needed,-lrt,--as-needed
-Wl,--push-state,--no-as-needed,-lrt,--pop-state
)
target_link_libraries(common_options
INTERFACE
@ -89,7 +92,14 @@ if (DESKTOP_APP_USE_ALLOCATION_TRACER)
)
endif()
if (NOT DESKTOP_APP_USE_PACKAGED)
if (DESKTOP_APP_USE_PACKAGED)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(common_options
INTERFACE
Threads::Threads
)
else()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_link_options(common_options
INTERFACE
@ -117,16 +127,3 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
# -pie # https://gitlab.gnome.org/GNOME/nautilus/-/issues/1601
)
endif()
if (DESKTOP_APP_USE_PACKAGED)
find_library(ATOMIC_LIBRARY atomic)
else()
find_library(ATOMIC_LIBRARY libatomic.a)
endif()
if (ATOMIC_LIBRARY)
target_link_libraries(common_options
INTERFACE
${ATOMIC_LIBRARY}
)
endif()

View file

@ -16,17 +16,13 @@ function(target_link_static_libraries target_name)
if (${entry} STREQUAL "PRIVATE" OR ${entry} STREQUAL "PUBLIC" OR ${entry} STREQUAL "INTERFACE")
set(writing_now ${entry})
else()
find_library(static_lib_${entry} lib${entry}.a)
set(full_path "${static_lib_${entry}}")
if (${full_path} STREQUAL static_lib_${entry}-NOTFOUND)
message(FATAL_ERROR "Could not find static library lib${entry}.a")
endif()
set(link_option "-Wl,--push-state,-Bstatic,-l${entry},--pop-state")
if ("${writing_now}" STREQUAL "PRIVATE")
list(APPEND private_libs ${full_path})
list(APPEND private_libs ${link_option})
elseif ("${writing_now}" STREQUAL "PUBLIC")
list(APPEND public_libs ${full_path})
list(APPEND public_libs ${link_option})
elseif ("${writing_now}" STREQUAL "INTERFACE")
list(APPEND interface_libs ${full_path})
list(APPEND interface_libs ${link_option})
else()
message(FATAL_ERROR "Unknown frameworks scope for target ${target_name}")
endif()

View file

@ -23,6 +23,8 @@ option(DESKTOP_APP_DISABLE_X11_INTEGRATION "Disable all code for X11 integration
option(DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION "Disable all code for Wayland integration (Linux only)." OFF)
option(DESKTOP_APP_USE_ALLOCATION_TRACER "Use simple allocation tracer (Linux only)." OFF)
option(DESKTOP_APP_USE_PACKAGED_LAZY "Bundle recommended Qt plugins for self-contained packages. (Linux only)" OFF)
option(DESKTOP_APP_USE_PACKAGED_FONTS "Use preinstalled fonts instead of bundled patched ones." OFF)
option(DESKTOP_APP_USE_PACKAGED_RLOTTIE "Find rlottie using CMake instead of bundled patched one." OFF)
option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." OFF)
option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${no_special_target})
option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate." ${disable_autoupdate})
@ -37,12 +39,6 @@ else()
set(DESKTOP_APP_MAC_ARCH "x86_64;arm64" CACHE STRING "Target macOS arch. (macOS only)")
endif()
set(dont_bundle_fonts 0)
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
set(dont_bundle_fonts 1)
endif()
option(DESKTOP_APP_USE_PACKAGED_FONTS "Use preinstalled fonts instead of bundled one." ${dont_bundle_fonts})
set(add_hunspell_library 0)
if ((WIN32
OR (LINUX AND NOT DESKTOP_APP_USE_ENCHANT)