Skip to content

Commit

Permalink
Add support for Windows resource files
Browse files Browse the repository at this point in the history
  • Loading branch information
Madman10K committed Jan 13, 2025
1 parent 70db413 commit 0749194
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*.exe
*.out
*.app
*.aps

!Framework/ThirdParty/vulkan/vulkan-1.lib

Expand Down
File renamed without changes.
Binary file added Config/Resources/Icon.ico
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
8 changes: 4 additions & 4 deletions Config/Info.plist → Config/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<dict>
<!-- Application Metadata -->
<key>CFBundleName</key>
<string>MyApp</string>
<string>UImGuiDemo</string>

<key>CFBundleDisplayName</key>
<string>MyApp</string>
<string>UntitledImGuiFramework Demo</string>

<key>CFBundleIdentifier</key>
<string>com.example.MyApp</string>
<string>com.madladsquad.UImGuiDemo</string>

<key>CFBundleVersion</key>
<string>1.0</string>
Expand All @@ -20,7 +20,7 @@

<!-- Executable -->
<key>CFBundleExecutable</key>
<string>Icons</string>
<string>UImGuiDemo</string>

<key>CFBundlePackageType</key>
<string>APPL</string>
Expand Down
2 changes: 2 additions & 0 deletions Config/Resources/resource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define IDI_APP_ICON 101
#define IDS_APP_TITLE 102
3 changes: 3 additions & 0 deletions Config/Resources/resource.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "resource.h"

IDI_APP_ICON ICON "Icon.ico"
8 changes: 6 additions & 2 deletions Framework/cmake/CompileProject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if (BUILD_VARIANT_STATIC)
if (NOT UIMGUI_SKIP_FRAMEWORK)
add_library(UntitledImGuiFramework STATIC "${LIBRARY_SOURCES}" "${APP_LIBRARY_SOURCES}")
endif()
add_executable(${APP_TARGET} ${EXECUTABLE_SOURCES})
add_executable(${APP_TARGET} ${EXECUTABLE_SOURCES} "Config/Resources/resource.rc")
elseif (EMSCRIPTEN)
add_executable(${APP_TARGET} "${LIBRARY_SOURCES}" "${APP_LIBRARY_SOURCES}" ${EXECUTABLE_SOURCES})
else ()
Expand All @@ -22,7 +22,11 @@ else()
endif ()
add_library(${APP_LIB_TARGET} SHARED ${APP_LIBRARY_SOURCES})
endif()
add_executable(${APP_TARGET} ${EXECUTABLE_SOURCES})
if (WIN32)
add_executable(${APP_TARGET} ${EXECUTABLE_SOURCES} "Config/Resources/resource.rc")
else()
add_executable(${APP_TARGET} ${EXECUTABLE_SOURCES})
endif()
endif()

include(SetupTargetSettings)
Expand Down
6 changes: 1 addition & 5 deletions Framework/cmake/SetupSources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ if (USE_KNOBS_MODULE)
endif()

if (USE_SPINNER_MODULE)
if (WIN32)
file(GLOB_RECURSE UGUI_SPINNER_HEAD "${UIMGUI_SRC_PREFIX}/Framework/Modules/Spinners/*.h")
else()
file(GLOB_RECURSE UGUI_SPINNER_HEAD "${UIMGUI_SRC_PREFIX}/Framework/Modules/Spinners/*.h")
endif()
file(GLOB_RECURSE UGUI_SPINNER_HEAD "${UIMGUI_SRC_PREFIX}/Framework/Modules/Spinners/*.h")
endif()

if (USE_TOGGLES_MODULE)
Expand Down
2 changes: 1 addition & 1 deletion UVKBuildTool
6 changes: 5 additions & 1 deletion export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ cp -r "${real_framework_path}" . || die_

while true; do
if [ "$macos" = true ]; then
cd Config/macOS || break
cd Config/Resources || break
iconutil -c icns Icon.iconset || break
cd ../../ || break
elif [ "$windows" = true ]; then
cd Config/Resources || break
whick magick && magick Icon.iconset/* Icon.ico
cd ../../ || break
fi
break
done
Expand Down

0 comments on commit 0749194

Please sign in to comment.