1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 11:47:46 +00:00
astra/CMakeLists.txt

104 lines
3 KiB
Text
Raw Normal View History

# SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
# SPDX-License-Identifier: CC0-1.0
2023-09-16 17:32:38 -04:00
cmake_minimum_required(VERSION 3.25)
2024-03-22 17:16:32 -04:00
project(Astra VERSION 0.6.0 LANGUAGES CXX)
2021-11-01 09:54:58 -04:00
# build options used for distributors
option(BUILD_FLATPAK "Build for Flatpak." OFF)
option(BUILD_WEBVIEW "Build support for the integrated web browser. Only used on the Steam Deck." OFF)
# TODO: phase out once all supported builds can turn on this option
option(BUILD_SYNC "Build Matrix sync support." OFF)
# options for features you may want or need
if (NOT WIN32 AND NOT APPLE)
option(ENABLE_GAMEMODE "Build with Feral GameMode support, requires the daemon to be installed." ON)
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2023-12-17 10:13:49 -05:00
set(QT_MIN_VERSION 6.6)
set(KF_MIN_VERSION 6.4)
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMSetupVersion)
include(KDEGitCommitHooks)
include(KDEClangFormat)
include(ECMAddTests)
include(ECMQtDeclareLoggingCategory)
include(ECMAddAppIcon)
2024-08-22 21:36:23 -04:00
include(ECMQmlModule)
ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX ASTRA
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/astra-version.h
)
2023-09-16 17:32:38 -04:00
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS
Core
Widgets
Network
2023-08-18 22:21:38 -04:00
QuickControls2
Concurrent
Test)
if (BUILD_WEBVIEW)
find_package(Qt6WebView ${QT_MIN_VERSION} REQUIRED)
endif ()
if (LINUX)
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS DBus)
endif ()
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami I18n Config CoreAddons Archive IconThemes)
find_package(KF6KirigamiAddons 1.2.1 REQUIRED)
2023-09-16 18:37:42 -04:00
find_package(QCoro6 REQUIRED COMPONENTS Core Network Qml)
qcoro_enable_coroutines()
if (BUILD_SYNC)
find_package(QuotientQt6 REQUIRED)
endif()
2023-09-16 18:37:42 -04:00
2023-09-16 17:41:51 -04:00
qt_policy(SET QTP0001 NEW)
2021-11-01 09:54:58 -04:00
if (ENABLE_GAMEMODE)
find_package(PkgConfig REQUIRED)
pkg_search_module(GAMEMODE REQUIRED gamemode)
endif ()
2023-09-16 17:32:38 -04:00
find_package(Qt6Keychain REQUIRED)
# TODO: we should really do this on all platforms anyway
if (WIN32)
find_package(KF6BreezeIcons REQUIRED)
endif ()
add_subdirectory(external)
add_subdirectory(launcher)
if (BUILD_TESTING)
add_subdirectory(autotests)
endif()
if (NOT WIN32)
install(FILES zone.xiv.astra.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES zone.xiv.astra.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES zone.xiv.astra.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
2023-07-30 09:35:49 -04:00
ecm_qt_install_logging_categories(
EXPORT ASTRA
FILE astra.categories
SORT DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
endif()
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
2024-04-10 20:29:40 -04:00
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)