2023-06-19 02:38:40 +03:00
|
|
|
cmake_minimum_required(VERSION 3.13..3.21)
|
2017-04-06 02:06:42 +03:00
|
|
|
|
2017-10-01 22:38:46 +03:00
|
|
|
option(APPVEYOR_BUILD "Build on appveyor" OFF)
|
2020-01-24 19:35:49 +03:00
|
|
|
option(CI_BUILD "Set when building in CI. Enables -Werror where possible" OFF)
|
2018-05-04 18:11:03 +03:00
|
|
|
option(ASAN "Compile with address sanitizers" OFF)
|
2019-12-15 01:48:02 +03:00
|
|
|
option(QML_DEBUGGING "Enable qml debugging" OFF)
|
2020-06-27 04:06:16 +03:00
|
|
|
option(COMPILE_QML "Compile Qml. It will make Nheko faster, but you will need to recompile it, when you update Qt." OFF)
|
2021-12-23 00:34:07 +03:00
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
option(MAN "Build man page" ON)
|
|
|
|
else()
|
|
|
|
option(MAN "Build man page" OFF)
|
|
|
|
endif()
|
2022-02-10 01:46:49 +03:00
|
|
|
option(FLATPAK "Set this only if Nheko is built as a flatpak" OFF)
|
2022-06-17 04:27:29 +03:00
|
|
|
option(JSON_ImplicitConversions "Disable implicit conversions in nlohmann/json" ON)
|
2017-05-02 04:22:33 +03:00
|
|
|
|
2020-01-24 19:35:49 +03:00
|
|
|
set(
|
2020-01-25 02:58:22 +03:00
|
|
|
CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/toolchain.cmake"
|
|
|
|
CACHE
|
|
|
|
FILEPATH "Default toolchain"
|
|
|
|
)
|
2022-09-21 03:58:35 +03:00
|
|
|
set(CMAKE_CXX_STANDARD 20 CACHE STRING "C++ standard")
|
2020-05-25 12:12:01 +03:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL "Require C++ standard to be supported")
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "compile as PIC by default")
|
2023-03-10 03:28:19 +03:00
|
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "macos deployment target")
|
2020-01-24 19:35:49 +03:00
|
|
|
|
|
|
|
option(HUNTER_ENABLED "Enable Hunter package manager" OFF)
|
|
|
|
include("cmake/HunterGate.cmake")
|
|
|
|
HunterGate(
|
2022-11-20 05:51:44 +03:00
|
|
|
URL "https://github.com/cpp-pm/hunter/archive/v0.24.8.tar.gz"
|
|
|
|
SHA1 "ca7838dded9a1811b04ffd56175f629e0af82d3d"
|
|
|
|
LOCAL
|
2022-08-10 01:20:44 +03:00
|
|
|
)
|
2020-01-24 19:35:49 +03:00
|
|
|
|
2021-11-18 04:56:32 +03:00
|
|
|
macro(hunter_add_package_safe)
|
|
|
|
set(pkg_temp_backup_libdir "$ENV{PKG_CONFIG_LIBDIR}")
|
|
|
|
set(pkg_temp_backup_path "$ENV{PKG_CONFIG_PATH}")
|
|
|
|
hunter_add_package(${ARGV})
|
|
|
|
if("${pkg_temp_backup_path}" STREQUAL "")
|
|
|
|
unset(ENV{PKG_CONFIG_PATH})
|
|
|
|
else()
|
|
|
|
set(ENV{PKG_CONFIG_PATH} "${pkg_temp_backup_path}")
|
|
|
|
endif()
|
|
|
|
if("${pkg_temp_backup_libdir}" STREQUAL "")
|
|
|
|
unset(ENV{PKG_CONFIG_LIBDIR})
|
|
|
|
else()
|
|
|
|
set(ENV{PKG_CONFIG_LIBDIR} "${pkg_temp_backup_libdir}")
|
|
|
|
endif()
|
|
|
|
message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'")
|
|
|
|
endmacro()
|
|
|
|
|
2021-06-30 03:43:36 +03:00
|
|
|
option(USE_BUNDLED_SPDLOG "Use the bundled version of spdlog." ${HUNTER_ENABLED})
|
2020-01-24 19:35:49 +03:00
|
|
|
option(USE_BUNDLED_OLM "Use the bundled version of libolm." ${HUNTER_ENABLED})
|
2021-06-30 03:43:36 +03:00
|
|
|
option(USE_BUNDLED_GTEST "Use the bundled version of Google Test." ${HUNTER_ENABLED})
|
|
|
|
option(USE_BUNDLED_CMARK "Use the bundled version of cmark." ${HUNTER_ENABLED})
|
|
|
|
option(USE_BUNDLED_JSON "Use the bundled version of nlohmann json." ${HUNTER_ENABLED})
|
|
|
|
option(USE_BUNDLED_OPENSSL "Use the bundled version of OpenSSL." OFF)
|
2020-01-24 19:35:49 +03:00
|
|
|
option(USE_BUNDLED_MTXCLIENT "Use the bundled version of the Matrix Client library." ${HUNTER_ENABLED})
|
2021-06-30 03:43:36 +03:00
|
|
|
option(USE_BUNDLED_LMDB "Use the bundled version of lmdb." ${HUNTER_ENABLED})
|
|
|
|
option(USE_BUNDLED_LMDBXX "Use the bundled version of lmdb++." ${HUNTER_ENABLED})
|
2023-06-01 23:09:54 +03:00
|
|
|
option(USE_BUNDLED_QTKEYCHAIN "Use the bundled version of Qt6Keychain." ${HUNTER_ENABLED})
|
2021-06-30 03:43:36 +03:00
|
|
|
option(USE_BUNDLED_COEURL "Use a bundled version of the Curl wrapper"
|
2020-12-18 05:21:17 +03:00
|
|
|
${HUNTER_ENABLED})
|
2022-09-13 23:12:33 +03:00
|
|
|
option(USE_BUNDLED_LIBEVENT "Use the bundled version of libevent." ${HUNTER_ENABLED})
|
|
|
|
option(USE_BUNDLED_LIBCURL "Use the bundled version of libcurl." ${HUNTER_ENABLED})
|
2022-10-12 22:20:17 +03:00
|
|
|
option(USE_BUNDLED_RE2 "Use the bundled version of re2." ${HUNTER_ENABLED})
|
2023-02-15 12:36:56 +03:00
|
|
|
option(USE_BUNDLED_CPPHTTPLIB "Use the bundled version of cpp-httplib." ON)
|
2023-02-16 17:26:02 +03:00
|
|
|
option(USE_BUNDLED_BLURHASH "Use the bundled version of blurhash." ON)
|
2020-01-24 19:35:49 +03:00
|
|
|
|
2021-11-19 01:05:28 +03:00
|
|
|
include(CMakeDependentOption)
|
|
|
|
set(VOIP_DEFAULT ON)
|
|
|
|
if (APPLE OR WIN32)
|
|
|
|
set(VOIP_DEFAULT OFF)
|
|
|
|
endif()
|
|
|
|
option(VOIP "Whether to enable voip support. Disable this, if you don't have gstreamer." ${VOIP_DEFAULT})
|
2023-06-03 03:45:38 +03:00
|
|
|
set(X11_DEFAULT)
|
|
|
|
if (WIN32 OR APPLE OR HAIKU)
|
|
|
|
set(X11_DEFAULT OFF)
|
|
|
|
endif()
|
|
|
|
option(X11 "Whether to enable X11 specific features (screenshare, window roles)." ${X11_DEFAULT})
|
2023-03-11 16:36:51 +03:00
|
|
|
cmake_dependent_option(SCREENSHARE_XDP "Whether to enable screenshare support using xdg-desktop-portal." ON "VOIP" OFF)
|
2021-11-19 01:05:28 +03:00
|
|
|
|
2020-01-24 19:35:49 +03:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
2017-11-06 18:17:21 +03:00
|
|
|
|
2020-01-26 20:53:24 +03:00
|
|
|
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
|
|
|
|
message("Adding FetchContent_MakeAvailable")
|
|
|
|
# from cmakes sources
|
|
|
|
macro(FetchContent_MakeAvailable)
|
|
|
|
|
|
|
|
foreach(contentName IN ITEMS ${ARGV})
|
|
|
|
string(TOLOWER ${contentName} contentNameLower)
|
|
|
|
FetchContent_GetProperties(${contentName})
|
|
|
|
if(NOT ${contentNameLower}_POPULATED)
|
|
|
|
FetchContent_Populate(${contentName})
|
|
|
|
|
|
|
|
# Only try to call add_subdirectory() if the populated content
|
|
|
|
# can be treated that way. Protecting the call with the check
|
|
|
|
# allows this function to be used for projects that just want
|
|
|
|
# to ensure the content exists, such as to provide content at
|
|
|
|
# a known location.
|
|
|
|
if(EXISTS ${${contentNameLower}_SOURCE_DIR}/CMakeLists.txt)
|
|
|
|
add_subdirectory(${${contentNameLower}_SOURCE_DIR}
|
|
|
|
${${contentNameLower}_BINARY_DIR})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
endmacro()
|
|
|
|
endif()
|
|
|
|
|
2021-01-24 03:05:12 +03:00
|
|
|
# Include Qt basic functions
|
|
|
|
include(QtCommon)
|
|
|
|
|
2021-01-21 21:23:21 +03:00
|
|
|
project(nheko LANGUAGES CXX C)
|
|
|
|
|
2018-01-09 21:34:01 +03:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2018-03-22 17:20:22 +03:00
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR "0")
|
2023-01-13 00:03:54 +03:00
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR "11")
|
2023-02-23 02:50:45 +03:00
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH "3")
|
2018-03-22 20:13:38 +03:00
|
|
|
set(PROJECT_VERSION_MAJOR ${CPACK_PACKAGE_VERSION_MAJOR})
|
|
|
|
set(PROJECT_VERSION_MINOR ${CPACK_PACKAGE_VERSION_MINOR})
|
|
|
|
set(PROJECT_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH})
|
2017-11-06 18:17:21 +03:00
|
|
|
|
2018-03-22 20:13:38 +03:00
|
|
|
# Set PROJECT_VERSION_PATCH & PROJECT_VERSION_TWEAK to 0 if not present
|
|
|
|
# Needed by add_project_meta.
|
2017-11-06 18:17:21 +03:00
|
|
|
fix_project_version()
|
|
|
|
|
|
|
|
# Set additional project information
|
|
|
|
set(COMPANY "Nheko")
|
2023-02-20 04:34:29 +03:00
|
|
|
set(COPYRIGHT "Copyright (c) 2023 Nheko Contributors")
|
2020-05-01 02:27:27 +03:00
|
|
|
set(IDENTIFIER "io.github.nheko-reborn.nheko")
|
2017-11-06 18:17:21 +03:00
|
|
|
|
|
|
|
add_project_meta(META_FILES_TO_INCLUDE)
|
|
|
|
|
2018-06-04 16:07:47 +03:00
|
|
|
if(NOT MSVC AND NOT APPLE)
|
2020-01-25 02:58:22 +03:00
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
2018-06-04 16:07:47 +03:00
|
|
|
endif()
|
|
|
|
|
2018-07-02 18:39:49 +03:00
|
|
|
if (BUILD_DOCS)
|
2020-01-25 02:58:22 +03:00
|
|
|
find_package(Doxygen)
|
|
|
|
|
|
|
|
if (DOXYGEN_FOUND)
|
|
|
|
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Doxyfile.in)
|
|
|
|
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
|
|
|
|
|
|
|
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT})
|
|
|
|
|
|
|
|
add_custom_target(docs ALL
|
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMENT "Generating API documentation with Doxygen"
|
|
|
|
VERBATIM )
|
|
|
|
else (DOXYGEN_FOUND)
|
|
|
|
message("Doxygen need to be installed to generate the doxygen documentation")
|
|
|
|
endif (DOXYGEN_FOUND)
|
2018-07-02 18:39:49 +03:00
|
|
|
endif()
|
|
|
|
|
2021-06-30 03:43:36 +03:00
|
|
|
#
|
|
|
|
## coeurl
|
|
|
|
#
|
|
|
|
## Need to repeat all libevent deps?!?
|
|
|
|
if (USE_BUNDLED_LIBEVENT)
|
2021-11-18 04:56:32 +03:00
|
|
|
hunter_add_package_safe(Libevent)
|
2021-06-30 03:43:36 +03:00
|
|
|
find_package(Libevent CONFIG REQUIRED)
|
|
|
|
else()
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(libevent_core REQUIRED IMPORTED_TARGET libevent_core)
|
|
|
|
if (WIN32)
|
|
|
|
pkg_check_modules(libevent_windows REQUIRED IMPORTED_TARGET libevent_windows)
|
|
|
|
else()
|
|
|
|
pkg_check_modules(libevent_pthreads REQUIRED IMPORTED_TARGET
|
|
|
|
libevent_pthreads)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# curl
|
|
|
|
if (USE_BUNDLED_LIBCURL)
|
2021-11-18 04:56:32 +03:00
|
|
|
hunter_add_package_safe(CURL)
|
2021-06-30 03:43:36 +03:00
|
|
|
find_package(CURL CONFIG REQUIRED)
|
|
|
|
else()
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(libcurl REQUIRED IMPORTED_TARGET libcurl)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# spdlog
|
|
|
|
if(USE_BUNDLED_SPDLOG)
|
2021-11-18 04:56:32 +03:00
|
|
|
hunter_add_package_safe(spdlog)
|
2021-06-30 03:43:36 +03:00
|
|
|
endif()
|
|
|
|
find_package(spdlog 1.0.0 CONFIG REQUIRED)
|
2018-07-02 18:39:49 +03:00
|
|
|
|
2022-06-09 03:41:25 +03:00
|
|
|
if(USE_BUNDLED_COEURL)
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
|
|
coeurl
|
|
|
|
GIT_REPOSITORY https://nheko.im/Nheko-Reborn/coeurl.git
|
2023-07-28 17:41:54 +03:00
|
|
|
GIT_TAG 831e2ee8e9cf08ea1ee9736cde8370f9d0312abc
|
2022-06-09 03:41:25 +03:00
|
|
|
)
|
|
|
|
FetchContent_MakeAvailable(coeurl)
|
|
|
|
set(COEURL_TARGET_NAME coeurl::coeurl)
|
|
|
|
else()
|
2022-06-17 20:49:18 +03:00
|
|
|
find_package(PkgConfig)
|
2023-01-13 00:03:54 +03:00
|
|
|
pkg_check_modules(coeurl IMPORTED_TARGET coeurl>=0.3.0)
|
2022-06-17 20:49:18 +03:00
|
|
|
if (TARGET PkgConfig::coeurl)
|
|
|
|
set(COEURL_TARGET_NAME PkgConfig::coeurl)
|
2022-06-09 03:41:25 +03:00
|
|
|
endif()
|
2022-06-17 20:49:18 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT TARGET PkgConfig::coeurl)
|
2022-07-22 16:23:44 +03:00
|
|
|
find_package(coeurl 0.2.1 CONFIG)
|
2022-06-17 20:49:18 +03:00
|
|
|
if (TARGET coeurl::coeurl)
|
2022-06-09 03:41:25 +03:00
|
|
|
set(COEURL_TARGET_NAME coeurl::coeurl)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-06-17 20:49:18 +03:00
|
|
|
if (NOT COEURL_TARGET_NAME)
|
|
|
|
message(ERROR "Couldn't find coeurl")
|
2022-06-09 03:41:25 +03:00
|
|
|
endif()
|
|
|
|
|
2022-10-12 22:20:17 +03:00
|
|
|
if(USE_BUNDLED_RE2)
|
|
|
|
hunter_add_package(re2)
|
|
|
|
find_package(re2 CONFIG REQUIRED)
|
|
|
|
else()
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(re2 REQUIRED IMPORTED_TARGET re2)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2017-07-29 11:49:00 +03:00
|
|
|
#
|
|
|
|
# LMDB
|
|
|
|
#
|
2020-01-24 19:35:49 +03:00
|
|
|
#include(LMDB)
|
|
|
|
if(USE_BUNDLED_LMDB)
|
2021-11-18 04:56:32 +03:00
|
|
|
hunter_add_package_safe(lmdb)
|
2020-01-24 19:35:49 +03:00
|
|
|
find_package(liblmdb CONFIG REQUIRED)
|
2021-03-03 06:26:55 +03:00
|
|
|
|
|
|
|
target_include_directories(liblmdb::lmdb INTERFACE
|
|
|
|
"${HUNTER_INSTALL_PREFIX}/include/lmdb")
|
2020-01-24 19:35:49 +03:00
|
|
|
else()
|
2021-04-03 15:46:03 +03:00
|
|
|
find_package(LMDB REQUIRED)
|
2020-01-24 19:35:49 +03:00
|
|
|
endif()
|
2017-07-29 11:49:00 +03:00
|
|
|
|
2017-07-09 12:49:17 +03:00
|
|
|
#
|
|
|
|
# Discover Qt dependencies.
|
|
|
|
#
|
2023-06-02 01:24:26 +03:00
|
|
|
find_package(Qt6 6.5 COMPONENTS Core Widgets Gui LinguistTools Svg Multimedia Qml QuickControls2 REQUIRED)
|
2023-06-01 23:09:54 +03:00
|
|
|
#find_package(Qt6QuickCompiler)
|
|
|
|
find_package(Qt6DBus)
|
2020-12-18 05:21:17 +03:00
|
|
|
|
|
|
|
if (USE_BUNDLED_QTKEYCHAIN)
|
|
|
|
include(FetchContent)
|
2023-06-01 23:09:54 +03:00
|
|
|
set(BUILD_WITH_QT6 ON)
|
2020-12-18 05:21:17 +03:00
|
|
|
FetchContent_Declare(
|
2023-06-01 23:09:54 +03:00
|
|
|
qt6keychain
|
2020-12-18 05:21:17 +03:00
|
|
|
GIT_REPOSITORY https://github.com/frankosterfeld/qtkeychain.git
|
2023-06-01 23:09:54 +03:00
|
|
|
GIT_TAG v0.14.0
|
2020-12-18 05:21:17 +03:00
|
|
|
)
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
set(QTKEYCHAIN_STATIC OFF CACHE INTERNAL "")
|
|
|
|
else()
|
|
|
|
set(QTKEYCHAIN_STATIC ON CACHE INTERNAL "")
|
|
|
|
endif()
|
|
|
|
set(BUILD_TEST_APPLICATION OFF CACHE INTERNAL "")
|
2023-06-01 23:09:54 +03:00
|
|
|
FetchContent_MakeAvailable(qt6keychain)
|
2020-12-18 05:21:17 +03:00
|
|
|
else()
|
2023-06-01 23:09:54 +03:00
|
|
|
find_package(Qt6Keychain REQUIRED)
|
2020-12-18 05:21:17 +03:00
|
|
|
endif()
|
2017-04-06 02:06:42 +03:00
|
|
|
|
2023-06-01 23:09:54 +03:00
|
|
|
if (Qt6Widgets_FOUND)
|
|
|
|
if (Qt6Widgets_VERSION VERSION_LESS 6.5.0)
|
|
|
|
message(STATUS "Qt version ${Qt6Widgets_VERSION}")
|
|
|
|
message(WARNING "Minimum supported Qt6 version is 6.5!")
|
2020-01-25 02:58:22 +03:00
|
|
|
endif()
|
2023-06-01 23:09:54 +03:00
|
|
|
endif(Qt6Widgets_FOUND)
|
2017-05-30 14:35:01 +03:00
|
|
|
|
2017-04-06 02:06:42 +03:00
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2018-06-04 16:07:47 +03:00
|
|
|
if(NOT MSVC)
|
2020-01-25 02:58:22 +03:00
|
|
|
set(
|
|
|
|
CMAKE_CXX_FLAGS
|
|
|
|
"${CMAKE_CXX_FLAGS} \
|
|
|
|
-Wall \
|
|
|
|
-Wextra \
|
|
|
|
-pedantic \
|
|
|
|
-fsized-deallocation \
|
|
|
|
-fdiagnostics-color=always \
|
|
|
|
-Wunreachable-code \
|
2021-01-12 18:45:22 +03:00
|
|
|
-Wno-attributes"
|
2020-01-25 02:58:22 +03:00
|
|
|
)
|
|
|
|
if (NOT CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
# -Wshadow is buggy and broken in GCC, so do not enable it.
|
|
|
|
# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79328
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
|
|
|
|
endif()
|
2018-06-04 16:07:47 +03:00
|
|
|
endif()
|
2017-04-06 02:06:42 +03:00
|
|
|
|
2019-01-28 05:03:07 +03:00
|
|
|
if (MSVC)
|
2020-01-25 02:58:22 +03:00
|
|
|
set(
|
|
|
|
CMAKE_CXX_FLAGS
|
|
|
|
"${CMAKE_CXX_FLAGS} /bigobj"
|
|
|
|
)
|
2019-01-28 05:03:07 +03:00
|
|
|
endif()
|
|
|
|
|
2018-06-14 02:17:38 +03:00
|
|
|
if(NOT (CMAKE_BUILD_TYPE OR CMAKE_CONFIGURATION_TYPES))
|
2020-01-25 02:58:22 +03:00
|
|
|
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
|
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
|
|
|
FORCE)
|
|
|
|
message("Setting build type to '${CMAKE_BUILD_TYPE}'")
|
2018-06-14 02:17:38 +03:00
|
|
|
else(NOT (CMAKE_BUILD_TYPE OR CMAKE_CONFIGURATION_TYPES))
|
2020-01-25 02:58:22 +03:00
|
|
|
message("Build type set to '${CMAKE_BUILD_TYPE}'")
|
2018-06-14 02:17:38 +03:00
|
|
|
endif(NOT (CMAKE_BUILD_TYPE OR CMAKE_CONFIGURATION_TYPES))
|
2017-04-11 18:25:39 +03:00
|
|
|
|
2018-10-06 17:45:56 +03:00
|
|
|
set(SPDLOG_DEBUG_ON false)
|
|
|
|
|
|
|
|
# Windows doesn't handle CMAKE_BUILD_TYPE.
|
|
|
|
if(NOT WIN32)
|
2021-03-28 02:25:00 +03:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
2020-01-25 02:58:22 +03:00
|
|
|
set(SPDLOG_DEBUG_ON true)
|
|
|
|
else()
|
|
|
|
set(SPDLOG_DEBUG_ON false)
|
|
|
|
endif()
|
2018-09-30 14:33:54 +03:00
|
|
|
endif()
|
|
|
|
|
2018-03-22 17:20:22 +03:00
|
|
|
find_program(GIT git)
|
|
|
|
if(GIT)
|
2020-01-25 02:58:22 +03:00
|
|
|
execute_process(
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
COMMAND ${GIT} rev-parse --short HEAD
|
|
|
|
OUTPUT_VARIABLE GIT_OUT OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
if(GIT_OUT)
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${GIT_OUT}")
|
|
|
|
else()
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}")
|
|
|
|
endif()
|
2018-03-22 17:20:22 +03:00
|
|
|
endif(GIT)
|
2017-04-11 18:25:39 +03:00
|
|
|
|
|
|
|
set(CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
|
|
|
set(PROJECT_VERSION ${CPACK_PACKAGE_VERSION})
|
|
|
|
|
|
|
|
message(STATUS "Version: ${PROJECT_VERSION}")
|
|
|
|
|
2018-03-22 17:20:22 +03:00
|
|
|
cmake_host_system_information(RESULT BUILD_HOST QUERY HOSTNAME)
|
2021-06-30 16:01:41 +03:00
|
|
|
|
|
|
|
include(CheckSymbolExists)
|
|
|
|
check_symbol_exists(backtrace_symbols_fd "execinfo.h" HAVE_BACKTRACE_SYMBOLS_FD)
|
|
|
|
|
2018-09-30 14:33:54 +03:00
|
|
|
configure_file(cmake/nheko.h config/nheko.h)
|
2018-03-22 17:20:22 +03:00
|
|
|
|
2017-07-09 12:49:17 +03:00
|
|
|
#
|
|
|
|
# Declare source and header files.
|
|
|
|
#
|
2017-04-06 02:06:42 +03:00
|
|
|
set(SRC_FILES
|
2020-01-25 02:58:22 +03:00
|
|
|
# Emoji
|
2021-06-30 03:43:36 +03:00
|
|
|
src/emoji/Provider.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/emoji/Provider.h
|
2020-01-25 02:58:22 +03:00
|
|
|
|
|
|
|
# Timeline
|
2021-06-10 00:52:28 +03:00
|
|
|
src/timeline/CommunitiesModel.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/timeline/CommunitiesModel.h
|
|
|
|
src/timeline/DelegateChooser.cpp
|
|
|
|
src/timeline/DelegateChooser.h
|
2020-07-10 00:15:22 +03:00
|
|
|
src/timeline/EventStore.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/timeline/EventStore.h
|
2020-11-01 01:24:07 +03:00
|
|
|
src/timeline/InputBar.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/timeline/InputBar.h
|
2021-05-02 19:01:18 +03:00
|
|
|
src/timeline/Permissions.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/timeline/Permissions.h
|
2021-12-30 06:54:03 +03:00
|
|
|
src/timeline/PresenceEmitter.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/timeline/PresenceEmitter.h
|
|
|
|
src/timeline/Reaction.cpp
|
|
|
|
src/timeline/Reaction.h
|
2021-05-19 20:34:10 +03:00
|
|
|
src/timeline/RoomlistModel.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/timeline/RoomlistModel.h
|
2022-10-06 02:39:30 +03:00
|
|
|
src/timeline/TimelineFilter.cpp
|
|
|
|
src/timeline/TimelineFilter.h
|
2022-06-09 15:59:29 +03:00
|
|
|
src/timeline/TimelineModel.cpp
|
|
|
|
src/timeline/TimelineModel.h
|
|
|
|
src/timeline/TimelineViewManager.cpp
|
|
|
|
src/timeline/TimelineViewManager.h
|
2020-01-25 02:58:22 +03:00
|
|
|
|
|
|
|
# UI components
|
2022-02-12 21:27:51 +03:00
|
|
|
src/ui/HiddenEvents.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ui/HiddenEvents.h
|
2023-07-05 01:08:37 +03:00
|
|
|
src/ui/EventExpiry.cpp
|
|
|
|
src/ui/EventExpiry.h
|
2021-08-29 06:20:23 +03:00
|
|
|
src/ui/MxcAnimatedImage.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ui/MxcAnimatedImage.h
|
2021-08-28 01:38:33 +03:00
|
|
|
src/ui/MxcMediaProxy.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ui/MxcMediaProxy.h
|
2021-02-14 03:28:28 +03:00
|
|
|
src/ui/NhekoCursorShape.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ui/NhekoCursorShape.h
|
2020-11-25 19:02:23 +03:00
|
|
|
src/ui/NhekoDropArea.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ui/NhekoDropArea.h
|
2021-05-13 09:23:56 +03:00
|
|
|
src/ui/NhekoGlobalObject.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ui/NhekoGlobalObject.h
|
2021-05-13 09:23:56 +03:00
|
|
|
src/ui/RoomSettings.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ui/RoomSettings.h
|
2022-08-05 22:44:40 +03:00
|
|
|
src/ui/RoomSummary.cpp
|
2023-09-26 01:03:57 +03:00
|
|
|
src/ui/RoomSummary.h
|
|
|
|
src/ui/ShortcutRegistry.cpp
|
|
|
|
src/ui/ShortcutRegistry.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/ui/Theme.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ui/Theme.h
|
2021-09-18 01:21:14 +03:00
|
|
|
src/ui/UIA.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ui/UIA.h
|
2020-05-17 16:34:47 +03:00
|
|
|
src/ui/UserProfile.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ui/UserProfile.h
|
2020-01-25 02:58:22 +03:00
|
|
|
|
2021-10-14 23:53:11 +03:00
|
|
|
src/voip/CallDevices.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/voip/CallDevices.h
|
2021-10-14 23:53:11 +03:00
|
|
|
src/voip/CallManager.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/voip/CallManager.h
|
2023-03-11 16:36:51 +03:00
|
|
|
src/voip/ScreenCastPortal.cpp
|
|
|
|
src/voip/ScreenCastPortal.h
|
|
|
|
src/voip/WebRTCSession.h
|
2021-10-14 23:53:11 +03:00
|
|
|
src/voip/WebRTCSession.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/voip/WebRTCSession.h
|
2021-10-14 23:53:11 +03:00
|
|
|
|
|
|
|
src/encryption/DeviceVerificationFlow.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/encryption/DeviceVerificationFlow.h
|
2021-10-14 23:53:11 +03:00
|
|
|
src/encryption/Olm.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/encryption/Olm.h
|
2021-10-14 23:53:11 +03:00
|
|
|
src/encryption/SelfVerificationStatus.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/encryption/SelfVerificationStatus.h
|
2021-10-15 03:44:48 +03:00
|
|
|
src/encryption/VerificationManager.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/encryption/VerificationManager.h
|
2021-10-14 23:53:11 +03:00
|
|
|
|
2021-06-30 03:43:36 +03:00
|
|
|
# Generic notification stuff
|
|
|
|
src/notifications/Manager.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/notifications/Manager.h
|
2021-02-16 02:36:10 +03:00
|
|
|
|
2022-06-05 14:51:29 +03:00
|
|
|
src/dock/Dock.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/dock/Dock.h
|
2022-06-05 14:51:29 +03:00
|
|
|
|
2022-07-08 18:28:28 +03:00
|
|
|
src/AliasEditModel.cpp
|
|
|
|
src/AliasEditModel.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/AvatarProvider.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/AvatarProvider.h
|
2020-03-01 21:55:43 +03:00
|
|
|
src/BlurhashProvider.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/BlurhashProvider.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/Cache.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/Cache.h
|
|
|
|
src/CacheCryptoStructs.h
|
|
|
|
src/CacheStructs.h
|
|
|
|
src/Cache_p.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/ChatPage.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ChatPage.h
|
2021-04-29 22:46:49 +03:00
|
|
|
src/Clipboard.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/Clipboard.h
|
2020-03-01 21:55:43 +03:00
|
|
|
src/ColorImageProvider.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ColorImageProvider.h
|
|
|
|
src/CombinedImagePackModel.cpp
|
|
|
|
src/CombinedImagePackModel.h
|
2023-05-19 04:15:55 +03:00
|
|
|
src/GridImagePackModel.cpp
|
|
|
|
src/GridImagePackModel.h
|
2022-11-09 06:58:19 +03:00
|
|
|
src/CommandCompleter.cpp
|
|
|
|
src/CommandCompleter.h
|
2022-06-09 15:59:29 +03:00
|
|
|
src/CompletionModelRoles.h
|
2020-11-24 17:35:56 +03:00
|
|
|
src/CompletionProxyModel.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/CompletionProxyModel.h
|
|
|
|
src/Config.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/EventAccessors.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/EventAccessors.h
|
2023-07-13 19:53:51 +03:00
|
|
|
src/FallbackAuth.cpp
|
|
|
|
src/FallbackAuth.h
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ImagePackListModel.cpp
|
|
|
|
src/ImagePackListModel.h
|
2021-06-11 03:13:12 +03:00
|
|
|
src/InviteesModel.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/InviteesModel.h
|
2020-12-25 17:14:00 +03:00
|
|
|
src/JdenticonProvider.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/JdenticonProvider.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/Logging.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/Logging.h
|
2020-03-01 21:55:43 +03:00
|
|
|
src/LoginPage.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/LoginPage.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/MainWindow.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/MainWindow.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/MatrixClient.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/MatrixClient.h
|
2021-05-30 04:09:21 +03:00
|
|
|
src/MemberList.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/MemberList.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/MxcImageProvider.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/MxcImageProvider.h
|
2022-05-27 17:31:54 +03:00
|
|
|
src/PowerlevelsEditModels.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/PowerlevelsEditModels.h
|
2021-08-28 01:38:33 +03:00
|
|
|
src/ReadReceiptsModel.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/ReadReceiptsModel.h
|
2023-06-29 00:00:34 +03:00
|
|
|
src/ReCaptcha.cpp
|
|
|
|
src/ReCaptcha.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/RegisterPage.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/RegisterPage.h
|
|
|
|
src/RoomDirectoryModel.cpp
|
|
|
|
src/RoomDirectoryModel.h
|
|
|
|
src/RoomsModel.cpp
|
|
|
|
src/RoomsModel.h
|
2020-05-10 00:31:00 +03:00
|
|
|
src/SSOHandler.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/SSOHandler.h
|
2021-07-21 14:37:57 +03:00
|
|
|
src/SingleImagePackModel.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/SingleImagePackModel.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/TrayIcon.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/TrayIcon.h
|
2020-01-25 02:58:22 +03:00
|
|
|
src/UserSettingsPage.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/UserSettingsPage.h
|
2020-09-07 12:51:28 +03:00
|
|
|
src/UsersModel.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/UsersModel.h
|
2020-03-01 21:55:43 +03:00
|
|
|
src/Utils.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
src/Utils.h
|
2020-03-01 21:55:43 +03:00
|
|
|
|
2022-06-09 15:59:29 +03:00
|
|
|
includes/jdenticoninterface.h
|
2017-04-06 02:06:42 +03:00
|
|
|
|
2022-06-09 15:59:29 +03:00
|
|
|
src/main.cpp
|
|
|
|
)
|
2018-03-29 09:59:04 +03:00
|
|
|
|
2019-02-24 22:50:31 +03:00
|
|
|
include(FeatureSummary)
|
|
|
|
|
2020-05-15 23:48:30 +03:00
|
|
|
|
2020-01-24 19:35:49 +03:00
|
|
|
if(USE_BUNDLED_OPENSSL)
|
2021-11-18 04:56:32 +03:00
|
|
|
hunter_add_package_safe(OpenSSL)
|
2020-01-24 19:35:49 +03:00
|
|
|
endif()
|
2020-07-01 01:46:44 +03:00
|
|
|
find_package(OpenSSL 1.1.0 REQUIRED)
|
2020-01-24 19:35:49 +03:00
|
|
|
if(USE_BUNDLED_OLM)
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
|
|
Olm
|
|
|
|
GIT_REPOSITORY https://gitlab.matrix.org/matrix-org/olm.git
|
2022-07-22 16:45:15 +03:00
|
|
|
GIT_TAG 3.2.12
|
2020-01-24 19:35:49 +03:00
|
|
|
)
|
2020-12-18 05:21:17 +03:00
|
|
|
set(OLM_TESTS OFF CACHE INTERNAL "")
|
2020-01-24 19:35:49 +03:00
|
|
|
FetchContent_MakeAvailable(Olm)
|
|
|
|
else()
|
2022-05-14 02:42:21 +03:00
|
|
|
find_package(Olm 3.2.7 REQUIRED)
|
2020-01-24 19:35:49 +03:00
|
|
|
set_package_properties(Olm PROPERTIES
|
|
|
|
DESCRIPTION "An implementation of the Double Ratchet cryptographic ratchet"
|
|
|
|
URL "https://git.matrix.org/git/olm/about/"
|
|
|
|
TYPE REQUIRED
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(USE_BUNDLED_SPDLOG)
|
2021-11-18 04:56:32 +03:00
|
|
|
hunter_add_package_safe(spdlog)
|
2020-01-24 19:35:49 +03:00
|
|
|
endif()
|
2018-08-08 14:15:14 +03:00
|
|
|
find_package(spdlog 1.0.0 CONFIG REQUIRED)
|
2020-01-24 19:35:49 +03:00
|
|
|
|
|
|
|
if(USE_BUNDLED_CMARK)
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
|
|
cmark
|
|
|
|
GIT_REPOSITORY https://github.com/commonmark/cmark.git
|
2021-11-18 00:23:50 +03:00
|
|
|
GIT_TAG 0.30.2
|
2020-01-25 21:47:54 +03:00
|
|
|
CMAKE_ARGS "CMARK_STATIC=ON CMARK_SHARED=OFF CMARK_TESTS=OFF CMARK_TESTS=OFF"
|
2020-01-24 19:35:49 +03:00
|
|
|
)
|
|
|
|
FetchContent_MakeAvailable(cmark)
|
2020-01-26 17:44:56 +03:00
|
|
|
if (MSVC)
|
2021-11-18 00:23:50 +03:00
|
|
|
add_library(cmark::cmark ALIAS cmark)
|
2020-01-26 17:44:56 +03:00
|
|
|
else()
|
2021-11-18 00:23:50 +03:00
|
|
|
add_library(cmark::cmark ALIAS cmark_static)
|
2020-01-26 17:44:56 +03:00
|
|
|
endif()
|
2020-01-24 19:35:49 +03:00
|
|
|
else()
|
2020-04-16 00:29:53 +03:00
|
|
|
find_package(cmark REQUIRED 0.29.0)
|
2020-01-24 19:35:49 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(USE_BUNDLED_JSON)
|
2021-11-18 04:56:32 +03:00
|
|
|
hunter_add_package_safe(nlohmann_json)
|
2020-01-24 19:35:49 +03:00
|
|
|
endif()
|
2019-02-24 22:50:31 +03:00
|
|
|
find_package(nlohmann_json 3.2.0)
|
|
|
|
set_package_properties(nlohmann_json PROPERTIES
|
2020-01-25 02:58:22 +03:00
|
|
|
DESCRIPTION "JSON for Modern C++, a C++11 header-only JSON class"
|
|
|
|
URL "https://nlohmann.github.io/json/"
|
|
|
|
TYPE REQUIRED
|
|
|
|
)
|
2018-03-03 14:02:33 +03:00
|
|
|
|
2020-01-24 19:35:49 +03:00
|
|
|
if(USE_BUNDLED_LMDBXX)
|
2021-03-07 04:18:41 +03:00
|
|
|
include(FetchContent)
|
2021-03-03 01:15:12 +03:00
|
|
|
FetchContent_Declare(
|
2021-06-30 03:43:36 +03:00
|
|
|
lmdbxx
|
|
|
|
URL "https://raw.githubusercontent.com/hoytech/lmdbxx/1.0.0/lmdb++.h"
|
|
|
|
DOWNLOAD_NO_EXTRACT TRUE
|
2021-11-18 05:10:04 +03:00
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
BUILD_COMMAND ""
|
2021-06-30 03:43:36 +03:00
|
|
|
)
|
2021-11-18 05:10:04 +03:00
|
|
|
FetchContent_Populate(lmdbxx)
|
2021-03-03 01:15:12 +03:00
|
|
|
add_library(lmdbxx INTERFACE)
|
|
|
|
target_include_directories(lmdbxx INTERFACE ${lmdbxx_SOURCE_DIR})
|
|
|
|
add_library(lmdbxx::lmdbxx ALIAS lmdbxx)
|
2020-01-24 19:35:49 +03:00
|
|
|
else()
|
|
|
|
if(NOT LMDBXX_INCLUDE_DIR)
|
|
|
|
find_path(LMDBXX_INCLUDE_DIR
|
|
|
|
NAMES lmdb++.h
|
|
|
|
PATHS /usr/include
|
|
|
|
/usr/local/include
|
|
|
|
$ENV{LIB_DIR}/include
|
|
|
|
$ENV{LIB_DIR}/include/lmdbxx)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
add_library(lmdbxx INTERFACE)
|
|
|
|
target_include_directories(lmdbxx INTERFACE ${LMDBXX_INCLUDE_DIR})
|
|
|
|
add_library(lmdbxx::lmdbxx ALIAS lmdbxx)
|
2018-03-29 09:59:04 +03:00
|
|
|
endif()
|
2017-08-06 11:01:46 +03:00
|
|
|
|
2022-06-09 03:41:25 +03:00
|
|
|
if(USE_BUNDLED_MTXCLIENT)
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
|
|
MatrixClient
|
2022-12-10 18:17:15 +03:00
|
|
|
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
|
2023-09-15 22:34:12 +03:00
|
|
|
GIT_TAG 8936559c00542528a7776d774fccb7ff674c9c7f
|
2022-06-09 03:41:25 +03:00
|
|
|
)
|
|
|
|
set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "")
|
|
|
|
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")
|
|
|
|
FetchContent_MakeAvailable(MatrixClient)
|
|
|
|
else()
|
2023-01-13 00:03:54 +03:00
|
|
|
find_package(MatrixClient 0.9.0 REQUIRED)
|
2022-06-09 03:41:25 +03:00
|
|
|
endif()
|
|
|
|
|
2021-11-19 01:05:28 +03:00
|
|
|
if (VOIP)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(GSTREAMER REQUIRED IMPORTED_TARGET gstreamer-sdp-1.0>=1.18 gstreamer-webrtc-1.0>=1.18)
|
2023-06-03 03:45:38 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (X11 AND NOT WIN32 AND NOT APPLE AND NOT HAIKU)
|
|
|
|
pkg_check_modules(XCB REQUIRED IMPORTED_TARGET xcb xcb-ewmh)
|
2021-01-06 18:47:35 +03:00
|
|
|
endif()
|
2020-07-11 02:19:48 +03:00
|
|
|
|
2020-02-23 15:40:04 +03:00
|
|
|
# single instance functionality
|
|
|
|
set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
|
2021-12-15 17:20:04 +03:00
|
|
|
add_subdirectory(third_party/SingleApplication-3.3.2/)
|
2020-02-23 15:40:04 +03:00
|
|
|
|
2019-02-24 22:50:31 +03:00
|
|
|
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
|
|
|
|
2022-04-14 18:02:55 +03:00
|
|
|
# this must be defined here to make the moc work properly
|
|
|
|
if (NOT APPLE AND NOT WIN32)
|
|
|
|
add_compile_definitions(NHEKO_DBUS_SYS)
|
|
|
|
endif()
|
|
|
|
|
2017-07-09 12:49:17 +03:00
|
|
|
#
|
2023-06-08 23:44:16 +03:00
|
|
|
# Bundle resources
|
2017-07-09 12:49:17 +03:00
|
|
|
#
|
2023-06-08 23:44:16 +03:00
|
|
|
if(Qt6QuickCompiler_FOUND AND COMPILE_QML)
|
|
|
|
qtquick_compiler_add_resources(QRC resources/res.qrc)
|
|
|
|
else()
|
|
|
|
qt_add_resources(QRC resources/res.qrc)
|
|
|
|
endif()
|
2017-05-29 19:09:12 +03:00
|
|
|
|
2018-05-05 22:40:24 +03:00
|
|
|
if (APPLE)
|
2021-11-02 03:48:51 +03:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Foundation -framework Cocoa -framework UserNotifications")
|
2022-11-04 19:42:09 +03:00
|
|
|
set(SRC_FILES ${SRC_FILES} src/notifications/NotificationManagerProxy.h src/notifications/MacNotificationDelegate.h src/notifications/MacNotificationDelegate.mm src/notifications/ManagerMac.mm src/notifications/ManagerMac.cpp src/emoji/MacHelper.mm src/emoji/MacHelper.h)
|
2020-05-30 17:53:57 +03:00
|
|
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
|
2022-11-04 19:42:09 +03:00
|
|
|
set_source_files_properties( src/notifications/NotificationManagerProxy.h src/notifications/MacNotificationDelegate.h src/notifications/MacNotificationDelegate.mm src/notifications/ManagerMac.mm src/emoji/MacHelper.mm src/emoji/MacHelper.h PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
2020-05-30 17:53:57 +03:00
|
|
|
endif()
|
2018-05-05 22:40:24 +03:00
|
|
|
elseif (WIN32)
|
2020-01-25 02:58:22 +03:00
|
|
|
file(DOWNLOAD
|
|
|
|
"https://raw.githubusercontent.com/mohabouje/WinToast/41ed1c58d5dce0ee9c01dbdeac05be45358d4f57/src/wintoastlib.cpp"
|
|
|
|
${PROJECT_SOURCE_DIR}/src/wintoastlib.cpp
|
|
|
|
EXPECTED_HASH SHA256=1A1A7CE41C1052B12946798F4A6C67CE1FAD209C967F5ED4D720B173527E2073)
|
2018-07-01 00:23:16 +03:00
|
|
|
|
2020-01-25 02:58:22 +03:00
|
|
|
file(DOWNLOAD
|
|
|
|
"https://raw.githubusercontent.com/mohabouje/WinToast/41ed1c58d5dce0ee9c01dbdeac05be45358d4f57/src/wintoastlib.h"
|
|
|
|
${PROJECT_SOURCE_DIR}/src/wintoastlib.h
|
|
|
|
EXPECTED_HASH SHA256=b4481023c5782733795838be22bf1a75f45d87458cd4d9a5a75f664a146eea11)
|
2018-07-01 00:23:16 +03:00
|
|
|
|
2022-06-09 15:59:29 +03:00
|
|
|
set(SRC_FILES ${SRC_FILES} src/notifications/ManagerWin.cpp src/wintoastlib.cpp src/wintoastlib.h)
|
2018-05-05 22:40:24 +03:00
|
|
|
else ()
|
2022-04-14 18:02:55 +03:00
|
|
|
set(SRC_FILES ${SRC_FILES}
|
2022-06-09 15:59:29 +03:00
|
|
|
src/dbus/NhekoDBusApi.h
|
|
|
|
src/dbus/NhekoDBusBackend.h
|
2022-04-14 18:02:55 +03:00
|
|
|
src/dbus/NhekoDBusApi.cpp
|
|
|
|
src/dbus/NhekoDBusBackend.cpp
|
|
|
|
src/notifications/ManagerLinux.cpp
|
2022-06-09 15:59:29 +03:00
|
|
|
)
|
2018-05-05 22:40:24 +03:00
|
|
|
endif ()
|
|
|
|
|
2018-03-29 09:59:04 +03:00
|
|
|
set(NHEKO_DEPS
|
2020-01-25 02:58:22 +03:00
|
|
|
${SRC_FILES}
|
2023-06-08 23:44:16 +03:00
|
|
|
${QRC}
|
2020-01-25 02:58:22 +03:00
|
|
|
${META_FILES_TO_INCLUDE})
|
2017-10-08 16:49:56 +03:00
|
|
|
|
2018-05-04 18:11:03 +03:00
|
|
|
if(ASAN)
|
2020-01-25 02:58:22 +03:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined")
|
2018-05-04 18:11:03 +03:00
|
|
|
endif()
|
|
|
|
|
2020-03-23 13:09:27 +03:00
|
|
|
if(WIN32)
|
2023-06-19 02:38:40 +03:00
|
|
|
qt_add_executable (nheko WIN32 ${OS_BUNDLE} ${NHEKO_DEPS})
|
2021-11-21 23:19:56 +03:00
|
|
|
target_compile_definitions(nheko PRIVATE _WIN32_WINNT=0x0601 NOMINMAX WIN32_LEAN_AND_MEAN STRICT)
|
2020-03-23 13:09:27 +03:00
|
|
|
else()
|
2023-06-19 02:38:40 +03:00
|
|
|
qt_add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS})
|
2021-06-30 16:01:41 +03:00
|
|
|
|
|
|
|
if (HAVE_BACKTRACE_SYMBOLS_FD AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
|
|
set_target_properties(nheko PROPERTIES ENABLE_EXPORTS ON)
|
|
|
|
endif()
|
2020-03-23 13:09:27 +03:00
|
|
|
endif()
|
|
|
|
|
2022-09-23 16:13:59 +03:00
|
|
|
set_target_properties(nheko
|
|
|
|
PROPERTIES
|
|
|
|
CMAKE_SKIP_INSTALL_RPATH TRUE
|
|
|
|
AUTOMOC ON)
|
|
|
|
|
2023-06-19 02:38:40 +03:00
|
|
|
#
|
|
|
|
# Add qml files
|
|
|
|
#
|
|
|
|
|
|
|
|
set(QML_SOURCES
|
|
|
|
resources/qml/Root.qml
|
|
|
|
resources/qml/ChatPage.qml
|
|
|
|
resources/qml/CommunitiesList.qml
|
|
|
|
resources/qml/RoomList.qml
|
|
|
|
resources/qml/TimelineView.qml
|
|
|
|
resources/qml/Avatar.qml
|
|
|
|
resources/qml/Completer.qml
|
|
|
|
resources/qml/EncryptionIndicator.qml
|
|
|
|
resources/qml/ImageButton.qml
|
|
|
|
resources/qml/ElidedLabel.qml
|
|
|
|
resources/qml/MatrixText.qml
|
|
|
|
resources/qml/MatrixTextField.qml
|
|
|
|
resources/qml/ToggleButton.qml
|
|
|
|
resources/qml/UploadBox.qml
|
|
|
|
resources/qml/MessageInput.qml
|
|
|
|
resources/qml/MessageView.qml
|
|
|
|
resources/qml/PrivacyScreen.qml
|
|
|
|
resources/qml/Reactions.qml
|
|
|
|
resources/qml/ReplyPopup.qml
|
|
|
|
resources/qml/StatusIndicator.qml
|
|
|
|
resources/qml/TimelineRow.qml
|
|
|
|
resources/qml/TopBar.qml
|
|
|
|
resources/qml/QuickSwitcher.qml
|
|
|
|
resources/qml/ForwardCompleter.qml
|
|
|
|
resources/qml/SelfVerificationCheck.qml
|
|
|
|
resources/qml/TypingIndicator.qml
|
|
|
|
resources/qml/MessageInputWarning.qml
|
|
|
|
resources/qml/components/AdaptiveLayout.qml
|
|
|
|
resources/qml/components/AdaptiveLayoutElement.qml
|
|
|
|
resources/qml/components/AvatarListTile.qml
|
|
|
|
resources/qml/components/FlatButton.qml
|
|
|
|
resources/qml/components/MainWindowDialog.qml
|
|
|
|
resources/qml/components/NhekoTabButton.qml
|
|
|
|
resources/qml/components/NotificationBubble.qml
|
2023-07-24 01:04:28 +03:00
|
|
|
resources/qml/components/PowerlevelIndicator.qml
|
2023-06-19 02:38:40 +03:00
|
|
|
resources/qml/components/ReorderableListview.qml
|
|
|
|
resources/qml/components/SpaceMenuLevel.qml
|
|
|
|
resources/qml/components/TextButton.qml
|
|
|
|
resources/qml/components/UserListRow.qml
|
|
|
|
resources/qml/delegates/Encrypted.qml
|
|
|
|
resources/qml/delegates/FileMessage.qml
|
|
|
|
resources/qml/delegates/ImageMessage.qml
|
|
|
|
resources/qml/delegates/MessageDelegate.qml
|
|
|
|
resources/qml/delegates/NoticeMessage.qml
|
|
|
|
resources/qml/delegates/Pill.qml
|
|
|
|
resources/qml/delegates/Placeholder.qml
|
|
|
|
resources/qml/delegates/PlayableMediaMessage.qml
|
|
|
|
resources/qml/delegates/Redacted.qml
|
|
|
|
resources/qml/delegates/Reply.qml
|
|
|
|
resources/qml/delegates/TextMessage.qml
|
|
|
|
resources/qml/device-verification/DeviceVerification.qml
|
|
|
|
resources/qml/device-verification/DigitVerification.qml
|
|
|
|
resources/qml/device-verification/EmojiVerification.qml
|
|
|
|
resources/qml/device-verification/Failed.qml
|
|
|
|
resources/qml/device-verification/NewVerificationRequest.qml
|
|
|
|
resources/qml/device-verification/Success.qml
|
|
|
|
resources/qml/device-verification/Waiting.qml
|
|
|
|
resources/qml/dialogs/AliasEditor.qml
|
|
|
|
resources/qml/dialogs/ConfirmJoinRoomDialog.qml
|
|
|
|
resources/qml/dialogs/CreateDirect.qml
|
|
|
|
resources/qml/dialogs/CreateRoom.qml
|
2023-07-13 19:53:51 +03:00
|
|
|
resources/qml/dialogs/FallbackAuthDialog.qml
|
2023-06-19 02:38:40 +03:00
|
|
|
resources/qml/dialogs/HiddenEventsDialog.qml
|
2023-07-13 19:53:51 +03:00
|
|
|
resources/qml/dialogs/EventExpirationDialog.qml
|
2023-06-19 02:38:40 +03:00
|
|
|
resources/qml/dialogs/ImageOverlay.qml
|
|
|
|
resources/qml/dialogs/ImagePackEditorDialog.qml
|
|
|
|
resources/qml/dialogs/ImagePackSettingsDialog.qml
|
|
|
|
resources/qml/dialogs/InputDialog.qml
|
|
|
|
resources/qml/dialogs/InviteDialog.qml
|
|
|
|
resources/qml/dialogs/JoinRoomDialog.qml
|
|
|
|
resources/qml/dialogs/LeaveRoomDialog.qml
|
|
|
|
resources/qml/dialogs/LogoutDialog.qml
|
|
|
|
resources/qml/dialogs/PhoneNumberInputDialog.qml
|
|
|
|
resources/qml/dialogs/PowerLevelEditor.qml
|
|
|
|
resources/qml/dialogs/PowerLevelSpacesApplyDialog.qml
|
|
|
|
resources/qml/dialogs/RawMessageDialog.qml
|
|
|
|
resources/qml/dialogs/ReadReceipts.qml
|
2023-06-29 00:00:34 +03:00
|
|
|
resources/qml/dialogs/ReCaptchaDialog.qml
|
2023-06-19 02:38:40 +03:00
|
|
|
resources/qml/dialogs/RoomDirectory.qml
|
|
|
|
resources/qml/dialogs/RoomMembers.qml
|
|
|
|
resources/qml/dialogs/AllowedRoomsSettingsDialog.qml
|
|
|
|
resources/qml/dialogs/RoomSettings.qml
|
2023-09-26 17:19:32 +03:00
|
|
|
resources/qml/dialogs/ShortcutEditor.qml
|
2023-06-19 02:38:40 +03:00
|
|
|
resources/qml/dialogs/UserProfile.qml
|
|
|
|
resources/qml/emoji/StickerPicker.qml
|
|
|
|
resources/qml/pages/LoginPage.qml
|
|
|
|
resources/qml/pages/RegisterPage.qml
|
|
|
|
resources/qml/pages/UserSettingsPage.qml
|
|
|
|
resources/qml/pages/WelcomePage.qml
|
|
|
|
resources/qml/ui/NhekoSlider.qml
|
|
|
|
resources/qml/ui/Ripple.qml
|
|
|
|
resources/qml/ui/Snackbar.qml
|
|
|
|
resources/qml/ui/Spinner.qml
|
|
|
|
resources/qml/ui/animations/BlinkAnimation.qml
|
|
|
|
resources/qml/ui/media/MediaControls.qml
|
|
|
|
resources/qml/voip/ActiveCallBar.qml
|
|
|
|
resources/qml/voip/CallDevices.qml
|
|
|
|
resources/qml/voip/CallInvite.qml
|
|
|
|
resources/qml/voip/CallInviteBar.qml
|
|
|
|
resources/qml/voip/DeviceError.qml
|
|
|
|
resources/qml/voip/PlaceCall.qml
|
|
|
|
resources/qml/voip/ScreenShare.qml
|
|
|
|
resources/qml/voip/VideoCall.qml
|
|
|
|
resources/qml/delegates/EncryptionEnabled.qml
|
|
|
|
resources/qml/ui/TimelineEffects.qml
|
|
|
|
)
|
|
|
|
qt_add_qml_module(nheko
|
|
|
|
URI im.nheko
|
|
|
|
NO_RESOURCE_TARGET_PATH
|
|
|
|
RESOURCE_PREFIX "/"
|
|
|
|
VERSION 1.1
|
|
|
|
DEPENDENCIES QtQml QtQuick # https://bugreports.qt.io/browse/QTBUG-102554
|
|
|
|
QML_FILES
|
|
|
|
${QML_SOURCES}
|
|
|
|
SOURCES
|
|
|
|
src/UserDirectoryModel.cpp
|
2023-09-26 01:03:57 +03:00
|
|
|
src/UserDirectoryModel.h
|
2023-06-19 02:38:40 +03:00
|
|
|
)
|
|
|
|
#qt_target_qml_sources(nheko
|
|
|
|
# #PREFIX "/"
|
|
|
|
#)
|
|
|
|
|
|
|
|
|
2023-07-13 02:10:09 +03:00
|
|
|
#
|
|
|
|
# Bundle translations
|
|
|
|
#
|
|
|
|
file(GLOB LANG_TS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/resources/langs/*.ts")
|
|
|
|
qt_add_translations(nheko RESOURCE_PREFIX "/translations" TS_FILES
|
|
|
|
${LANG_TS_SRC} SOURCES ${QML_SOURCES} ${SRC_FILES})
|
|
|
|
|
|
|
|
|
2023-06-03 05:06:13 +03:00
|
|
|
if(WIN32)
|
2020-01-25 02:58:22 +03:00
|
|
|
target_compile_definitions(nheko PRIVATE WIN32_LEAN_AND_MEAN)
|
2021-03-05 17:23:48 +03:00
|
|
|
if(MSVC)
|
|
|
|
target_compile_options(nheko PUBLIC "/Zc:__cplusplus")
|
|
|
|
endif()
|
2017-10-08 16:49:56 +03:00
|
|
|
else()
|
2023-06-01 23:09:54 +03:00
|
|
|
target_link_libraries (nheko PRIVATE Qt6::DBus)
|
2022-02-10 01:46:49 +03:00
|
|
|
if (FLATPAK)
|
|
|
|
target_compile_definitions(nheko PRIVATE NHEKO_FLATPAK)
|
|
|
|
endif()
|
2017-05-02 04:22:33 +03:00
|
|
|
endif()
|
2022-06-09 15:59:29 +03:00
|
|
|
|
2023-06-19 02:38:40 +03:00
|
|
|
target_include_directories(nheko PRIVATE src includes src/timeline/ src/ui/ src/encryption/ src/voip/)
|
2018-01-09 21:34:01 +03:00
|
|
|
|
2023-02-15 12:36:56 +03:00
|
|
|
if (USE_BUNDLED_CPPHTTPLIB)
|
|
|
|
target_include_directories(nheko PRIVATE third_party/cpp-httplib-0.5.12)
|
|
|
|
target_sources(nheko PRIVATE third_party/cpp-httplib-0.5.12/httplib.h)
|
|
|
|
else()
|
|
|
|
find_package(httplib REQUIRED)
|
|
|
|
target_link_libraries(nheko PRIVATE httplib::httplib)
|
|
|
|
endif()
|
|
|
|
|
2023-02-16 17:26:02 +03:00
|
|
|
if (USE_BUNDLED_BLURHASH)
|
|
|
|
target_include_directories(nheko PRIVATE third_party/blurhash)
|
|
|
|
set(BLURHASH_SRC_FILES
|
|
|
|
third_party/blurhash/blurhash.cpp
|
|
|
|
third_party/blurhash/blurhash.hpp
|
|
|
|
)
|
|
|
|
target_sources(nheko PRIVATE ${BLURHASH_SRC_FILES})
|
|
|
|
else()
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(blurhash REQUIRED IMPORTED_TARGET blurhash)
|
|
|
|
target_link_libraries(nheko PRIVATE PkgConfig::blurhash)
|
|
|
|
endif()
|
|
|
|
|
2020-12-18 05:21:17 +03:00
|
|
|
# Fixup bundled keychain include dirs
|
|
|
|
if (USE_BUNDLED_QTKEYCHAIN)
|
2023-06-01 23:09:54 +03:00
|
|
|
target_include_directories(nheko PRIVATE ${qt6keychain_SOURCE_DIR} ${qt6keychain_BINARY_DIR})
|
2020-12-18 05:21:17 +03:00
|
|
|
endif()
|
|
|
|
|
2022-06-17 04:27:29 +03:00
|
|
|
if (NOT JSON_ImplicitConversions)
|
|
|
|
set_target_properties(nlohmann_json::nlohmann_json PROPERTIES
|
|
|
|
INTERFACE_COMPILE_DEFINITIONS "JSON_USE_IMPLICIT_CONVERSIONS=\$<BOOL:OFF>;JSON_DIAGNOSTICS=\$<BOOL:OFF>"
|
|
|
|
)
|
|
|
|
target_compile_definitions(nheko PUBLIC JSON_USE_IMPLICIT_CONVERSIONS=0)
|
|
|
|
endif()
|
|
|
|
|
2020-01-25 02:58:22 +03:00
|
|
|
target_link_libraries(nheko PRIVATE
|
2022-06-09 03:41:25 +03:00
|
|
|
${COEURL_TARGET_NAME}
|
2020-01-25 02:58:22 +03:00
|
|
|
MatrixClient::MatrixClient
|
|
|
|
cmark::cmark
|
|
|
|
spdlog::spdlog
|
2023-06-01 23:09:54 +03:00
|
|
|
Qt::Widgets
|
|
|
|
Qt::Svg
|
2023-06-02 01:24:26 +03:00
|
|
|
Qt::Gui
|
2023-06-01 23:09:54 +03:00
|
|
|
Qt::Multimedia
|
|
|
|
Qt::Qml
|
|
|
|
Qt::QuickControls2
|
|
|
|
qt6keychain
|
2020-01-25 02:58:22 +03:00
|
|
|
nlohmann_json::nlohmann_json
|
|
|
|
lmdbxx::lmdbxx
|
2020-02-14 02:32:08 +03:00
|
|
|
liblmdb::lmdb
|
2020-02-23 15:40:04 +03:00
|
|
|
SingleApplication::SingleApplication)
|
2020-01-25 02:58:22 +03:00
|
|
|
|
2020-05-25 14:02:31 +03:00
|
|
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
|
2021-06-30 03:43:36 +03:00
|
|
|
target_precompile_headers(nheko
|
|
|
|
PRIVATE
|
|
|
|
<string>
|
|
|
|
<algorithm>
|
|
|
|
)
|
2020-05-25 14:02:31 +03:00
|
|
|
endif()
|
|
|
|
|
2020-08-14 02:03:27 +03:00
|
|
|
if (TARGET PkgConfig::GSTREAMER)
|
|
|
|
target_link_libraries(nheko PRIVATE PkgConfig::GSTREAMER)
|
|
|
|
target_compile_definitions(nheko PRIVATE GSTREAMER_AVAILABLE)
|
2023-06-03 03:45:38 +03:00
|
|
|
endif()
|
|
|
|
if (TARGET PkgConfig::XCB)
|
|
|
|
target_link_libraries(nheko PRIVATE PkgConfig::XCB)
|
|
|
|
target_compile_definitions(nheko PRIVATE XCB_AVAILABLE)
|
2020-08-14 02:03:27 +03:00
|
|
|
endif()
|
|
|
|
|
2020-02-14 02:32:08 +03:00
|
|
|
if(MSVC)
|
|
|
|
target_link_libraries(nheko PRIVATE ntdll)
|
2020-01-25 02:58:22 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2019-12-15 01:48:02 +03:00
|
|
|
if(QML_DEBUGGING)
|
|
|
|
target_compile_definitions(nheko PRIVATE QML_DEBUGGING)
|
|
|
|
endif()
|
|
|
|
|
2020-01-25 02:58:22 +03:00
|
|
|
|
2021-02-03 23:39:49 +03:00
|
|
|
if(NOT MSVC AND NOT HAIKU)
|
2020-01-25 02:58:22 +03:00
|
|
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR CI_BUILD)
|
|
|
|
target_compile_options(nheko PRIVATE "-Werror")
|
|
|
|
endif()
|
|
|
|
endif()
|
2022-08-15 21:03:45 +03:00
|
|
|
#if(NOT MSVC)
|
|
|
|
# target_link_options(nheko PRIVATE "LINKER:,--gc-sections")
|
|
|
|
#endif()
|
2020-01-25 02:58:22 +03:00
|
|
|
|
2021-12-23 00:34:07 +03:00
|
|
|
if(MAN)
|
|
|
|
add_subdirectory(man)
|
|
|
|
endif()
|
|
|
|
|
2023-06-16 02:08:22 +03:00
|
|
|
# potential workaround for macdeployqt issues
|
|
|
|
if(APPLE)
|
|
|
|
install(TARGETS nheko
|
|
|
|
BUNDLE DESTINATION .
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
)
|
|
|
|
qt_generate_deploy_qml_app_script(
|
|
|
|
TARGET nheko
|
|
|
|
OUTPUT_SCRIPT deploy_script
|
|
|
|
NO_UNSUPPORTED_PLATFORM_ERROR
|
|
|
|
)
|
|
|
|
install(SCRIPT ${deploy_script})
|
|
|
|
endif()
|
|
|
|
|
2018-01-09 21:34:01 +03:00
|
|
|
if(UNIX AND NOT APPLE)
|
2022-04-18 21:10:10 +03:00
|
|
|
if(FLATPAK)
|
2023-06-03 01:50:55 +03:00
|
|
|
set(APPID "im.nheko.Nheko")
|
2022-07-10 17:39:13 +03:00
|
|
|
set_target_properties(nheko PROPERTIES OUTPUT_NAME "${APPID}")
|
2022-04-18 21:10:10 +03:00
|
|
|
else()
|
|
|
|
set(APPID "nheko")
|
|
|
|
endif()
|
|
|
|
|
2020-01-25 02:58:22 +03:00
|
|
|
install (TARGETS nheko RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
2022-04-18 21:10:10 +03:00
|
|
|
install (FILES "resources/nheko-16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "${APPID}.png")
|
|
|
|
install (FILES "resources/nheko-32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "${APPID}.png")
|
|
|
|
install (FILES "resources/nheko-48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "${APPID}.png")
|
|
|
|
install (FILES "resources/nheko-64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "${APPID}.png")
|
|
|
|
install (FILES "resources/nheko-128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "${APPID}.png")
|
|
|
|
install (FILES "resources/nheko-256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "${APPID}.png")
|
|
|
|
install (FILES "resources/nheko-512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "${APPID}.png")
|
|
|
|
install (FILES "resources/nheko.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps" RENAME "${APPID}.svg")
|
2022-04-16 11:50:12 +03:00
|
|
|
install (FILES "resources/_nheko" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/zsh/site-functions")
|
2020-01-25 02:58:22 +03:00
|
|
|
|
2022-04-19 03:58:59 +03:00
|
|
|
configure_file("resources/nheko.desktop.in" "resources/nheko.desktop" @ONLY)
|
2022-04-19 13:40:05 +03:00
|
|
|
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/resources/nheko.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" RENAME "${APPID}.desktop")
|
2022-04-18 21:10:10 +03:00
|
|
|
configure_file("resources/nheko.appdata.xml.in" "resources/nheko.appdata.xml" @ONLY)
|
2022-04-19 13:40:05 +03:00
|
|
|
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/resources/nheko.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo" RENAME "${APPID}.appdata.xml")
|
2022-04-18 21:10:10 +03:00
|
|
|
|
2020-01-25 02:58:22 +03:00
|
|
|
if(NOT TARGET uninstall)
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
|
|
IMMEDIATE @ONLY)
|
|
|
|
add_custom_target(uninstall
|
|
|
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
|
|
|
endif()
|
2018-01-09 21:34:01 +03:00
|
|
|
endif()
|