Skip to content

Commit

Permalink
Configure CMake to install Qt6Svg.dll and qsvg.dll in build.
Browse files Browse the repository at this point in the history
Without these libraries, SVG icon engine is not available, and SVG
images (only application logo at this time) cannot be rasterized.
  • Loading branch information
cristian64 committed Mar 9, 2024
1 parent 31b70bd commit 1ee40c0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt6Widgets REQUIRED)
find_package(Qt6Core REQUIRED)
find_package(Qt6Gui REQUIRED)
find_package(Qt6Svg REQUIRED)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
Expand All @@ -61,17 +62,20 @@ add_executable(dolphin-memory-engine ${GUI_TYPE} ${SRCS})
target_link_libraries(dolphin-memory-engine Qt6::Widgets)
target_link_libraries(dolphin-memory-engine Qt6::Gui)
target_link_libraries(dolphin-memory-engine Qt6::Core)
target_link_libraries(dolphin-memory-engine Qt6::Svg)

if(WIN32)
set_target_properties(dolphin-memory-engine PROPERTIES OUTPUT_NAME DolphinMemoryEngine)
if($<CONFIG:Debug>)
get_target_property(WIDGETDLL Qt6::Widgets IMPORTED_LOCATION_DEBUG)
get_target_property(COREDLL Qt6::Widgets IMPORTED_LOCATION_DEBUG)
get_target_property(GUIDLL Qt6::Widgets IMPORTED_LOCATION_DEBUG)
get_target_property(SVGDLL Qt6::Widgets IMPORTED_LOCATION_DEBUG)
else($<CONFIG:Debug>)
get_target_property(WIDGETDLL Qt6::Widgets IMPORTED_LOCATION_RELEASE)
get_target_property(COREDLL Qt6::Widgets IMPORTED_LOCATION_RELEASE)
get_target_property(GUIDLL Qt6::Widgets IMPORTED_LOCATION_RELEASE)
get_target_property(SVGDLL Qt6::Widgets IMPORTED_LOCATION_RELEASE)
endif($<CONFIG:Debug>)
add_custom_command(
TARGET dolphin-memory-engine POST_BUILD
Expand All @@ -87,12 +91,24 @@ if(WIN32)
$<TARGET_FILE:Qt6::Gui>
$<TARGET_FILE_DIR:dolphin-memory-engine>
TARGET dolphin-memory-engine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:Qt6::Svg>
$<TARGET_FILE_DIR:dolphin-memory-engine>
TARGET dolphin-memory-engine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
$<TARGET_FILE_DIR:dolphin-memory-engine>/imageformats
TARGET dolphin-memory-engine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:Qt6::QSvgPlugin>
$<TARGET_FILE_DIR:dolphin-memory-engine>/imageformats
TARGET dolphin-memory-engine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
$<TARGET_FILE_DIR:dolphin-memory-engine>/platforms
TARGET dolphin-memory-engine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:Qt6::QWindowsIntegrationPlugin>
$<TARGET_FILE_DIR:dolphin-memory-engine>/platforms
TARGET dolphin-memory-engine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
$<TARGET_FILE_DIR:dolphin-memory-engine>/styles
TARGET dolphin-memory-engine POST_BUILD
Expand Down

0 comments on commit 1ee40c0

Please sign in to comment.