-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (49 loc) · 2.19 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
cmake_minimum_required(VERSION 3.20)
project(GOnnect VERSION 1.0.7 LANGUAGES CXX)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(NOT LINUX)
message(FATAL_ERROR "GOnnect only works for Linux/Flatpack targets")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
option(ENABLE_CLAZY "Enable Clazy warnings" OFF)
if(ENABLE_CLAZY)
set(CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT} -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy")
endif()
endif()
add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wno-gnu-zero-variadic-macro-arguments)
find_package(Qt6 REQUIRED COMPONENTS Gui DBus Qml Quick QuickControls2 LinguistTools)
qt_standard_project_setup(REQUIRES 6.7
I18N_SOURCE_LANGUAGE en
I18N_TRANSLATED_LANGUAGES de
)
# Adjust target path for qm files
file(GLOB tsfiles "i18n/*.ts")
foreach(tsfile ${tsfiles})
set_source_files_properties(${tsfile}
PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}")
endforeach()
# Versioning setup
configure_file(appversion.cpp.in appversion.cpp @ONLY)
add_library(GOnnectVersion STATIC
${CMAKE_CURRENT_BINARY_DIR}/appversion.cpp
)
target_include_directories(GOnnectVersion PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
add_subdirectory(src)
add_subdirectory(external/hid-rp)
if(${BUILD_TESTING})
add_subdirectory(tests)
add_definitions(-DAPP_TESTS)
endif()
install(FILES resources/flatpak/de.gonicus.gonnect.svg DESTINATION share/icons/hicolor/scalable/apps)
install(FILES resources/flatpak/de.gonicus.gonnect.desktop DESTINATION share/applications)
install(FILES resources/flatpak/de.gonicus.gonnect.krunner.desktop DESTINATION share/krunner/dbusplugins)
install(FILES resources/flatpak/de.gonicus.gonnect.metainfo.xml DESTINATION share/metainfo)
install(FILES resources/flatpak/de.gonicus.gonnect.releases.xml DESTINATION share/metainfo/releases)
install(FILES resources/flatpak/de.gonicus.gonnect.service DESTINATION share/dbus-1/services)
install(FILES resources/flatpak/de.gonicus.gonnect.search-provider.ini DESTINATION share/gnome-shell/search-providers)