From b6515c543a0dd87f3caf2a07c2f446308d65703a Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 11 Jan 2022 23:04:27 +0400 Subject: [PATCH] Use return to decrease indentation in cmake files --- external/dbusmenu_qt/CMakeLists.txt | 103 ++-- external/expected/CMakeLists.txt | 11 +- external/fcitx5_qt/CMakeLists.txt | 125 ++--- .../fcitx5_qt_dbusaddons/CMakeLists.txt | 97 ++-- external/fcitx_qt5/CMakeLists.txt | 129 ++--- external/hime_qt/CMakeLists.txt | 69 +-- .../hime_qt/hime_im_client/CMakeLists.txt | 51 +- external/hunspell/CMakeLists.txt | 95 ++-- external/lz4/CMakeLists.txt | 49 +- external/minizip/CMakeLists.txt | 66 +-- external/nimf_qt5/CMakeLists.txt | 79 +-- .../openssl/openssl_crypto/CMakeLists.txt | 31 +- external/openssl/openssl_ssl/CMakeLists.txt | 31 +- external/opus/CMakeLists.txt | 65 +-- external/qr_code_generator/CMakeLists.txt | 37 +- external/qt/CMakeLists.txt | 472 +++++++++--------- external/qt/qt6/CMakeLists.txt | 446 +++++++++-------- external/rlottie/CMakeLists.txt | 241 ++++----- external/rnnoise/CMakeLists.txt | 67 +-- external/webrtc/CMakeLists.txt | 177 +++---- 20 files changed, 1226 insertions(+), 1215 deletions(-) diff --git a/external/dbusmenu_qt/CMakeLists.txt b/external/dbusmenu_qt/CMakeLists.txt index b593a58..3539612 100644 --- a/external/dbusmenu_qt/CMakeLists.txt +++ b/external/dbusmenu_qt/CMakeLists.txt @@ -16,67 +16,66 @@ if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_QT6) if (dbusmenu-qt5_FOUND) target_link_libraries(external_dbusmenu_qt INTERFACE dbusmenu-qt5) + return() endif() endif() -if (NOT dbusmenu-qt5_FOUND) - add_library(external_dbusmenu_qt_bundled STATIC) - init_target(external_dbusmenu_qt_bundled "(external)") +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_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(dbusmenu_qt_loc ${third_party_loc}/libdbusmenu-qt/src) - set_target_properties(external_dbusmenu_qt_bundled PROPERTIES AUTOMOC ON) +set_target_properties(external_dbusmenu_qt_bundled PROPERTIES AUTOMOC ON) - # QIcon::name was introduced in Qt 4.7. - set(HAVE_QICON_NAME 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") +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 +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 ) - - 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 +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 +) diff --git a/external/expected/CMakeLists.txt b/external/expected/CMakeLists.txt index 10c2c26..ded6123 100644 --- a/external/expected/CMakeLists.txt +++ b/external/expected/CMakeLists.txt @@ -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() +target_include_directories(external_expected SYSTEM +INTERFACE + ${third_party_loc}/expected/include +) diff --git a/external/fcitx5_qt/CMakeLists.txt b/external/fcitx5_qt/CMakeLists.txt index b8b4c67..8827162 100644 --- a/external/fcitx5_qt/CMakeLists.txt +++ b/external/fcitx5_qt/CMakeLists.txt @@ -7,79 +7,80 @@ 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) + 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)") + +set(fcitx5_qt_loc ${third_party_loc}/fcitx5-qt) + +if (DESKTOP_APP_QT6) + set(fcitx5_qt_src ${fcitx5_qt_loc}/qt6/platforminputcontext) else() - add_library(external_fcitx5_qt STATIC) - add_library(desktop-app::external_fcitx5_qt ALIAS external_fcitx5_qt) - init_target(external_fcitx5_qt "(external)") + set(fcitx5_qt_src ${fcitx5_qt_loc}/qt5/platforminputcontext) +endif() - set(fcitx5_qt_loc ${third_party_loc}/fcitx5-qt) +set_target_properties(external_fcitx5_qt PROPERTIES AUTOMOC ON) +set(FCITX5_QT_EXTRA_PLUGIN_NAME "") - if (DESKTOP_APP_QT6) - set(fcitx5_qt_src ${fcitx5_qt_loc}/qt6/platforminputcontext) - else() - set(fcitx5_qt_src ${fcitx5_qt_loc}/qt5/platforminputcontext) - endif() +configure_file("${fcitx5_qt_src}/fcitx5.json.in" "${CMAKE_CURRENT_BINARY_DIR}/fcitx5.json") - set_target_properties(external_fcitx5_qt PROPERTIES AUTOMOC ON) - set(FCITX5_QT_EXTRA_PLUGIN_NAME "") +nice_target_sources(external_fcitx5_qt ${fcitx5_qt_src} +PRIVATE + qfcitxplatforminputcontext.cpp + qfcitxplatforminputcontext.h + fcitxcandidatewindow.cpp + fcitxcandidatewindow.h + fcitxtheme.cpp + fcitxtheme.h + font.cpp + font.h + qtkey.cpp + main.cpp + main.h +) - configure_file("${fcitx5_qt_src}/fcitx5.json.in" "${CMAKE_CURRENT_BINARY_DIR}/fcitx5.json") +target_include_directories(external_fcitx5_qt +PRIVATE + ${fcitx5_qt_src} + ${fcitx5_qt_loc}/common +) - nice_target_sources(external_fcitx5_qt ${fcitx5_qt_src} - PRIVATE - qfcitxplatforminputcontext.cpp - qfcitxplatforminputcontext.h - fcitxcandidatewindow.cpp - fcitxcandidatewindow.h - fcitxtheme.cpp - fcitxtheme.h - font.cpp - font.h - qtkey.cpp - main.cpp - main.h - ) +target_compile_definitions(external_fcitx5_qt +PRIVATE + QT_STATICPLUGIN + FCITX_PLUGIN_DATA_FILE_PATH="${CMAKE_CURRENT_BINARY_DIR}/fcitx5.json" +) - target_include_directories(external_fcitx5_qt - PRIVATE - ${fcitx5_qt_src} - ${fcitx5_qt_loc}/common - ) +add_subdirectory(fcitx5_qt_dbusaddons) +target_link_libraries(external_fcitx5_qt +PRIVATE + desktop-app::external_fcitx5_qt_dbusaddons + desktop-app::external_qt + desktop-app::external_xcb +) - target_compile_definitions(external_fcitx5_qt - PRIVATE - QT_STATICPLUGIN - FCITX_PLUGIN_DATA_FILE_PATH="${CMAKE_CURRENT_BINARY_DIR}/fcitx5.json" - ) +if (DESKTOP_APP_USE_PACKAGED) + find_package(PkgConfig REQUIRED) + pkg_check_modules(XKBCOMMON REQUIRED IMPORTED_TARGET xkbcommon) - add_subdirectory(fcitx5_qt_dbusaddons) target_link_libraries(external_fcitx5_qt PRIVATE - desktop-app::external_fcitx5_qt_dbusaddons - desktop-app::external_qt - desktop-app::external_xcb + PkgConfig::XKBCOMMON + ) +else() + find_package(PkgConfig REQUIRED) + pkg_check_modules(XKBCOMMON REQUIRED xkbcommon) + + target_include_directories(external_fcitx5_qt SYSTEM + PUBLIC + ${XKBCOMMON_INCLUDE_DIRS} ) - if (DESKTOP_APP_USE_PACKAGED) - find_package(PkgConfig REQUIRED) - pkg_check_modules(XKBCOMMON REQUIRED IMPORTED_TARGET xkbcommon) - - target_link_libraries(external_fcitx5_qt - PRIVATE - PkgConfig::XKBCOMMON - ) - else() - find_package(PkgConfig REQUIRED) - pkg_check_modules(XKBCOMMON REQUIRED xkbcommon) - - target_include_directories(external_fcitx5_qt SYSTEM - PUBLIC - ${XKBCOMMON_INCLUDE_DIRS} - ) - - target_link_static_libraries(external_fcitx5_qt - PRIVATE - xkbcommon - ) - endif() + target_link_static_libraries(external_fcitx5_qt + PRIVATE + xkbcommon + ) endif() diff --git a/external/fcitx5_qt/fcitx5_qt_dbusaddons/CMakeLists.txt b/external/fcitx5_qt/fcitx5_qt_dbusaddons/CMakeLists.txt index 9b15c46..53370f1 100644 --- a/external/fcitx5_qt/fcitx5_qt_dbusaddons/CMakeLists.txt +++ b/external/fcitx5_qt/fcitx5_qt_dbusaddons/CMakeLists.txt @@ -7,59 +7,60 @@ 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) + 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)") + +set(fcitx5_qt_loc ${third_party_loc}/fcitx5-qt) + +if (DESKTOP_APP_QT6) + set(fcitx5_qt_dbusaddons_src ${fcitx5_qt_loc}/qt6/dbusaddons) else() - 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)") + set(fcitx5_qt_dbusaddons_src ${fcitx5_qt_loc}/qt5/dbusaddons) +endif() - set(fcitx5_qt_loc ${third_party_loc}/fcitx5-qt) +set_target_properties(external_fcitx5_qt_dbusaddons PROPERTIES AUTOMOC ON) - if (DESKTOP_APP_QT6) - set(fcitx5_qt_dbusaddons_src ${fcitx5_qt_loc}/qt6/dbusaddons) - else() - set(fcitx5_qt_dbusaddons_src ${fcitx5_qt_loc}/qt5/dbusaddons) - endif() +nice_target_sources(external_fcitx5_qt_dbusaddons ${fcitx5_qt_dbusaddons_src} +PRIVATE + fcitxqtwatcher.cpp + fcitxqtwatcher.h + fcitxqtdbustypes.cpp + fcitxqtdbustypes.h + fcitxqtinputcontextproxy.cpp + fcitxqtinputcontextproxy.h + fcitxqtinputcontextproxyimpl.cpp + fcitxqtinputmethodproxy.cpp + fcitxqtinputmethodproxy.h + fcitxqtcontrollerproxy.cpp + fcitxqtcontrollerproxy.h +) - set_target_properties(external_fcitx5_qt_dbusaddons PROPERTIES AUTOMOC ON) +include(GenerateExportHeader) - nice_target_sources(external_fcitx5_qt_dbusaddons ${fcitx5_qt_dbusaddons_src} +if (DESKTOP_APP_QT6) + generate_export_header(external_fcitx5_qt_dbusaddons BASE_NAME Fcitx5Qt6DBusAddons) +else() + generate_export_header(external_fcitx5_qt_dbusaddons BASE_NAME Fcitx5Qt5DBusAddons) +endif() + +target_include_directories(external_fcitx5_qt_dbusaddons +PUBLIC + ${fcitx5_qt_dbusaddons_src} + "${CMAKE_CURRENT_BINARY_DIR}" +) + +if (NOT DESKTOP_APP_QT6) + target_compile_definitions(external_fcitx5_qt_dbusaddons PRIVATE - fcitxqtwatcher.cpp - fcitxqtwatcher.h - fcitxqtdbustypes.cpp - fcitxqtdbustypes.h - fcitxqtinputcontextproxy.cpp - fcitxqtinputcontextproxy.h - fcitxqtinputcontextproxyimpl.cpp - fcitxqtinputmethodproxy.cpp - fcitxqtinputmethodproxy.h - fcitxqtcontrollerproxy.cpp - fcitxqtcontrollerproxy.h - ) - - include(GenerateExportHeader) - - if (DESKTOP_APP_QT6) - generate_export_header(external_fcitx5_qt_dbusaddons BASE_NAME Fcitx5Qt6DBusAddons) - else() - generate_export_header(external_fcitx5_qt_dbusaddons BASE_NAME Fcitx5Qt5DBusAddons) - endif() - - target_include_directories(external_fcitx5_qt_dbusaddons - PUBLIC - ${fcitx5_qt_dbusaddons_src} - "${CMAKE_CURRENT_BINARY_DIR}" - ) - - if (NOT DESKTOP_APP_QT6) - target_compile_definitions(external_fcitx5_qt_dbusaddons - PRIVATE - FCITX5QT5DBUSADDONS_STATIC_DEFINE - ) - endif() - - target_link_libraries(external_fcitx5_qt_dbusaddons - PRIVATE - desktop-app::external_qt + FCITX5QT5DBUSADDONS_STATIC_DEFINE ) endif() + +target_link_libraries(external_fcitx5_qt_dbusaddons +PRIVATE + desktop-app::external_qt +) diff --git a/external/fcitx_qt5/CMakeLists.txt b/external/fcitx_qt5/CMakeLists.txt index f0e36cc..6cc0312 100644 --- a/external/fcitx_qt5/CMakeLists.txt +++ b/external/fcitx_qt5/CMakeLists.txt @@ -7,82 +7,83 @@ 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) + 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)") + +set(fcitx_qt5_loc ${third_party_loc}/fcitx-qt5) + +if (DESKTOP_APP_QT6) + set(fcitx_qt5_src ${fcitx_qt5_loc}/qt6/platforminputcontext) else() - add_library(external_fcitx_qt5 STATIC) - add_library(desktop-app::external_fcitx_qt5 ALIAS external_fcitx_qt5) - init_target(external_fcitx_qt5 "(external)") + set(fcitx_qt5_src ${fcitx_qt5_loc}/qt5/platforminputcontext) +endif() - set(fcitx_qt5_loc ${third_party_loc}/fcitx-qt5) +set_target_properties(external_fcitx_qt5 PROPERTIES AUTOMOC ON) - if (DESKTOP_APP_QT6) - set(fcitx_qt5_src ${fcitx_qt5_loc}/qt6/platforminputcontext) - else() - set(fcitx_qt5_src ${fcitx_qt5_loc}/qt5/platforminputcontext) - endif() +nice_target_sources(external_fcitx_qt5 ${fcitx_qt5_src} +PRIVATE + fcitxinputcontextproxy.cpp + fcitxqtdbustypes.cpp + fcitxwatcher.cpp + qfcitxplatforminputcontext.cpp + main.cpp + qtkey.cpp +) - set_target_properties(external_fcitx_qt5 PROPERTIES AUTOMOC ON) +set_source_files_properties(${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext.xml PROPERTIES +INCLUDE ${fcitx_qt5_src}/fcitxqtdbustypes.h) +set_source_files_properties(${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext1.xml PROPERTIES +INCLUDE ${fcitx_qt5_src}/fcitxqtdbustypes.h) +set_source_files_properties(${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod.xml PROPERTIES +INCLUDE ${fcitx_qt5_src}/fcitxqtdbustypes.h) +set_source_files_properties(${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod1.xml PROPERTIES +INCLUDE ${fcitx_qt5_src}/fcitxqtdbustypes.h) - nice_target_sources(external_fcitx_qt5 ${fcitx_qt5_src} - PRIVATE - fcitxinputcontextproxy.cpp - fcitxqtdbustypes.cpp - fcitxwatcher.cpp - qfcitxplatforminputcontext.cpp - main.cpp - qtkey.cpp - ) +if (DESKTOP_APP_QT6) + qt6_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext.xml inputcontextproxy) + qt6_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext1.xml inputcontext1proxy) + qt6_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod.xml inputmethodproxy) + qt6_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod1.xml inputmethod1proxy) +else() + qt5_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext.xml inputcontextproxy) + qt5_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext1.xml inputcontext1proxy) + qt5_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod.xml inputmethodproxy) + qt5_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod1.xml inputmethod1proxy) +endif() - set_source_files_properties(${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext.xml PROPERTIES - INCLUDE ${fcitx_qt5_src}/fcitxqtdbustypes.h) - set_source_files_properties(${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext1.xml PROPERTIES - INCLUDE ${fcitx_qt5_src}/fcitxqtdbustypes.h) - set_source_files_properties(${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod.xml PROPERTIES - INCLUDE ${fcitx_qt5_src}/fcitxqtdbustypes.h) - set_source_files_properties(${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod1.xml PROPERTIES - INCLUDE ${fcitx_qt5_src}/fcitxqtdbustypes.h) +target_sources(external_fcitx_qt5 PRIVATE ${fcitx_qt5_adaptors}) - if (DESKTOP_APP_QT6) - qt6_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext.xml inputcontextproxy) - qt6_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext1.xml inputcontext1proxy) - qt6_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod.xml inputmethodproxy) - qt6_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod1.xml inputmethod1proxy) - else() - qt5_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext.xml inputcontextproxy) - qt5_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputContext1.xml inputcontext1proxy) - qt5_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod.xml inputmethodproxy) - qt5_add_dbus_interface(fcitx_qt5_adaptors ${fcitx_qt5_src}/org.fcitx.Fcitx.InputMethod1.xml inputmethod1proxy) - endif() +target_include_directories(external_fcitx_qt5 +PRIVATE + ${fcitx_qt5_src} + "${CMAKE_CURRENT_BINARY_DIR}" +) - target_sources(external_fcitx_qt5 PRIVATE ${fcitx_qt5_adaptors}) +target_compile_definitions(external_fcitx_qt5 +PRIVATE + QT_STATICPLUGIN +) - target_include_directories(external_fcitx_qt5 - PRIVATE - ${fcitx_qt5_src} - "${CMAKE_CURRENT_BINARY_DIR}" - ) +target_link_libraries(external_fcitx_qt5 +PRIVATE + desktop-app::external_qt +) - target_compile_definitions(external_fcitx_qt5 - PRIVATE - QT_STATICPLUGIN - ) +if (DESKTOP_APP_USE_PACKAGED) + find_package(PkgConfig REQUIRED) + pkg_check_modules(XKBCOMMON REQUIRED IMPORTED_TARGET xkbcommon) target_link_libraries(external_fcitx_qt5 PRIVATE - desktop-app::external_qt + PkgConfig::XKBCOMMON + ) +else() + target_link_static_libraries(external_fcitx_qt5 + PRIVATE + xkbcommon ) - - if (DESKTOP_APP_USE_PACKAGED) - find_package(PkgConfig REQUIRED) - pkg_check_modules(XKBCOMMON REQUIRED IMPORTED_TARGET xkbcommon) - - target_link_libraries(external_fcitx_qt5 - PRIVATE - PkgConfig::XKBCOMMON - ) - else() - target_link_static_libraries(external_fcitx_qt5 - PRIVATE - xkbcommon - ) - endif() endif() diff --git a/external/hime_qt/CMakeLists.txt b/external/hime_qt/CMakeLists.txt index f1d1fcf..869b10f 100644 --- a/external/hime_qt/CMakeLists.txt +++ b/external/hime_qt/CMakeLists.txt @@ -7,38 +7,39 @@ 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() - add_library(external_hime_qt STATIC) - add_library(desktop-app::external_hime_qt ALIAS external_hime_qt) - init_target(external_hime_qt "(external)") - - set(hime_loc ${third_party_loc}/hime) - set(hime_qt_src ${hime_loc}/src/qt5-im) - - set_target_properties(external_hime_qt PROPERTIES AUTOMOC ON) - - nice_target_sources(external_hime_qt ${hime_qt_src} - PRIVATE - hime-imcontext-qt.cpp - hime-imcontext-qt.h - hime-qt.cpp - hime-qt.h - ) - - target_include_directories(external_hime_qt - PRIVATE - ${hime_qt_src} - ) - - target_compile_definitions(external_hime_qt - PRIVATE - QT_STATICPLUGIN - ) - - add_subdirectory(hime_im_client) - target_link_libraries(external_hime_qt - PRIVATE - desktop-app::external_hime_im_client - desktop-app::external_qt - ) + 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)") + +set(hime_loc ${third_party_loc}/hime) +set(hime_qt_src ${hime_loc}/src/qt5-im) + +set_target_properties(external_hime_qt PROPERTIES AUTOMOC ON) + +nice_target_sources(external_hime_qt ${hime_qt_src} +PRIVATE + hime-imcontext-qt.cpp + hime-imcontext-qt.h + hime-qt.cpp + hime-qt.h +) + +target_include_directories(external_hime_qt +PRIVATE + ${hime_qt_src} +) + +target_compile_definitions(external_hime_qt +PRIVATE + QT_STATICPLUGIN +) + +add_subdirectory(hime_im_client) +target_link_libraries(external_hime_qt +PRIVATE + desktop-app::external_hime_im_client + desktop-app::external_qt +) diff --git a/external/hime_qt/hime_im_client/CMakeLists.txt b/external/hime_qt/hime_im_client/CMakeLists.txt index fd4f0b7..a5017c3 100644 --- a/external/hime_qt/hime_im_client/CMakeLists.txt +++ b/external/hime_qt/hime_im_client/CMakeLists.txt @@ -7,29 +7,30 @@ 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() - 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)") - - set(hime_loc ${third_party_loc}/hime) - set(hime_im_client_src ${hime_loc}/src/im-client) - - nice_target_sources(external_hime_im_client ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE - hime_im_client_helper.cpp - ) - - target_include_directories(external_hime_im_client - PUBLIC - ${hime_im_client_src} - ) - - find_package(PkgConfig REQUIRED) - pkg_check_modules(X11 REQUIRED x11) - - target_include_directories(external_hime_im_client SYSTEM - PRIVATE - ${X11_INCLUDE_DIRS} - ) + 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)") + +set(hime_loc ${third_party_loc}/hime) +set(hime_im_client_src ${hime_loc}/src/im-client) + +nice_target_sources(external_hime_im_client ${CMAKE_CURRENT_SOURCE_DIR} +PRIVATE + hime_im_client_helper.cpp +) + +target_include_directories(external_hime_im_client +PUBLIC + ${hime_im_client_src} +) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(X11 REQUIRED x11) + +target_include_directories(external_hime_im_client SYSTEM +PRIVATE + ${X11_INCLUDE_DIRS} +) diff --git a/external/hunspell/CMakeLists.txt b/external/hunspell/CMakeLists.txt index d57acf7..eac7373 100644 --- a/external/hunspell/CMakeLists.txt +++ b/external/hunspell/CMakeLists.txt @@ -13,59 +13,58 @@ 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)") +add_library(external_hunspell_bundled STATIC) +init_target(external_hunspell_bundled "(external)") - set(hunspell_loc ${third_party_loc}/hunspell) - set(hunspell_src ${hunspell_loc}/src) +set(hunspell_loc ${third_party_loc}/hunspell) +set(hunspell_src ${hunspell_loc}/src) - nice_target_sources(external_hunspell_bundled ${hunspell_src} - PRIVATE - hunspell/affentry.cxx - hunspell/affentry.hxx - hunspell/affixmgr.cxx - hunspell/affixmgr.hxx - hunspell/atypes.hxx - hunspell/baseaffix.hxx - hunspell/csutil.cxx - hunspell/csutil.hxx - hunspell/filemgr.cxx - hunspell/filemgr.hxx - hunspell/hashmgr.cxx - hunspell/hashmgr.hxx - hunspell/htypes.hxx - hunspell/hunspell.cxx - hunspell/hunspell.h - hunspell/hunspell.hxx - hunspell/hunvisapi.h - hunspell/hunzip.cxx - hunspell/hunzip.hxx - hunspell/phonet.cxx - hunspell/phonet.hxx - hunspell/replist.cxx - hunspell/replist.hxx - hunspell/suggestmgr.cxx - hunspell/suggestmgr.hxx - hunspell/utf_info.hxx - ) +nice_target_sources(external_hunspell_bundled ${hunspell_src} +PRIVATE + hunspell/affentry.cxx + hunspell/affentry.hxx + hunspell/affixmgr.cxx + hunspell/affixmgr.hxx + hunspell/atypes.hxx + hunspell/baseaffix.hxx + hunspell/csutil.cxx + hunspell/csutil.hxx + hunspell/filemgr.cxx + hunspell/filemgr.hxx + hunspell/hashmgr.cxx + hunspell/hashmgr.hxx + hunspell/htypes.hxx + hunspell/hunspell.cxx + hunspell/hunspell.h + hunspell/hunspell.hxx + hunspell/hunvisapi.h + hunspell/hunzip.cxx + hunspell/hunzip.hxx + hunspell/phonet.cxx + hunspell/phonet.hxx + hunspell/replist.cxx + hunspell/replist.hxx + hunspell/suggestmgr.cxx + hunspell/suggestmgr.hxx + hunspell/utf_info.hxx +) - target_include_directories(external_hunspell_bundled - PUBLIC - ${hunspell_src} - ) +target_include_directories(external_hunspell_bundled +PUBLIC + ${hunspell_src} +) - target_compile_definitions(external_hunspell_bundled - PUBLIC - HUNSPELL_STATIC - MAXSUGGESTION=5 - ) +target_compile_definitions(external_hunspell_bundled +PUBLIC + HUNSPELL_STATIC + MAXSUGGESTION=5 +) - target_link_libraries(external_hunspell - INTERFACE - external_hunspell_bundled - ) -endif() +target_link_libraries(external_hunspell +INTERFACE + external_hunspell_bundled +) diff --git a/external/lz4/CMakeLists.txt b/external/lz4/CMakeLists.txt index 59e63ed..17a77d7 100644 --- a/external/lz4/CMakeLists.txt +++ b/external/lz4/CMakeLists.txt @@ -13,35 +13,34 @@ 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)") +add_library(external_lz4_bundled STATIC) +init_target(external_lz4_bundled "(external)") - set(lz4_loc ${third_party_loc}/lz4/lib) +set(lz4_loc ${third_party_loc}/lz4/lib) - target_sources(external_lz4_bundled - PRIVATE - ${lz4_loc}/lz4.c - ${lz4_loc}/lz4.h - ${lz4_loc}/lz4frame.c - ${lz4_loc}/lz4frame.h - ${lz4_loc}/lz4frame_static.h - ${lz4_loc}/lz4hc.c - ${lz4_loc}/lz4hc.h - ${lz4_loc}/xxhash.c - ${lz4_loc}/xxhash.h - ) +target_sources(external_lz4_bundled +PRIVATE + ${lz4_loc}/lz4.c + ${lz4_loc}/lz4.h + ${lz4_loc}/lz4frame.c + ${lz4_loc}/lz4frame.h + ${lz4_loc}/lz4frame_static.h + ${lz4_loc}/lz4hc.c + ${lz4_loc}/lz4hc.h + ${lz4_loc}/xxhash.c + ${lz4_loc}/xxhash.h +) - target_include_directories(external_lz4_bundled - PUBLIC - ${lz4_loc} - ) +target_include_directories(external_lz4_bundled +PUBLIC + ${lz4_loc} +) - target_link_libraries(external_lz4 - INTERFACE - external_lz4_bundled - ) -endif() +target_link_libraries(external_lz4 +INTERFACE + external_lz4_bundled +) diff --git a/external/minizip/CMakeLists.txt b/external/minizip/CMakeLists.txt index b9f8596..cf77a71 100644 --- a/external/minizip/CMakeLists.txt +++ b/external/minizip/CMakeLists.txt @@ -13,40 +13,40 @@ 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) - add_library(external_minizip_bundled STATIC) - init_target(external_minizip_bundled "(external)") - - set(minizip_loc ${third_party_loc}/minizip) - - target_sources(external_minizip_bundled - PRIVATE - ${minizip_loc}/crypt.h - ${minizip_loc}/ioapi.c - ${minizip_loc}/ioapi.h - ${minizip_loc}/zip.c - ${minizip_loc}/zip.h - ${minizip_loc}/unzip.c - ${minizip_loc}/unzip.h - ) - - target_include_directories(external_minizip_bundled SYSTEM - PUBLIC - ${minizip_loc} - ) - - target_link_libraries(external_minizip - INTERFACE - external_minizip_bundled - ) - else() - target_include_directories(external_minizip SYSTEM - INTERFACE - ${libs_loc}/zlib/contrib/minizip - ) - endif() +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)") + +set(minizip_loc ${third_party_loc}/minizip) + +target_sources(external_minizip_bundled +PRIVATE + ${minizip_loc}/crypt.h + ${minizip_loc}/ioapi.c + ${minizip_loc}/ioapi.h + ${minizip_loc}/zip.c + ${minizip_loc}/zip.h + ${minizip_loc}/unzip.c + ${minizip_loc}/unzip.h +) + +target_include_directories(external_minizip_bundled SYSTEM +PUBLIC + ${minizip_loc} +) + +target_link_libraries(external_minizip +INTERFACE + external_minizip_bundled +) diff --git a/external/nimf_qt5/CMakeLists.txt b/external/nimf_qt5/CMakeLists.txt index 7c4d569..c409663 100644 --- a/external/nimf_qt5/CMakeLists.txt +++ b/external/nimf_qt5/CMakeLists.txt @@ -7,43 +7,44 @@ 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() - add_library(external_nimf_qt5 STATIC) - add_library(desktop-app::external_nimf_qt5 ALIAS external_nimf_qt5) - init_target(external_nimf_qt5 "(external)") - - set(nimf_loc ${third_party_loc}/nimf) - set(libnimf_src ${nimf_loc}/libnimf) - set(nimf_qt5_src ${nimf_loc}/modules/clients/qt5) - - set_target_properties(external_nimf_qt5 PROPERTIES AUTOMOC ON) - - nice_target_sources(external_nimf_qt5 ${nimf_qt5_src} - PRIVATE - im-nimf-qt5.cpp - ) - - find_package(PkgConfig REQUIRED) - pkg_check_modules(GIO REQUIRED gio-2.0) - - target_include_directories(external_nimf_qt5 - PRIVATE - ${nimf_qt5_src} - ${libnimf_src} - ${GIO_INCLUDE_DIRS} - ) - - target_compile_definitions(external_nimf_qt5 - PRIVATE - QT_STATICPLUGIN - QT_NO_KEYWORDS - G_LOG_DOMAIN="nimf" - NIMF_COMPILATION - USE_DLFCN - ) - - target_link_libraries(external_nimf_qt5 - PRIVATE - desktop-app::external_qt - ) + 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)") + +set(nimf_loc ${third_party_loc}/nimf) +set(libnimf_src ${nimf_loc}/libnimf) +set(nimf_qt5_src ${nimf_loc}/modules/clients/qt5) + +set_target_properties(external_nimf_qt5 PROPERTIES AUTOMOC ON) + +nice_target_sources(external_nimf_qt5 ${nimf_qt5_src} +PRIVATE + im-nimf-qt5.cpp +) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(GIO REQUIRED gio-2.0) + +target_include_directories(external_nimf_qt5 +PRIVATE + ${nimf_qt5_src} + ${libnimf_src} + ${GIO_INCLUDE_DIRS} +) + +target_compile_definitions(external_nimf_qt5 +PRIVATE + QT_STATICPLUGIN + QT_NO_KEYWORDS + G_LOG_DOMAIN="nimf" + NIMF_COMPILATION + USE_DLFCN +) + +target_link_libraries(external_nimf_qt5 +PRIVATE + desktop-app::external_qt +) diff --git a/external/openssl/openssl_crypto/CMakeLists.txt b/external/openssl/openssl_crypto/CMakeLists.txt index 914102b..8ffc591 100644 --- a/external/openssl/openssl_crypto/CMakeLists.txt +++ b/external/openssl/openssl_crypto/CMakeLists.txt @@ -10,22 +10,23 @@ if (DESKTOP_APP_USE_PACKAGED) find_package(OpenSSL REQUIRED) target_link_libraries(external_openssl_crypto INTERFACE OpenSSL::Crypto) -else() - add_library(external_openssl_crypto STATIC IMPORTED GLOBAL) - add_library(desktop-app::external_openssl_crypto ALIAS external_openssl_crypto) + return() +endif() +add_library(external_openssl_crypto STATIC IMPORTED GLOBAL) +add_library(desktop-app::external_openssl_crypto ALIAS external_openssl_crypto) + +set_target_properties(external_openssl_crypto PROPERTIES + IMPORTED_LOCATION "${openssl_lib_loc}/libcrypto.${openssl_lib_ext}" +) + +if (WIN32) set_target_properties(external_openssl_crypto PROPERTIES - IMPORTED_LOCATION "${openssl_lib_loc}/libcrypto.${openssl_lib_ext}" - ) - - if (WIN32) - set_target_properties(external_openssl_crypto PROPERTIES - IMPORTED_LOCATION_DEBUG "${openssl_lib_loc}.dbg/libcrypto.${openssl_lib_ext}" - ) - endif() - - target_link_libraries(external_openssl_crypto - INTERFACE - desktop-app::external_openssl_common + IMPORTED_LOCATION_DEBUG "${openssl_lib_loc}.dbg/libcrypto.${openssl_lib_ext}" ) endif() + +target_link_libraries(external_openssl_crypto +INTERFACE + desktop-app::external_openssl_common +) diff --git a/external/openssl/openssl_ssl/CMakeLists.txt b/external/openssl/openssl_ssl/CMakeLists.txt index aa7ed33..4200869 100644 --- a/external/openssl/openssl_ssl/CMakeLists.txt +++ b/external/openssl/openssl_ssl/CMakeLists.txt @@ -10,22 +10,23 @@ if (DESKTOP_APP_USE_PACKAGED) find_package(OpenSSL REQUIRED) target_link_libraries(external_openssl_ssl INTERFACE OpenSSL::SSL) -else() - add_library(external_openssl_ssl STATIC IMPORTED GLOBAL) - add_library(desktop-app::external_openssl_ssl ALIAS external_openssl_ssl) + return() +endif() +add_library(external_openssl_ssl STATIC IMPORTED GLOBAL) +add_library(desktop-app::external_openssl_ssl ALIAS external_openssl_ssl) + +set_target_properties(external_openssl_ssl PROPERTIES + IMPORTED_LOCATION "${openssl_lib_loc}/libssl.${openssl_lib_ext}" +) + +if (WIN32) set_target_properties(external_openssl_ssl PROPERTIES - IMPORTED_LOCATION "${openssl_lib_loc}/libssl.${openssl_lib_ext}" - ) - - if (WIN32) - set_target_properties(external_openssl_ssl PROPERTIES - IMPORTED_LOCATION_DEBUG "${openssl_lib_loc}.dbg/libssl.${openssl_lib_ext}" - ) - endif() - - target_link_libraries(external_openssl_ssl - INTERFACE - desktop-app::external_openssl_common + IMPORTED_LOCATION_DEBUG "${openssl_lib_loc}.dbg/libssl.${openssl_lib_ext}" ) endif() + +target_link_libraries(external_openssl_ssl +INTERFACE + desktop-app::external_openssl_common +) diff --git a/external/opus/CMakeLists.txt b/external/opus/CMakeLists.txt index b1b25b2..c9a7d8e 100644 --- a/external/opus/CMakeLists.txt +++ b/external/opus/CMakeLists.txt @@ -12,36 +12,37 @@ if (DESKTOP_APP_USE_PACKAGED) pkg_check_modules(OPUS IMPORTED_TARGET opus) target_link_libraries(external_opus INTERFACE PkgConfig::OPUS) -else() - add_library(external_opus STATIC IMPORTED GLOBAL) - add_library(desktop-app::external_opus ALIAS external_opus) - - if (WIN32) - target_include_directories(external_opus SYSTEM - INTERFACE - ${libs_loc}/opus/include - ) - set(opus_lib_loc ${libs_loc}/opus/out) - set_target_properties(external_opus PROPERTIES - IMPORTED_LOCATION "${opus_lib_loc}/Release/opus.lib" - IMPORTED_LOCATION_DEBUG "${opus_lib_loc}/Debug/opus.lib" - ) - elseif (APPLE) - target_include_directories(external_opus SYSTEM - INTERFACE - ${libs_loc}/local/include/opus - ) - set_target_properties(external_opus PROPERTIES - IMPORTED_LOCATION ${libs_loc}/local/lib/libopus.a - ) - else() - target_include_directories(external_opus SYSTEM - INTERFACE - /usr/local/include/opus - ) - find_library(OPUS_LIBRARY libopus.a REQUIRED) - set_target_properties(external_opus PROPERTIES - IMPORTED_LOCATION "${OPUS_LIBRARY}" - ) - endif() + return() +endif() + +add_library(external_opus STATIC IMPORTED GLOBAL) +add_library(desktop-app::external_opus ALIAS external_opus) + +if (WIN32) + target_include_directories(external_opus SYSTEM + INTERFACE + ${libs_loc}/opus/include + ) + set(opus_lib_loc ${libs_loc}/opus/out) + set_target_properties(external_opus PROPERTIES + IMPORTED_LOCATION "${opus_lib_loc}/Release/opus.lib" + IMPORTED_LOCATION_DEBUG "${opus_lib_loc}/Debug/opus.lib" + ) +elseif (APPLE) + target_include_directories(external_opus SYSTEM + INTERFACE + ${libs_loc}/local/include/opus + ) + set_target_properties(external_opus PROPERTIES + IMPORTED_LOCATION ${libs_loc}/local/lib/libopus.a + ) +else() + target_include_directories(external_opus SYSTEM + INTERFACE + /usr/local/include/opus + ) + find_library(OPUS_LIBRARY libopus.a REQUIRED) + set_target_properties(external_opus PROPERTIES + IMPORTED_LOCATION "${OPUS_LIBRARY}" + ) endif() diff --git a/external/qr_code_generator/CMakeLists.txt b/external/qr_code_generator/CMakeLists.txt index aaa733c..b75b7ae 100644 --- a/external/qr_code_generator/CMakeLists.txt +++ b/external/qr_code_generator/CMakeLists.txt @@ -14,29 +14,28 @@ 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)") +add_library(external_qr_code_generator_bundled STATIC) +init_target(external_qr_code_generator_bundled "(external)") - set(qr_loc ${third_party_loc}/QR) - set(qr_src ${qr_loc}/cpp) +set(qr_loc ${third_party_loc}/QR) +set(qr_src ${qr_loc}/cpp) - nice_target_sources(external_qr_code_generator_bundled ${qr_src} - PRIVATE - qrcodegen.cpp - qrcodegen.hpp - ) +nice_target_sources(external_qr_code_generator_bundled ${qr_src} +PRIVATE + qrcodegen.cpp + qrcodegen.hpp +) - target_include_directories(external_qr_code_generator_bundled - PUBLIC - ${qr_src} - ) +target_include_directories(external_qr_code_generator_bundled +PUBLIC + ${qr_src} +) - target_link_libraries(external_qr_code_generator - INTERFACE - external_qr_code_generator_bundled - ) -endif() +target_link_libraries(external_qr_code_generator +INTERFACE + external_qr_code_generator_bundled +) diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index c478209..53c3401 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -50,262 +50,264 @@ if (DESKTOP_APP_USE_PACKAGED) ${Qt5WaylandClient_PRIVATE_INCLUDE_DIRS} ) endif() -else() + + return() +endif() + +target_include_directories(external_qt SYSTEM +INTERFACE + ${qt_loc}/include + ${qt_loc}/include/QtCore + ${qt_loc}/include/QtGui + ${qt_loc}/include/QtWidgets + ${qt_loc}/include/QtSvg + ${qt_loc}/include/QtCore/${qt_version} + ${qt_loc}/include/QtGui/${qt_version} + ${qt_loc}/include/QtCore/${qt_version}/QtCore + ${qt_loc}/include/QtGui/${qt_version}/QtGui +) + +if (Qt5DBus_FOUND) target_include_directories(external_qt SYSTEM INTERFACE - ${qt_loc}/include - ${qt_loc}/include/QtCore - ${qt_loc}/include/QtGui - ${qt_loc}/include/QtWidgets - ${qt_loc}/include/QtSvg - ${qt_loc}/include/QtCore/${qt_version} - ${qt_loc}/include/QtGui/${qt_version} - ${qt_loc}/include/QtCore/${qt_version}/QtCore - ${qt_loc}/include/QtGui/${qt_version}/QtGui + ${qt_loc}/include/QtDBus ) +endif() - if (Qt5DBus_FOUND) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/include/QtDBus - ) - endif() +if (Qt5XkbCommonSupport_FOUND) + target_include_directories(external_qt SYSTEM + INTERFACE + ${qt_loc}/include/QtXkbCommonSupport + ${qt_loc}/include/QtXkbCommonSupport/${qt_version} + ${qt_loc}/include/QtXkbCommonSupport/${qt_version}/QtXkbCommonSupport + ) +endif() - if (Qt5XkbCommonSupport_FOUND) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/include/QtXkbCommonSupport - ${qt_loc}/include/QtXkbCommonSupport/${qt_version} - ${qt_loc}/include/QtXkbCommonSupport/${qt_version}/QtXkbCommonSupport - ) - endif() +if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) + target_include_directories(external_qt SYSTEM + INTERFACE + ${qt_loc}/include/QtWaylandClient + ${qt_loc}/include/QtWaylandClient/${qt_version} + ${qt_loc}/include/QtWaylandClient/${qt_version}/QtWaylandClient + ) +endif() - if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/include/QtWaylandClient - ${qt_loc}/include/QtWaylandClient/${qt_version} - ${qt_loc}/include/QtWaylandClient/${qt_version}/QtWaylandClient - ) - endif() +target_compile_definitions(external_qt +INTERFACE + _REENTRANT + QT_STATICPLUGIN + QT_PLUGIN + QT_WIDGETS_LIB + QT_NETWORK_LIB + QT_GUI_LIB + QT_CORE_LIB + QT_SVG_LIB +) +if (Qt5DBus_FOUND) target_compile_definitions(external_qt INTERFACE - _REENTRANT - QT_STATICPLUGIN - QT_PLUGIN - QT_WIDGETS_LIB - QT_NETWORK_LIB - QT_GUI_LIB - QT_CORE_LIB - QT_SVG_LIB + QT_DBUS_LIB ) +endif() - if (Qt5DBus_FOUND) - target_compile_definitions(external_qt - INTERFACE - QT_DBUS_LIB - ) - endif() - - if (Qt5XkbCommonSupport_FOUND) - target_compile_definitions(external_qt - INTERFACE - QT_XKBCOMMON_SUPPORT_LIB - ) - endif() - - if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) - target_compile_definitions(external_qt - INTERFACE - QT_WAYLANDCLIENT_LIB - ) - endif() - - if (WIN32) - set(qt_lib_prefix "") - set(qt_lib_suffix $<$:d>.lib) - else() - set(qt_lib_prefix lib) - if (APPLE) - set(qt_lib_suffix $<$:_debug>.a) - else() - set(qt_lib_suffix .a) - endif() - endif() - - set(common_qt_libs - plugins/bearer/${qt_lib_prefix}qgenericbearer - plugins/imageformats/${qt_lib_prefix}qwebp - plugins/imageformats/${qt_lib_prefix}qgif - plugins/imageformats/${qt_lib_prefix}qjpeg - lib/${qt_lib_prefix}Qt5PrintSupport - lib/${qt_lib_prefix}Qt5AccessibilitySupport - lib/${qt_lib_prefix}Qt5FontDatabaseSupport - lib/${qt_lib_prefix}Qt5EventDispatcherSupport - lib/${qt_lib_prefix}Qt5ThemeSupport - lib/${qt_lib_prefix}Qt5Network - lib/${qt_lib_prefix}Qt5Widgets - lib/${qt_lib_prefix}Qt5Gui - lib/${qt_lib_prefix}Qt5Svg - lib/${qt_lib_prefix}qtharfbuzz - lib/${qt_lib_prefix}qtlibpng +if (Qt5XkbCommonSupport_FOUND) + target_compile_definitions(external_qt + INTERFACE + QT_XKBCOMMON_SUPPORT_LIB ) +endif() - set(qt_libs_list "") - if (WIN32) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/mkspecs/win32-msvc - ) - set(qt_libs - ${common_qt_libs} - lib/${qt_lib_prefix}Qt5Core - lib/${qt_lib_prefix}Qt5WindowsUIAutomationSupport - lib/${qt_lib_prefix}qtmain - lib/${qt_lib_prefix}qtfreetype - lib/${qt_lib_prefix}qtpcre2 - plugins/platforms/${qt_lib_prefix}qwindows - ) - foreach (lib ${qt_libs}) - list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") - endforeach() +if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) + target_compile_definitions(external_qt + INTERFACE + QT_WAYLANDCLIENT_LIB + ) +endif() - target_link_libraries(external_qt - INTERFACE - desktop-app::external_angle - ) - elseif (APPLE) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/mkspecs/macx-clang - ) - set(qt_libs - ${common_qt_libs} - lib/${qt_lib_prefix}Qt5Core - lib/${qt_lib_prefix}Qt5GraphicsSupport - lib/${qt_lib_prefix}Qt5ClipboardSupport - lib/${qt_lib_prefix}qtfreetype - lib/${qt_lib_prefix}qtpcre2 - plugins/platforms/${qt_lib_prefix}qcocoa - ) - foreach (lib ${qt_libs}) - list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") - endforeach() - target_link_libraries(external_qt - INTERFACE - cups - ) +if (WIN32) + set(qt_lib_prefix "") + set(qt_lib_suffix $<$:d>.lib) +else() + set(qt_lib_prefix lib) + if (APPLE) + set(qt_lib_suffix $<$:_debug>.a) else() - set(qt_libs_dbus) - set(qt_libs_dbus_support) - set(qt_libs_dbus_plugins) - set(qt_libs_dbus_bearers) - if (Qt5DBus_FOUND) - set(qt_libs_dbus lib/${qt_lib_prefix}Qt5DBus) - set(qt_libs_dbus_support lib/${qt_lib_prefix}Qt5LinuxAccessibilitySupport) - set(qt_libs_dbus_plugins - plugins/platforminputcontexts/${qt_lib_prefix}ibusplatforminputcontextplugin - ) - set(qt_libs_dbus_bearers - plugins/bearer/${qt_lib_prefix}qconnmanbearer - plugins/bearer/${qt_lib_prefix}qnmbearer - ) - endif() - set(qt_libs_waylandclient) - set(qt_libs_waylandclient_plugins) - if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) - set(qt_libs_waylandclient lib/${qt_lib_prefix}Qt5WaylandClient) - set(qt_libs_waylandclient_plugins - plugins/platforms/${qt_lib_prefix}qwayland-generic - plugins/platforms/${qt_lib_prefix}qwayland-egl - plugins/wayland-graphics-integration-client/${qt_lib_prefix}qt-plugin-wayland-egl - plugins/wayland-decoration-client/${qt_lib_prefix}bradient - ) - endif() - set(qt_libs - plugins/platforminputcontexts/${qt_lib_prefix}composeplatforminputcontextplugin - ${qt_libs_dbus_plugins} - ${qt_libs_waylandclient_plugins} - plugins/platformthemes/${qt_lib_prefix}qgtk3 - plugins/platforms/${qt_lib_prefix}qxcb - plugins/xcbglintegrations/${qt_lib_prefix}qxcb-egl-integration - plugins/xcbglintegrations/${qt_lib_prefix}qxcb-glx-integration - plugins/iconengines/${qt_lib_prefix}qsvgicon - lib/${qt_lib_prefix}Qt5XcbQpa - lib/${qt_lib_prefix}Qt5EglSupport - lib/${qt_lib_prefix}Qt5GlxSupport - lib/${qt_lib_prefix}Qt5ServiceSupport - lib/${qt_lib_prefix}Qt5EdidSupport - lib/${qt_lib_prefix}Qt5XkbCommonSupport - ${qt_libs_dbus_support} - ${qt_libs_dbus_bearers} - ${qt_libs_waylandclient} - lib/${qt_lib_prefix}Qt5ServiceSupport - ${common_qt_libs} - ${qt_libs_dbus} - lib/${qt_lib_prefix}Qt5Core - lib/${qt_lib_prefix}qtpcre2 - ) - foreach (lib ${qt_libs}) - list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") - endforeach() + set(qt_lib_suffix .a) endif() +endif() + +set(common_qt_libs + plugins/bearer/${qt_lib_prefix}qgenericbearer + plugins/imageformats/${qt_lib_prefix}qwebp + plugins/imageformats/${qt_lib_prefix}qgif + plugins/imageformats/${qt_lib_prefix}qjpeg + lib/${qt_lib_prefix}Qt5PrintSupport + lib/${qt_lib_prefix}Qt5AccessibilitySupport + lib/${qt_lib_prefix}Qt5FontDatabaseSupport + lib/${qt_lib_prefix}Qt5EventDispatcherSupport + lib/${qt_lib_prefix}Qt5ThemeSupport + lib/${qt_lib_prefix}Qt5Network + lib/${qt_lib_prefix}Qt5Widgets + lib/${qt_lib_prefix}Qt5Gui + lib/${qt_lib_prefix}Qt5Svg + lib/${qt_lib_prefix}qtharfbuzz + lib/${qt_lib_prefix}qtlibpng +) + +set(qt_libs_list "") +if (WIN32) + target_include_directories(external_qt SYSTEM + INTERFACE + ${qt_loc}/mkspecs/win32-msvc + ) + set(qt_libs + ${common_qt_libs} + lib/${qt_lib_prefix}Qt5Core + lib/${qt_lib_prefix}Qt5WindowsUIAutomationSupport + lib/${qt_lib_prefix}qtmain + lib/${qt_lib_prefix}qtfreetype + lib/${qt_lib_prefix}qtpcre2 + plugins/platforms/${qt_lib_prefix}qwindows + ) + foreach (lib ${qt_libs}) + list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") + endforeach() target_link_libraries(external_qt INTERFACE - ${qt_libs_list} - desktop-app::external_openssl - $ - $ - desktop-app::external_jpeg - desktop-app::external_zlib - $ + desktop-app::external_angle ) - - if (LINUX) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/mkspecs/linux-g++ +elseif (APPLE) + target_include_directories(external_qt SYSTEM + INTERFACE + ${qt_loc}/mkspecs/macx-clang + ) + set(qt_libs + ${common_qt_libs} + lib/${qt_lib_prefix}Qt5Core + lib/${qt_lib_prefix}Qt5GraphicsSupport + lib/${qt_lib_prefix}Qt5ClipboardSupport + lib/${qt_lib_prefix}qtfreetype + lib/${qt_lib_prefix}qtpcre2 + plugins/platforms/${qt_lib_prefix}qcocoa + ) + foreach (lib ${qt_libs}) + list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") + endforeach() + target_link_libraries(external_qt + INTERFACE + cups + ) +else() + set(qt_libs_dbus) + set(qt_libs_dbus_support) + set(qt_libs_dbus_plugins) + set(qt_libs_dbus_bearers) + if (Qt5DBus_FOUND) + set(qt_libs_dbus lib/${qt_lib_prefix}Qt5DBus) + set(qt_libs_dbus_support lib/${qt_lib_prefix}Qt5LinuxAccessibilitySupport) + set(qt_libs_dbus_plugins + plugins/platforminputcontexts/${qt_lib_prefix}ibusplatforminputcontextplugin ) - target_link_static_libraries(external_qt - INTERFACE - proxy - epoxy - xkbcommon - xkbcommon-x11 - xcb-glx - xcb-xkb - xcb-randr - xcb-icccm - xcb-shm - xcb-render - xcb-image - xcb-xfixes - xcb-xinerama - xcb-xinput - xcb-shape - xcb-sync - xcb-util - xcb-render-util - xcb-keysyms - ) - if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) - target_link_libraries(external_qt - INTERFACE - desktop-app::linux_wayland_helper - $ - ) - endif() - target_link_libraries(external_qt - INTERFACE - desktop-app::linux_xcb_helper - $ - fontconfig - freetype - xcb - X11 - X11-xcb + set(qt_libs_dbus_bearers + plugins/bearer/${qt_lib_prefix}qconnmanbearer + plugins/bearer/${qt_lib_prefix}qnmbearer ) endif() + set(qt_libs_waylandclient) + set(qt_libs_waylandclient_plugins) + if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) + set(qt_libs_waylandclient lib/${qt_lib_prefix}Qt5WaylandClient) + set(qt_libs_waylandclient_plugins + plugins/platforms/${qt_lib_prefix}qwayland-generic + plugins/platforms/${qt_lib_prefix}qwayland-egl + plugins/wayland-graphics-integration-client/${qt_lib_prefix}qt-plugin-wayland-egl + plugins/wayland-decoration-client/${qt_lib_prefix}bradient + ) + endif() + set(qt_libs + plugins/platforminputcontexts/${qt_lib_prefix}composeplatforminputcontextplugin + ${qt_libs_dbus_plugins} + ${qt_libs_waylandclient_plugins} + plugins/platformthemes/${qt_lib_prefix}qgtk3 + plugins/platforms/${qt_lib_prefix}qxcb + plugins/xcbglintegrations/${qt_lib_prefix}qxcb-egl-integration + plugins/xcbglintegrations/${qt_lib_prefix}qxcb-glx-integration + plugins/iconengines/${qt_lib_prefix}qsvgicon + lib/${qt_lib_prefix}Qt5XcbQpa + lib/${qt_lib_prefix}Qt5EglSupport + lib/${qt_lib_prefix}Qt5GlxSupport + lib/${qt_lib_prefix}Qt5ServiceSupport + lib/${qt_lib_prefix}Qt5EdidSupport + lib/${qt_lib_prefix}Qt5XkbCommonSupport + ${qt_libs_dbus_support} + ${qt_libs_dbus_bearers} + ${qt_libs_waylandclient} + lib/${qt_lib_prefix}Qt5ServiceSupport + ${common_qt_libs} + ${qt_libs_dbus} + lib/${qt_lib_prefix}Qt5Core + lib/${qt_lib_prefix}qtpcre2 + ) + foreach (lib ${qt_libs}) + list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") + endforeach() +endif() + +target_link_libraries(external_qt +INTERFACE + ${qt_libs_list} + desktop-app::external_openssl + $ + $ + desktop-app::external_jpeg + desktop-app::external_zlib + $ +) + +if (LINUX) + target_include_directories(external_qt SYSTEM + INTERFACE + ${qt_loc}/mkspecs/linux-g++ + ) + target_link_static_libraries(external_qt + INTERFACE + proxy + epoxy + xkbcommon + xkbcommon-x11 + xcb-glx + xcb-xkb + xcb-randr + xcb-icccm + xcb-shm + xcb-render + xcb-image + xcb-xfixes + xcb-xinerama + xcb-xinput + xcb-shape + xcb-sync + xcb-util + xcb-render-util + xcb-keysyms + ) + if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) + target_link_libraries(external_qt + INTERFACE + desktop-app::linux_wayland_helper + $ + ) + endif() + target_link_libraries(external_qt + INTERFACE + desktop-app::linux_xcb_helper + $ + fontconfig + freetype + xcb + X11 + X11-xcb + ) endif() diff --git a/external/qt/qt6/CMakeLists.txt b/external/qt/qt6/CMakeLists.txt index e261e6a..9817aae 100644 --- a/external/qt/qt6/CMakeLists.txt +++ b/external/qt/qt6/CMakeLists.txt @@ -38,249 +38,251 @@ if (DESKTOP_APP_USE_PACKAGED) ${Qt6WaylandClient_PRIVATE_INCLUDE_DIRS} ) endif() -else() + + return() +endif() + +target_include_directories(external_qt SYSTEM +INTERFACE + ${qt_loc}/include + ${qt_loc}/include/QtCore + ${qt_loc}/include/QtCore5Compat + ${qt_loc}/include/QtGui + ${qt_loc}/include/QtOpenGL + ${qt_loc}/include/QtWidgets + ${qt_loc}/include/QtOpenGLWidgets + ${qt_loc}/include/QtSvg + ${qt_loc}/include/QtCore/${qt_version} + ${qt_loc}/include/QtGui/${qt_version} + ${qt_loc}/include/QtCore/${qt_version}/QtCore + ${qt_loc}/include/QtGui/${qt_version}/QtGui +) + +if (Qt6DBus_FOUND) target_include_directories(external_qt SYSTEM INTERFACE - ${qt_loc}/include - ${qt_loc}/include/QtCore - ${qt_loc}/include/QtCore5Compat - ${qt_loc}/include/QtGui - ${qt_loc}/include/QtOpenGL - ${qt_loc}/include/QtWidgets - ${qt_loc}/include/QtOpenGLWidgets - ${qt_loc}/include/QtSvg - ${qt_loc}/include/QtCore/${qt_version} - ${qt_loc}/include/QtGui/${qt_version} - ${qt_loc}/include/QtCore/${qt_version}/QtCore - ${qt_loc}/include/QtGui/${qt_version}/QtGui + ${qt_loc}/include/QtDBus ) +endif() - if (Qt6DBus_FOUND) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/include/QtDBus - ) - endif() +if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) + target_include_directories(external_qt SYSTEM + INTERFACE + ${qt_loc}/include/QtWaylandClient + ${qt_loc}/include/QtWaylandClient/${qt_version} + ${qt_loc}/include/QtWaylandClient/${qt_version}/QtWaylandClient + ) +endif() - if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/include/QtWaylandClient - ${qt_loc}/include/QtWaylandClient/${qt_version} - ${qt_loc}/include/QtWaylandClient/${qt_version}/QtWaylandClient - ) - endif() +target_compile_definitions(external_qt +INTERFACE + _REENTRANT + QT_STATICPLUGIN + QT_PLUGIN + QT_SVG_LIB + QT_NETWORK_LIB + QT_OPENGLWIDGETS_LIB + QT_WIDGETS_LIB + QT_OPENGL_LIB + QT_GUI_LIB + QT_CORE5COMPAT_LIB + QT_CORE_LIB +) +if (Qt6DBus_FOUND) target_compile_definitions(external_qt INTERFACE - _REENTRANT - QT_STATICPLUGIN - QT_PLUGIN - QT_SVG_LIB - QT_NETWORK_LIB - QT_OPENGLWIDGETS_LIB - QT_WIDGETS_LIB - QT_OPENGL_LIB - QT_GUI_LIB - QT_CORE5COMPAT_LIB - QT_CORE_LIB + QT_DBUS_LIB ) +endif() - if (Qt6DBus_FOUND) - target_compile_definitions(external_qt - INTERFACE - QT_DBUS_LIB - ) - endif() - - if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) - target_compile_definitions(external_qt - INTERFACE - QT_WAYLANDCLIENT_LIB - ) - endif() - - if (WIN32) - set(qt_lib_prefix "") - set(qt_lib_suffix $<$:d>.lib) - else() - set(qt_lib_prefix lib) - if (APPLE) - set(qt_lib_suffix $<$:_debug>.a) - else() - set(qt_lib_suffix .a) - endif() - endif() - - if (LINUX) - set(qt_lib_objects objects-RelWithDebInfo) - else() - set(qt_lib_objects objects-$,Debug,RelWithDebInfo>) - endif() - - set(common_qt_libs - plugins/imageformats/${qt_lib_prefix}qwebp - plugins/imageformats/${qt_lib_prefix}qgif - plugins/imageformats/${qt_lib_prefix}qjpeg - lib/${qt_lib_prefix}Qt6Svg - lib/${qt_lib_prefix}Qt6Network - lib/${qt_lib_prefix}Qt6OpenGLWidgets - lib/${qt_lib_prefix}Qt6Widgets - lib/${qt_lib_prefix}Qt6OpenGL - lib/${qt_lib_prefix}Qt6Gui - lib/${qt_lib_prefix}Qt6Core5Compat - lib/${qt_lib_prefix}Qt6Core - lib/${qt_lib_prefix}Qt6BundledHarfbuzz - lib/${qt_lib_prefix}Qt6BundledLibpng - lib/${qt_lib_prefix}Qt6BundledPcre2 +if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) + target_compile_definitions(external_qt + INTERFACE + QT_WAYLANDCLIENT_LIB ) +endif() - set(qt_libs_list "") - if (WIN32) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/mkspecs/win32-msvc - ) - set(qt_libs - ${common_qt_libs} - lib/${qt_lib_prefix}Qt6WindowsUIAutomationSupport - lib/${qt_lib_prefix}qtmain - lib/${qt_lib_prefix}Qt6BundledFreetype - plugins/platforms/${qt_lib_prefix}qwindows - plugins/tls/${qt_lib_prefix}qopensslbackend - ) - foreach (lib ${qt_libs}) - list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") - endforeach() - - target_link_libraries(external_qt - INTERFACE - desktop-app::external_angle - ) - elseif (APPLE) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/mkspecs/macx-clang - ) - set(qt_libs - ${common_qt_libs} - lib/${qt_lib_prefix}Qt6BundledFreetype - plugins/platforms/${qt_lib_prefix}qcocoa - plugins/tls/${qt_lib_prefix}qsecuretransportbackend - plugins/networkinformation/${qt_lib_prefix}qscnetworkreachability - ) - foreach (lib ${qt_libs}) - list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") - endforeach() - list(APPEND qt_libs_list - "${qt_loc}/lib/${qt_lib_objects}/QCocoaIntegrationPlugin_resources_1/.rcc/qrc_qcocoaresources.cpp.o" - ) +if (WIN32) + set(qt_lib_prefix "") + set(qt_lib_suffix $<$:d>.lib) +else() + set(qt_lib_prefix lib) + if (APPLE) + set(qt_lib_suffix $<$:_debug>.a) else() - set(qt_libs_dbus) - set(qt_libs_dbus_plugins) - if (Qt6DBus_FOUND) - set(qt_libs_dbus - lib/${qt_lib_prefix}Qt6DBus - lib/${qt_lib_prefix}Qt6Core - ) - set(qt_libs_dbus_plugins - plugins/platforminputcontexts/${qt_lib_prefix}ibusplatforminputcontextplugin - ) - endif() - set(qt_libs_waylandclient) - set(qt_libs_waylandclient_plugins) - if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) - set(qt_libs_waylandclient - lib/${qt_lib_prefix}Qt6WaylandEglClientHwIntegration - lib/${qt_lib_prefix}Qt6WaylandClient - ) - set(qt_libs_waylandclient_plugins - plugins/platforms/${qt_lib_prefix}qwayland-generic - plugins/platforms/${qt_lib_prefix}qwayland-egl - plugins/wayland-graphics-integration-client/${qt_lib_prefix}qt-plugin-wayland-egl - plugins/wayland-decoration-client/${qt_lib_prefix}bradient - ) - endif() - set(qt_libs - plugins/platforminputcontexts/${qt_lib_prefix}composeplatforminputcontextplugin - ${qt_libs_dbus_plugins} - ${qt_libs_waylandclient_plugins} - plugins/platformthemes/${qt_lib_prefix}qgtk3 - plugins/platforms/${qt_lib_prefix}qxcb - plugins/tls/${qt_lib_prefix}qopensslbackend - plugins/xcbglintegrations/${qt_lib_prefix}qxcb-egl-integration - plugins/xcbglintegrations/${qt_lib_prefix}qxcb-glx-integration - plugins/iconengines/${qt_lib_prefix}qsvgicon - lib/${qt_lib_prefix}Qt6XcbQpa - ${qt_libs_waylandclient} - ${common_qt_libs} - ${qt_libs_dbus} - ) - foreach (lib ${qt_libs}) - list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") - endforeach() + set(qt_lib_suffix .a) endif() +endif() - list(APPEND qt_libs_list - "${qt_loc}/lib/${qt_lib_objects}/Gui_resources_1/.rcc/qrc_qpdf.cpp.o" - "${qt_loc}/lib/${qt_lib_objects}/Widgets_resources_1/.rcc/qrc_qstyle.cpp.o" - "${qt_loc}/lib/${qt_lib_objects}/Widgets_resources_2/.rcc/qrc_qstyle1.cpp.o" - "${qt_loc}/lib/${qt_lib_objects}/Widgets_resources_3/.rcc/qrc_qmessagebox.cpp.o" +if (LINUX) + set(qt_lib_objects objects-RelWithDebInfo) +else() + set(qt_lib_objects objects-$,Debug,RelWithDebInfo>) +endif() + +set(common_qt_libs + plugins/imageformats/${qt_lib_prefix}qwebp + plugins/imageformats/${qt_lib_prefix}qgif + plugins/imageformats/${qt_lib_prefix}qjpeg + lib/${qt_lib_prefix}Qt6Svg + lib/${qt_lib_prefix}Qt6Network + lib/${qt_lib_prefix}Qt6OpenGLWidgets + lib/${qt_lib_prefix}Qt6Widgets + lib/${qt_lib_prefix}Qt6OpenGL + lib/${qt_lib_prefix}Qt6Gui + lib/${qt_lib_prefix}Qt6Core5Compat + lib/${qt_lib_prefix}Qt6Core + lib/${qt_lib_prefix}Qt6BundledHarfbuzz + lib/${qt_lib_prefix}Qt6BundledLibpng + lib/${qt_lib_prefix}Qt6BundledPcre2 +) + +set(qt_libs_list "") +if (WIN32) + target_include_directories(external_qt SYSTEM + INTERFACE + ${qt_loc}/mkspecs/win32-msvc ) + set(qt_libs + ${common_qt_libs} + lib/${qt_lib_prefix}Qt6WindowsUIAutomationSupport + lib/${qt_lib_prefix}qtmain + lib/${qt_lib_prefix}Qt6BundledFreetype + plugins/platforms/${qt_lib_prefix}qwindows + plugins/tls/${qt_lib_prefix}qopensslbackend + ) + foreach (lib ${qt_libs}) + list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") + endforeach() target_link_libraries(external_qt INTERFACE - ${qt_libs_list} - desktop-app::external_openssl - $ - $ - desktop-app::external_jpeg - desktop-app::external_zlib - $ + desktop-app::external_angle ) - - if (LINUX) - target_include_directories(external_qt SYSTEM - INTERFACE - ${qt_loc}/mkspecs/linux-g++ +elseif (APPLE) + target_include_directories(external_qt SYSTEM + INTERFACE + ${qt_loc}/mkspecs/macx-clang + ) + set(qt_libs + ${common_qt_libs} + lib/${qt_lib_prefix}Qt6BundledFreetype + plugins/platforms/${qt_lib_prefix}qcocoa + plugins/tls/${qt_lib_prefix}qsecuretransportbackend + plugins/networkinformation/${qt_lib_prefix}qscnetworkreachability + ) + foreach (lib ${qt_libs}) + list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") + endforeach() + list(APPEND qt_libs_list + "${qt_loc}/lib/${qt_lib_objects}/QCocoaIntegrationPlugin_resources_1/.rcc/qrc_qcocoaresources.cpp.o" + ) +else() + set(qt_libs_dbus) + set(qt_libs_dbus_plugins) + if (Qt6DBus_FOUND) + set(qt_libs_dbus + lib/${qt_lib_prefix}Qt6DBus + lib/${qt_lib_prefix}Qt6Core ) - target_link_static_libraries(external_qt - INTERFACE - proxy - epoxy - xkbcommon - xkbcommon-x11 - xcb-glx - xcb-xkb - xcb-randr - xcb-icccm - xcb-shm - xcb-render - xcb-image - xcb-xfixes - xcb-xinput - xcb-shape - xcb-sync - xcb-util - xcb-render-util - xcb-keysyms - ) - if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) - target_link_libraries(external_qt - INTERFACE - desktop-app::linux_wayland_helper - $ - ) - endif() - target_link_libraries(external_qt - INTERFACE - desktop-app::linux_xcb_helper - $ - fontconfig - freetype - xcb - X11 - X11-xcb + set(qt_libs_dbus_plugins + plugins/platforminputcontexts/${qt_lib_prefix}ibusplatforminputcontextplugin ) endif() + set(qt_libs_waylandclient) + set(qt_libs_waylandclient_plugins) + if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) + set(qt_libs_waylandclient + lib/${qt_lib_prefix}Qt6WaylandEglClientHwIntegration + lib/${qt_lib_prefix}Qt6WaylandClient + ) + set(qt_libs_waylandclient_plugins + plugins/platforms/${qt_lib_prefix}qwayland-generic + plugins/platforms/${qt_lib_prefix}qwayland-egl + plugins/wayland-graphics-integration-client/${qt_lib_prefix}qt-plugin-wayland-egl + plugins/wayland-decoration-client/${qt_lib_prefix}bradient + ) + endif() + set(qt_libs + plugins/platforminputcontexts/${qt_lib_prefix}composeplatforminputcontextplugin + ${qt_libs_dbus_plugins} + ${qt_libs_waylandclient_plugins} + plugins/platformthemes/${qt_lib_prefix}qgtk3 + plugins/platforms/${qt_lib_prefix}qxcb + plugins/tls/${qt_lib_prefix}qopensslbackend + plugins/xcbglintegrations/${qt_lib_prefix}qxcb-egl-integration + plugins/xcbglintegrations/${qt_lib_prefix}qxcb-glx-integration + plugins/iconengines/${qt_lib_prefix}qsvgicon + lib/${qt_lib_prefix}Qt6XcbQpa + ${qt_libs_waylandclient} + ${common_qt_libs} + ${qt_libs_dbus} + ) + foreach (lib ${qt_libs}) + list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") + endforeach() +endif() + +list(APPEND qt_libs_list + "${qt_loc}/lib/${qt_lib_objects}/Gui_resources_1/.rcc/qrc_qpdf.cpp.o" + "${qt_loc}/lib/${qt_lib_objects}/Widgets_resources_1/.rcc/qrc_qstyle.cpp.o" + "${qt_loc}/lib/${qt_lib_objects}/Widgets_resources_2/.rcc/qrc_qstyle1.cpp.o" + "${qt_loc}/lib/${qt_lib_objects}/Widgets_resources_3/.rcc/qrc_qmessagebox.cpp.o" +) + +target_link_libraries(external_qt +INTERFACE + ${qt_libs_list} + desktop-app::external_openssl + $ + $ + desktop-app::external_jpeg + desktop-app::external_zlib + $ +) + +if (LINUX) + target_include_directories(external_qt SYSTEM + INTERFACE + ${qt_loc}/mkspecs/linux-g++ + ) + target_link_static_libraries(external_qt + INTERFACE + proxy + epoxy + xkbcommon + xkbcommon-x11 + xcb-glx + xcb-xkb + xcb-randr + xcb-icccm + xcb-shm + xcb-render + xcb-image + xcb-xfixes + xcb-xinput + xcb-shape + xcb-sync + xcb-util + xcb-render-util + xcb-keysyms + ) + if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) + target_link_libraries(external_qt + INTERFACE + desktop-app::linux_wayland_helper + $ + ) + endif() + target_link_libraries(external_qt + INTERFACE + desktop-app::linux_xcb_helper + $ + fontconfig + freetype + xcb + X11 + X11-xcb + ) endif() diff --git a/external/rlottie/CMakeLists.txt b/external/rlottie/CMakeLists.txt index ab18554..a2029e7 100644 --- a/external/rlottie/CMakeLists.txt +++ b/external/rlottie/CMakeLists.txt @@ -20,129 +20,130 @@ if (DESKTOP_APP_USE_PACKAGED) target_link_libraries(external_rlottie INTERFACE PkgConfig::RLOTTIE) endif() endif() -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)") - - get_filename_component(src_loc . REALPATH) - set(rlottie_loc ${third_party_loc}/rlottie) - - target_sources(external_rlottie_bundled PRIVATE ${src_loc}/config/config.h) - nice_target_sources(external_rlottie_bundled ${rlottie_loc} - PRIVATE - inc/rlottie.h - inc/rlottie_capi.h - inc/rlottiecommon.h - - src/lottie/lottieanimation.cpp - src/lottie/lottieitem.cpp - src/lottie/lottieitem.h - src/lottie/lottiekeypath.cpp - src/lottie/lottiekeypath.h - src/lottie/lottieloader.cpp - src/lottie/lottieloader.h - src/lottie/lottiemodel.cpp - src/lottie/lottiemodel.h - src/lottie/lottieparser.cpp - src/lottie/lottieparser.h - src/lottie/lottieproxymodel.cpp - src/lottie/lottieproxymodel.h - - src/vector/freetype/v_ft_math.cpp - src/vector/freetype/v_ft_math.h - src/vector/freetype/v_ft_raster.cpp - src/vector/freetype/v_ft_raster.h - src/vector/freetype/v_ft_stroker.cpp - src/vector/freetype/v_ft_stroker.h - src/vector/freetype/v_ft_types.h - - # src/vector/pixman/pixman-arm-neon-asm.h - # src/vector/pixman/pixman-arm-neon-asm.S - src/vector/pixman/vregion.cpp - src/vector/pixman/vregion.h - - src/vector/vbezier.cpp - src/vector/vbezier.h - src/vector/vbitmap.cpp - src/vector/vbitmap.h - src/vector/vbrush.cpp - src/vector/vbrush.h - src/vector/vcompositionfunctions.cpp - src/vector/vcowptr.h - src/vector/vdasher.cpp - src/vector/vdasher.h - src/vector/vdebug.cpp - src/vector/vdebug.h - src/vector/vdrawable.cpp - src/vector/vdrawable.h - src/vector/vdrawhelper.cpp - src/vector/vdrawhelper.h - src/vector/vdrawhelper_neon.cpp - src/vector/vdrawhelper_sse2.cpp - src/vector/velapsedtimer.cpp - src/vector/velapsedtimer.h - src/vector/vglobal.h - src/vector/vimageloader.cpp - src/vector/vimageloader.h - src/vector/vinterpolator.cpp - src/vector/vinterpolator.h - src/vector/vline.h - src/vector/vmatrix.cpp - src/vector/vmatrix.h - src/vector/vpainter.cpp - src/vector/vpainter.h - src/vector/vpath.cpp - src/vector/vpath.h - src/vector/vpathmesure.cpp - src/vector/vpathmesure.h - src/vector/vpoint.h - src/vector/vraster.cpp - src/vector/vraster.h - src/vector/vrect.cpp - src/vector/vrect.h - src/vector/vrle.cpp - src/vector/vrle.h - src/vector/vstackallocator.h - src/vector/vtaskqueue.h - ) - - target_compile_definitions(external_rlottie_bundled - PUBLIC - LOT_BUILD - PRIVATE - _USE_MATH_DEFINES - "RAPIDJSON_ASSERT=(void)" - LOTTIE_DISABLE_ARM_NEON - ) - - target_include_directories(external_rlottie_bundled - PUBLIC - ${rlottie_loc}/inc - PRIVATE - ${src_loc}/config - ${rlottie_loc}/src/lottie - ${rlottie_loc}/src/vector - ${rlottie_loc}/src/vector/pixman - ${rlottie_loc}/src/vector/freetype - ) - - if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - target_compile_options(external_rlottie_bundled - PRIVATE - /w44244 # 'initializing': conversion from 'double' to 'float' - /w44251 # needs to have dll-interface to be used by clients of class + if (rlottie_FOUND OR RLOTTIE_FOUND) + target_compile_definitions(external_rlottie + INTERFACE + DESKTOP_APP_USE_PACKAGED_RLOTTIE ) + return() endif() +endif() - target_link_libraries(external_rlottie - INTERFACE - external_rlottie_bundled +add_library(external_rlottie_bundled STATIC) +init_target(external_rlottie_bundled "(external)") + +get_filename_component(src_loc . REALPATH) +set(rlottie_loc ${third_party_loc}/rlottie) + +target_sources(external_rlottie_bundled PRIVATE ${src_loc}/config/config.h) +nice_target_sources(external_rlottie_bundled ${rlottie_loc} +PRIVATE + inc/rlottie.h + inc/rlottie_capi.h + inc/rlottiecommon.h + + src/lottie/lottieanimation.cpp + src/lottie/lottieitem.cpp + src/lottie/lottieitem.h + src/lottie/lottiekeypath.cpp + src/lottie/lottiekeypath.h + src/lottie/lottieloader.cpp + src/lottie/lottieloader.h + src/lottie/lottiemodel.cpp + src/lottie/lottiemodel.h + src/lottie/lottieparser.cpp + src/lottie/lottieparser.h + src/lottie/lottieproxymodel.cpp + src/lottie/lottieproxymodel.h + + src/vector/freetype/v_ft_math.cpp + src/vector/freetype/v_ft_math.h + src/vector/freetype/v_ft_raster.cpp + src/vector/freetype/v_ft_raster.h + src/vector/freetype/v_ft_stroker.cpp + src/vector/freetype/v_ft_stroker.h + src/vector/freetype/v_ft_types.h + + # src/vector/pixman/pixman-arm-neon-asm.h + # src/vector/pixman/pixman-arm-neon-asm.S + src/vector/pixman/vregion.cpp + src/vector/pixman/vregion.h + + src/vector/vbezier.cpp + src/vector/vbezier.h + src/vector/vbitmap.cpp + src/vector/vbitmap.h + src/vector/vbrush.cpp + src/vector/vbrush.h + src/vector/vcompositionfunctions.cpp + src/vector/vcowptr.h + src/vector/vdasher.cpp + src/vector/vdasher.h + src/vector/vdebug.cpp + src/vector/vdebug.h + src/vector/vdrawable.cpp + src/vector/vdrawable.h + src/vector/vdrawhelper.cpp + src/vector/vdrawhelper.h + src/vector/vdrawhelper_neon.cpp + src/vector/vdrawhelper_sse2.cpp + src/vector/velapsedtimer.cpp + src/vector/velapsedtimer.h + src/vector/vglobal.h + src/vector/vimageloader.cpp + src/vector/vimageloader.h + src/vector/vinterpolator.cpp + src/vector/vinterpolator.h + src/vector/vline.h + src/vector/vmatrix.cpp + src/vector/vmatrix.h + src/vector/vpainter.cpp + src/vector/vpainter.h + src/vector/vpath.cpp + src/vector/vpath.h + src/vector/vpathmesure.cpp + src/vector/vpathmesure.h + src/vector/vpoint.h + src/vector/vraster.cpp + src/vector/vraster.h + src/vector/vrect.cpp + src/vector/vrect.h + src/vector/vrle.cpp + src/vector/vrle.h + src/vector/vstackallocator.h + src/vector/vtaskqueue.h +) + +target_compile_definitions(external_rlottie_bundled +PUBLIC + LOT_BUILD +PRIVATE + _USE_MATH_DEFINES + "RAPIDJSON_ASSERT=(void)" + LOTTIE_DISABLE_ARM_NEON +) + +target_include_directories(external_rlottie_bundled +PUBLIC + ${rlottie_loc}/inc +PRIVATE + ${src_loc}/config + ${rlottie_loc}/src/lottie + ${rlottie_loc}/src/vector + ${rlottie_loc}/src/vector/pixman + ${rlottie_loc}/src/vector/freetype +) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + target_compile_options(external_rlottie_bundled + PRIVATE + /w44244 # 'initializing': conversion from 'double' to 'float' + /w44251 # needs to have dll-interface to be used by clients of class ) endif() + +target_link_libraries(external_rlottie +INTERFACE + external_rlottie_bundled +) diff --git a/external/rnnoise/CMakeLists.txt b/external/rnnoise/CMakeLists.txt index cf258b8..7d68d93 100644 --- a/external/rnnoise/CMakeLists.txt +++ b/external/rnnoise/CMakeLists.txt @@ -12,37 +12,38 @@ if (DESKTOP_APP_USE_PACKAGED) pkg_check_modules(RNNOISE REQUIRED IMPORTED_TARGET rnnoise) target_link_libraries(external_rnnoise INTERFACE PkgConfig::RNNOISE) -else() - add_library(external_rnnoise STATIC IMPORTED GLOBAL) - add_library(desktop-app::external_rnnoise ALIAS external_rnnoise) - - set(rnnoise_lib_loc ${libs_loc}/rnnoise/out) - if (WIN32) - target_include_directories(external_rnnoise SYSTEM - INTERFACE - ${libs_loc}/rnnoise/include - ) - set_target_properties(external_rnnoise PROPERTIES - IMPORTED_LOCATION "${rnnoise_lib_loc}/Release/rnnoise.lib" - IMPORTED_LOCATION_DEBUG "${rnnoise_lib_loc}/Debug/rnnoise.lib" - ) - elseif (APPLE) - target_include_directories(external_rnnoise SYSTEM - INTERFACE - ${libs_loc}/rnnoise/include - ) - set_target_properties(external_rnnoise PROPERTIES - IMPORTED_LOCATION "${rnnoise_lib_loc}/Release/librnnoise.a" - IMPORTED_LOCATION_DEBUG "${rnnoise_lib_loc}/Debug/librnnoise.a" - ) - else() - target_include_directories(external_rnnoise SYSTEM - INTERFACE - /usr/local/include - ) - find_library(RNNOISE_LIBRARY librnnoise.a REQUIRED) - set_target_properties(external_rnnoise PROPERTIES - IMPORTED_LOCATION "${RNNOISE_LIBRARY}" - ) - endif() + return() +endif() + +add_library(external_rnnoise STATIC IMPORTED GLOBAL) +add_library(desktop-app::external_rnnoise ALIAS external_rnnoise) + +set(rnnoise_lib_loc ${libs_loc}/rnnoise/out) +if (WIN32) + target_include_directories(external_rnnoise SYSTEM + INTERFACE + ${libs_loc}/rnnoise/include + ) + set_target_properties(external_rnnoise PROPERTIES + IMPORTED_LOCATION "${rnnoise_lib_loc}/Release/rnnoise.lib" + IMPORTED_LOCATION_DEBUG "${rnnoise_lib_loc}/Debug/rnnoise.lib" + ) +elseif (APPLE) + target_include_directories(external_rnnoise SYSTEM + INTERFACE + ${libs_loc}/rnnoise/include + ) + set_target_properties(external_rnnoise PROPERTIES + IMPORTED_LOCATION "${rnnoise_lib_loc}/Release/librnnoise.a" + IMPORTED_LOCATION_DEBUG "${rnnoise_lib_loc}/Debug/librnnoise.a" + ) +else() + target_include_directories(external_rnnoise SYSTEM + INTERFACE + /usr/local/include + ) + find_library(RNNOISE_LIBRARY librnnoise.a REQUIRED) + set_target_properties(external_rnnoise PROPERTIES + IMPORTED_LOCATION "${RNNOISE_LIBRARY}" + ) endif() diff --git a/external/webrtc/CMakeLists.txt b/external/webrtc/CMakeLists.txt index ad4dd21..343416d 100644 --- a/external/webrtc/CMakeLists.txt +++ b/external/webrtc/CMakeLists.txt @@ -10,114 +10,115 @@ 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() - set(webrtc_loc ${libs_loc}/tg_owt/src) - set(webrtc_build_loc ${libs_loc}/tg_owt/out/$,Debug,Release>) + return() +endif() + +set(webrtc_loc ${libs_loc}/tg_owt/src) +set(webrtc_build_loc ${libs_loc}/tg_owt/out/$,Debug,Release>) + +target_compile_definitions(external_webrtc +INTERFACE + WEBRTC_ENABLE_PROTOBUF=0 + WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE + RTC_ENABLE_VP9 + HAVE_SCTP + WEBRTC_USE_H264 + WEBRTC_USE_BUILTIN_ISAC_FLOAT + WEBRTC_LIBRARY_IMPL + WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1 + WEBRTC_HAVE_USRSCTP + ABSL_ALLOCATOR_NOTHROW=1 +) + +if (WIN32) + set(webrtc_lib_prefix "") + set(webrtc_lib_suffix .lib) target_compile_definitions(external_webrtc INTERFACE - WEBRTC_ENABLE_PROTOBUF=0 - WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE - RTC_ENABLE_VP9 - HAVE_SCTP - WEBRTC_USE_H264 - WEBRTC_USE_BUILTIN_ISAC_FLOAT - WEBRTC_LIBRARY_IMPL - WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1 - WEBRTC_HAVE_USRSCTP - ABSL_ALLOCATOR_NOTHROW=1 + WEBRTC_WIN ) +else() + set(webrtc_lib_prefix lib) + set(webrtc_lib_suffix .a) - if (WIN32) - set(webrtc_lib_prefix "") - set(webrtc_lib_suffix .lib) - + if (APPLE) target_compile_definitions(external_webrtc INTERFACE - WEBRTC_WIN + WEBRTC_MAC ) else() - set(webrtc_lib_prefix lib) - set(webrtc_lib_suffix .a) - - if (APPLE) - target_compile_definitions(external_webrtc - INTERFACE - WEBRTC_MAC - ) - else() - target_compile_definitions(external_webrtc - INTERFACE - WEBRTC_LINUX - WEBRTC_USE_X11 - WEBRTC_USE_PIPEWIRE - ) - endif() - target_compile_definitions(external_webrtc INTERFACE - WEBRTC_POSIX + WEBRTC_LINUX + WEBRTC_USE_X11 + WEBRTC_USE_PIPEWIRE ) endif() + target_compile_definitions(external_webrtc + INTERFACE + WEBRTC_POSIX + ) +endif() + +target_include_directories(external_webrtc SYSTEM +INTERFACE + ${webrtc_loc} + ${webrtc_loc}/third_party/abseil-cpp + ${webrtc_loc}/third_party/libyuv/include +) + +set(webrtc_libs + ${webrtc_lib_prefix}tg_owt +) +if (APPLE) target_include_directories(external_webrtc SYSTEM INTERFACE - ${webrtc_loc} - ${webrtc_loc}/third_party/abseil-cpp - ${webrtc_loc}/third_party/libyuv/include + ${webrtc_loc}/sdk/objc + ${webrtc_loc}/sdk/objc/base + ${webrtc_loc}/sdk/objc/components/video_codec ) +endif() +foreach (lib ${webrtc_libs}) + list(APPEND webrtc_libs_list "${webrtc_build_loc}/${lib}${webrtc_lib_suffix}") +endforeach() - set(webrtc_libs - ${webrtc_lib_prefix}tg_owt - ) - if (APPLE) - target_include_directories(external_webrtc SYSTEM - INTERFACE - ${webrtc_loc}/sdk/objc - ${webrtc_loc}/sdk/objc/base - ${webrtc_loc}/sdk/objc/components/video_codec - ) - endif() - foreach (lib ${webrtc_libs}) - list(APPEND webrtc_libs_list "${webrtc_build_loc}/${lib}${webrtc_lib_suffix}") - endforeach() +target_link_libraries(external_webrtc +INTERFACE + ${webrtc_libs_list} + desktop-app::external_openssl + desktop-app::external_jpeg + desktop-app::external_opus +) +if (WIN32) target_link_libraries(external_webrtc INTERFACE - ${webrtc_libs_list} - desktop-app::external_openssl - desktop-app::external_jpeg - desktop-app::external_opus + Secur32.lib # Required for rtc_base/http_common.cc + ) +elseif (APPLE) + target_link_libraries(external_webrtc + INTERFACE + -ObjC + ) +else() + # Required for desktop_capture + target_link_static_libraries(external_webrtc + INTERFACE + Xcomposite + Xdamage + Xext + Xfixes + Xrandr + Xrender + Xtst + ) + target_link_libraries(external_webrtc + INTERFACE + X11 + gio-2.0 + gobject-2.0 + glib-2.0 ) - - if (WIN32) - target_link_libraries(external_webrtc - INTERFACE - Secur32.lib # Required for rtc_base/http_common.cc - ) - elseif (APPLE) - target_link_libraries(external_webrtc - INTERFACE - -ObjC - ) - else() - # Required for desktop_capture - target_link_static_libraries(external_webrtc - INTERFACE - Xcomposite - Xdamage - Xext - Xfixes - Xrandr - Xrender - Xtst - ) - target_link_libraries(external_webrtc - INTERFACE - X11 - gio-2.0 - gobject-2.0 - glib-2.0 - ) - endif() endif()