Add Qt resource file for WildDragon logo images
- app/assets/dragonmoonlight.qrc: registers wilddragon-icon.jpg and
wilddragon-logo.jpg under the /app/assets prefix so they are
accessible in QML as qrc:/app/assets/wilddragon-{icon,logo}.jpg
- CMakeLists_vpn.cmake: call qt5_add_resources or qt_add_resources
(depending on Qt major version) to compile the .qrc into the binary
This commit is contained in:
parent
92eb06a3df
commit
4a90ed82fb
2 changed files with 39 additions and 0 deletions
16
app/assets/dragonmoonlight.qrc
Normal file
16
app/assets/dragonmoonlight.qrc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<!--
|
||||
Qt resource file for DragonMoonlight logo images.
|
||||
These are referenced in QML as:
|
||||
qrc:/app/assets/wilddragon-icon.jpg
|
||||
qrc:/app/assets/wilddragon-logo.jpg
|
||||
|
||||
The CMakeLists_vpn.cmake include registers this file with
|
||||
qt5_add_resources / qt_add_resources before compiling.
|
||||
-->
|
||||
<qresource prefix="/app/assets">
|
||||
<file>wilddragon-icon.jpg</file>
|
||||
<file>wilddragon-logo.jpg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
@ -112,3 +112,26 @@ elseif(WIN32)
|
|||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ─── Qt resources: logo images ────────────────────────────────────────────────
|
||||
# Assets referenced in QML as qrc:/app/assets/wilddragon-{icon,logo}.jpg
|
||||
# Both qt5_add_resources and qt_add_resources accept a .qrc file path directly.
|
||||
|
||||
set(DRAGON_QRC_FILE "${CMAKE_SOURCE_DIR}/app/assets/dragonmoonlight.qrc")
|
||||
|
||||
if(NOT QT_VERSION_MAJOR)
|
||||
# Fallback if QT_VERSION_MAJOR isn't set yet — derive from Qt5/Qt6 find_package result
|
||||
if(Qt6_FOUND)
|
||||
set(QT_VERSION_MAJOR 6)
|
||||
else()
|
||||
set(QT_VERSION_MAJOR 5)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(QT_VERSION_MAJOR EQUAL 6)
|
||||
qt_add_resources(DRAGON_QRC_OBJS "${DRAGON_QRC_FILE}")
|
||||
else()
|
||||
qt5_add_resources(DRAGON_QRC_OBJS "${DRAGON_QRC_FILE}")
|
||||
endif()
|
||||
|
||||
target_sources(moonlight-qt PRIVATE ${DRAGON_QRC_OBJS})
|
||||
|
|
|
|||
Loading…
Reference in a new issue