aboutsummaryrefslogtreecommitdiff
path: root/xT/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-12-13 06:37:21 +0100
committerPřemysl Eric Janouch <p@janouch.name>2025-12-26 21:08:11 +0100
commit21c3fdab6c786a150f027c5c7506258c94e75330 (patch)
tree1265130f203807234595b12e4d5c74d1c5fdf4e1 /xT/CMakeLists.txt
parent2f31e8b31fec6118d257b59a3c12c1f91f4fdd78 (diff)
downloadxK-21c3fdab6c786a150f027c5c7506258c94e75330.tar.gz
xK-21c3fdab6c786a150f027c5c7506258c94e75330.tar.xz
xK-21c3fdab6c786a150f027c5c7506258c94e75330.zip
WIP: Add a Qt Quick frontend for xCHEADmaster
We have to decouple the UI from the relay code.
Diffstat (limited to 'xT/CMakeLists.txt')
-rw-r--r--xT/CMakeLists.txt23
1 files changed, 19 insertions, 4 deletions
diff --git a/xT/CMakeLists.txt b/xT/CMakeLists.txt
index 812bca4..0f9f26e 100644
--- a/xT/CMakeLists.txt
+++ b/xT/CMakeLists.txt
@@ -13,8 +13,10 @@ project (xT VERSION "${project_version}"
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
-find_package (Qt6 REQUIRED COMPONENTS Widgets Network Multimedia)
-qt_standard_project_setup ()
+find_package (Qt6 REQUIRED COMPONENTS Widgets Network Multimedia
+ Quick QuickControls2)
+# XXX: The version requirement is probably for Qt Quick only.
+qt_standard_project_setup (REQUIRES 6.5)
add_compile_options ("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options ("$<$<CXX_COMPILER_ID:GNU>:-Wall;-Wextra>")
@@ -79,7 +81,7 @@ else ()
endif ()
# Build the main executable and link it
-find_program (awk_EXECUTABLE awk ${find_program_REQUIRE})
+find_program (awk_EXECUTABLE awk REQUIRED)
add_custom_command (OUTPUT xC-proto.cpp
COMMAND ${CMAKE_COMMAND} -E env LC_ALL=C ${awk_EXECUTABLE}
-f ${root}/liberty/tools/lxdrgen.awk
@@ -105,11 +107,24 @@ set_target_properties (xT PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE ON
# https://stackoverflow.com/questions/79079161 and resolved in Qt Creator 16.
set (QT_QML_GENERATE_QMLLS_INI ON)
+# TODO(p): Perhaps do it in one-or-the-other way,
+# as Qt Quick sucks on the desktop, and Qt Widgets is unusable on mobile.
+qt_add_executable (xTq
+ xTq.cpp ${project_config} ${project_sources} "${icon_icns}")
+set_property (SOURCE xTq.qml APPEND PROPERTY QT_QML_SOURCE_TYPENAME Main)
+qt_add_qml_module (xTq URI xTquick VERSION 1.0 QML_FILES xTq.qml)
+add_dependencies (xTq xC-proto)
+qt_add_resources (xTq "rsrc" PREFIX / FILES "${beep}" ${icon_rsrc_list})
+target_link_libraries (xTq PRIVATE
+ Qt6::Quick Qt6::QuickControls2 Qt6::Network Qt6::Multimedia)
+set_target_properties (xTq PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE ON
+ MACOSX_BUNDLE_GUI_IDENTIFIER name.janouch.xTq)
+
# The files to be installed
include (GNUInstallDirs)
if (ANDROID)
- install (TARGETS xT DESTINATION .)
+ install (TARGETS xTq DESTINATION .)
elseif (APPLE OR WIN32)
install (TARGETS xT
RUNTIME_DEPENDENCY_SET dependencies_xT