From a9fc0adf962af598972d9dde7b4b4a91c61837ba Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Sun, 3 Oct 2021 11:37:33 +0200 Subject: [PATCH] Move resources to res/ directory (#1204) * Move resources to res/ directory and update CMake scripts accordingly Co-authored-by: Rayyan Ansari <68647953+RayyanAnsari@users.noreply.github.com> --- melon_grc.xml | 11 ----- {icon => res/icon}/melon_128x128.png | Bin {icon => res/icon}/melon_16x16.png | Bin {icon => res/icon}/melon_256x256.png | Bin {icon => res/icon}/melon_32x32.png | Bin {icon => res/icon}/melon_48x48.png | Bin {icon => res/icon}/melon_64x64.png | Bin melon.icns => res/melon.icns | Bin melon.ico => res/melon.ico | Bin melon.plist.in => res/melon.plist.in | 0 melon.qrc => res/melon.qrc | 0 melon.rc.in => res/melon.rc.in | 4 +- .../net.kuribo64.melonDS.desktop | 0 xp.manifest => res/xp.manifest | 0 src/frontend/qt_sdl/CMakeLists.txt | 41 ++++++++++-------- 15 files changed, 24 insertions(+), 32 deletions(-) delete mode 100644 melon_grc.xml rename {icon => res/icon}/melon_128x128.png (100%) rename {icon => res/icon}/melon_16x16.png (100%) rename {icon => res/icon}/melon_256x256.png (100%) rename {icon => res/icon}/melon_32x32.png (100%) rename {icon => res/icon}/melon_48x48.png (100%) rename {icon => res/icon}/melon_64x64.png (100%) rename melon.icns => res/melon.icns (100%) rename melon.ico => res/melon.ico (100%) rename melon.plist.in => res/melon.plist.in (100%) rename melon.qrc => res/melon.qrc (100%) rename melon.rc.in => res/melon.rc.in (92%) rename net.kuribo64.melonDS.desktop => res/net.kuribo64.melonDS.desktop (100%) rename xp.manifest => res/xp.manifest (100%) diff --git a/melon_grc.xml b/melon_grc.xml deleted file mode 100644 index f4942723..00000000 --- a/melon_grc.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - icon/melon_16x16.png - icon/melon_32x32.png - icon/melon_48x48.png - icon/melon_64x64.png - icon/melon_128x128.png - icon/melon_256x256.png - - diff --git a/icon/melon_128x128.png b/res/icon/melon_128x128.png similarity index 100% rename from icon/melon_128x128.png rename to res/icon/melon_128x128.png diff --git a/icon/melon_16x16.png b/res/icon/melon_16x16.png similarity index 100% rename from icon/melon_16x16.png rename to res/icon/melon_16x16.png diff --git a/icon/melon_256x256.png b/res/icon/melon_256x256.png similarity index 100% rename from icon/melon_256x256.png rename to res/icon/melon_256x256.png diff --git a/icon/melon_32x32.png b/res/icon/melon_32x32.png similarity index 100% rename from icon/melon_32x32.png rename to res/icon/melon_32x32.png diff --git a/icon/melon_48x48.png b/res/icon/melon_48x48.png similarity index 100% rename from icon/melon_48x48.png rename to res/icon/melon_48x48.png diff --git a/icon/melon_64x64.png b/res/icon/melon_64x64.png similarity index 100% rename from icon/melon_64x64.png rename to res/icon/melon_64x64.png diff --git a/melon.icns b/res/melon.icns similarity index 100% rename from melon.icns rename to res/melon.icns diff --git a/melon.ico b/res/melon.ico similarity index 100% rename from melon.ico rename to res/melon.ico diff --git a/melon.plist.in b/res/melon.plist.in similarity index 100% rename from melon.plist.in rename to res/melon.plist.in diff --git a/melon.qrc b/res/melon.qrc similarity index 100% rename from melon.qrc rename to res/melon.qrc diff --git a/melon.rc.in b/res/melon.rc.in similarity index 92% rename from melon.rc.in rename to res/melon.rc.in index ce8e4ba9..d38f86c1 100644 --- a/melon.rc.in +++ b/res/melon.rc.in @@ -2,7 +2,7 @@ #define VFT_APP 0x00000001L //this will set your .exe icon -100 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "melon.ico" +100 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "res/melon.ico" //include version information in .exe, modify these values to match your needs 1 VERSIONINFO @@ -31,4 +31,4 @@ FILETYPE VFT_APP } } -1 24 "xp.manifest" +1 24 "res/xp.manifest" diff --git a/net.kuribo64.melonDS.desktop b/res/net.kuribo64.melonDS.desktop similarity index 100% rename from net.kuribo64.melonDS.desktop rename to res/net.kuribo64.melonDS.desktop diff --git a/xp.manifest b/res/xp.manifest similarity index 100% rename from xp.manifest rename to res/xp.manifest diff --git a/src/frontend/qt_sdl/CMakeLists.txt b/src/frontend/qt_sdl/CMakeLists.txt index cb810496..1d987a46 100644 --- a/src/frontend/qt_sdl/CMakeLists.txt +++ b/src/frontend/qt_sdl/CMakeLists.txt @@ -14,7 +14,7 @@ SET(SOURCES_QT_SDL WifiSettingsDialog.cpp InterfaceSettingsDialog.cpp ROMInfoDialog.cpp - TitleManagerDialog.cpp + TitleManagerDialog.cpp Input.cpp LAN_PCap.cpp LAN_Socket.cpp @@ -34,7 +34,7 @@ SET(SOURCES_QT_SDL ../FrontendUtil.h ../mic_blow.h - ../../../melon.qrc + ${CMAKE_SOURCE_DIR}/res/melon.qrc ) option(USE_QT6 "Build using Qt 6 instead of 5" OFF) @@ -117,7 +117,7 @@ if (UNIX) endif() elseif (WIN32) option(PORTABLE "Make a portable build that looks for its configuration in the current directory" ON) - configure_file("${CMAKE_SOURCE_DIR}/melon.rc.in" "${CMAKE_SOURCE_DIR}/melon.rc") + configure_file("${CMAKE_SOURCE_DIR}/res/melon.rc.in" "${CMAKE_SOURCE_DIR}/melon.rc") target_sources(melonDS PUBLIC "${CMAKE_SOURCE_DIR}/melon.rc") target_link_libraries(melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi gdi32) @@ -133,15 +133,16 @@ if (PORTABLE) endif() if (APPLE) - set_target_properties(melonDS PROPERTIES - MACOSX_BUNDLE true - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/melon.plist.in - OUTPUT_NAME melonDS - ) - # Copy icon into the bundle - target_sources(melonDS PRIVATE "${CMAKE_SOURCE_DIR}/melon.icns") - set_source_files_properties("${CMAKE_SOURCE_DIR}/melon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources) + set(RESOURCE_FILES "${CMAKE_SOURCE_DIR}/res/melon.icns") + target_sources(melonDS PUBLIC "${RESOURCE_FILES}") + + set_target_properties(melonDS PROPERTIES + MACOSX_BUNDLE true + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/res/melon.plist.in + OUTPUT_NAME melonDS + RESOURCE "${RESOURCE_FILES}") + # Qt 6 requires macOS 10.15 if building on 10.15 or greater if(CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 19.0.0) @@ -163,11 +164,13 @@ if (APPLE) endif() endif() -install(FILES ../../../net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) -install(FILES ../../../icon/melon_16x16.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/16x16/apps RENAME net.kuribo64.melonDS.png) -install(FILES ../../../icon/melon_32x32.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/32x32/apps RENAME net.kuribo64.melonDS.png) -install(FILES ../../../icon/melon_48x48.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps RENAME net.kuribo64.melonDS.png) -install(FILES ../../../icon/melon_64x64.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/64x64/apps RENAME net.kuribo64.melonDS.png) -install(FILES ../../../icon/melon_128x128.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/128x128/apps RENAME net.kuribo64.melonDS.png) -install(FILES ../../../icon/melon_256x256.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps RENAME net.kuribo64.melonDS.png) -install(TARGETS melonDS BUNDLE DESTINATION ${CMAKE_BINARY_DIR} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +if (UNIX AND NOT APPLE) + foreach(SIZE 16 32 48 64 128 256) + install(FILES ${CMAKE_SOURCE_DIR}/res/icon/melon_${SIZE}x${SIZE}.png + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/${SIZE}x${SIZE}/apps + RENAME net.kuribo64.melonDS.png) + endforeach() + + install(FILES ${CMAKE_SOURCE_DIR}/res/net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) + install(TARGETS melonDS BUNDLE DESTINATION ${CMAKE_BINARY_DIR} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +endif()