Moved resource definitions to CMake files using the qt_add_resource() macro

This commit is contained in:
Nav
2022-07-13 20:39:44 +01:00
parent aa1b45a469
commit 2b0a1dfe00
3 changed files with 81 additions and 17 deletions

View File

@@ -5,9 +5,6 @@ set(CMAKE_PROJECT_HOMEPAGE_URL "https://bloom.oscillate.io")
set(CMAKE_VERBOSE_MAKEFILE off) set(CMAKE_VERBOSE_MAKEFILE off)
# Create directory for generated sources
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/Generated)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(ENABLE_SANITIZERS off) set(ENABLE_SANITIZERS off)
@@ -70,6 +67,17 @@ target_sources(
build/resources/TargetDescriptionFiles/AVR/Mapping.json build/resources/TargetDescriptionFiles/AVR/Mapping.json
) )
qt_add_resources(
Bloom
"ApplicationResources"
PREFIX
"/compiled"
FILES
"./resources/bloom.template.json"
"./resources/help.txt"
"./resources/gdbHelpMonitorInfo.txt"
)
add_subdirectory(src) add_subdirectory(src)
set_target_properties(Bloom PROPERTIES OUTPUT_NAME bloom) set_target_properties(Bloom PROPERTIES OUTPUT_NAME bloom)
@@ -166,19 +174,6 @@ add_custom_command(
php ${CMAKE_CURRENT_SOURCE_DIR}/build/scripts/Avr8TargetDescriptionFiles.php php ${CMAKE_CURRENT_SOURCE_DIR}/build/scripts/Avr8TargetDescriptionFiles.php
) )
# Compile resources
add_custom_command(
OUTPUT
${CMAKE_CURRENT_SOURCE_DIR}/src/Generated/resources.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Generated/resources_fake.cpp
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/src/resources.qrc
COMMAND echo 'Compiling QT resources. |${CMAKE_BUILD_TYPE}|'
COMMAND
rcc -o ${CMAKE_CURRENT_SOURCE_DIR}/src/Generated/resources.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/resources.qrc
)
# Copy resources/fonts into build/resources/Fonts # Copy resources/fonts into build/resources/Fonts
add_custom_command( add_custom_command(
TARGET Bloom TARGET Bloom

View File

@@ -11,7 +11,6 @@ target_sources(
${CMAKE_CURRENT_SOURCE_DIR}/Helpers/EventFdNotifier.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Helpers/EventFdNotifier.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Helpers/ConditionVariableNotifier.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Helpers/ConditionVariableNotifier.cpp
${CMAKE_CURRENT_SOURCE_DIR}/VersionNumber.cpp ${CMAKE_CURRENT_SOURCE_DIR}/VersionNumber.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Generated/resources.cpp
# Project & application configuration # Project & application configuration
${CMAKE_CURRENT_SOURCE_DIR}/ProjectConfig.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ProjectConfig.cpp

View File

@@ -78,3 +78,73 @@ target_sources(
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp ${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp ${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp
) )
# Insight resources
qt_add_resources(
Bloom
"InsightResources"
PREFIX
"/compiled/src/Insight"
FILES
# Insight Window
"./UserInterfaces/InsightWindow/Stylesheets/Global.qss"
"./UserInterfaces/InsightWindow/UiFiles/InsightWindow.ui"
"./UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss"
"./UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/UiFiles/TargetRegistersSidePane.ui"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/UiFiles/TargetMemoryInspectionPane.ui"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui"
"./UserInterfaces/InsightWindow/Images/BloomIcon.svg"
"./UserInterfaces/InsightWindow/Images/RAM.svg"
"./UserInterfaces/InsightWindow/Images/refresh.svg"
"./UserInterfaces/InsightWindow/Images/refresh-disabled.svg"
"./UserInterfaces/InsightWindow/Images/down-arrow.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/collapse-all.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/expand-all.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/arrow.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/register-group.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/register.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/target-registers.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/target-registers-disabled.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/search-registers.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/memory-inspection-icon.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/memory-inspection-icon-disabled.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-stack-memory.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-stack-memory-disabled.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-focused-memory.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-focused-memory-disabled.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/manage-focused-regions.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-hovered-rows-columns.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-hovered-rows-columns-disabled.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations-disabled.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/ascii-view.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/ascii-view-disabled.svg"
# Target package widgets
"./UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/Stylesheets/DualInlinePackage.qss"
"./UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/Stylesheets/QuadFlatPackage.qss"
# Target register inspector window
"./UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/UiFiles/TargetRegisterInspectorWindow.ui"
"./UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/Stylesheets/TargetRegisterInspectorWindow.qss"
"./UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/UiFiles/RegisterHistoryWidget.ui"
"./UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/Images/icon.svg"
# Focused memory region manager window
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/UiFiles/MemoryRegionManagerWindow.ui"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/Stylesheets/MemoryRegionManagerWindow.qss"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/UiFiles/FocusedMemoryRegionForm.ui"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/UiFiles/ExcludedMemoryRegionForm.ui"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/Images/icon.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/Images/add-region.svg"
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/Images/remove-region.svg"
# About window
"./UserInterfaces/InsightWindow/UiFiles/AboutWindow.ui"
"./UserInterfaces/InsightWindow/Stylesheets/AboutWindow.qss"
# Error dialogue
"./UserInterfaces/InsightWindow/Widgets/ErrorDialogue/UiFiles/ErrorDialogue.ui"
"./UserInterfaces/InsightWindow/Widgets/ErrorDialogue/Stylesheets/ErrorDialogue.qss"
"./UserInterfaces/InsightWindow/Widgets/ErrorDialogue/Images/icon.svg"
)