Skip to content

Commit 0749194

Browse files
committed
Add support for Windows resource files
1 parent 70db413 commit 0749194

20 files changed

+23
-13
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*.exe
3232
*.out
3333
*.app
34+
*.aps
3435

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

File renamed without changes.

Config/Resources/Icon.ico

33.8 KB
Binary file not shown.

Config/Info.plist Config/Resources/Info.plist

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<dict>
55
<!-- Application Metadata -->
66
<key>CFBundleName</key>
7-
<string>MyApp</string>
7+
<string>UImGuiDemo</string>
88

99
<key>CFBundleDisplayName</key>
10-
<string>MyApp</string>
10+
<string>UntitledImGuiFramework Demo</string>
1111

1212
<key>CFBundleIdentifier</key>
13-
<string>com.example.MyApp</string>
13+
<string>com.madladsquad.UImGuiDemo</string>
1414

1515
<key>CFBundleVersion</key>
1616
<string>1.0</string>
@@ -20,7 +20,7 @@
2020

2121
<!-- Executable -->
2222
<key>CFBundleExecutable</key>
23-
<string>Icons</string>
23+
<string>UImGuiDemo</string>
2424

2525
<key>CFBundlePackageType</key>
2626
<string>APPL</string>

Config/Resources/resource.h

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define IDI_APP_ICON 101
2+
#define IDS_APP_TITLE 102

Config/Resources/resource.rc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include "resource.h"
2+
3+
IDI_APP_ICON ICON "Icon.ico"

Framework/cmake/CompileProject.cmake

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if (BUILD_VARIANT_STATIC)
33
if (NOT UIMGUI_SKIP_FRAMEWORK)
44
add_library(UntitledImGuiFramework STATIC "${LIBRARY_SOURCES}" "${APP_LIBRARY_SOURCES}")
55
endif()
6-
add_executable(${APP_TARGET} ${EXECUTABLE_SOURCES})
6+
add_executable(${APP_TARGET} ${EXECUTABLE_SOURCES} "Config/Resources/resource.rc")
77
elseif (EMSCRIPTEN)
88
add_executable(${APP_TARGET} "${LIBRARY_SOURCES}" "${APP_LIBRARY_SOURCES}" ${EXECUTABLE_SOURCES})
99
else ()
@@ -22,7 +22,11 @@ else()
2222
endif ()
2323
add_library(${APP_LIB_TARGET} SHARED ${APP_LIBRARY_SOURCES})
2424
endif()
25-
add_executable(${APP_TARGET} ${EXECUTABLE_SOURCES})
25+
if (WIN32)
26+
add_executable(${APP_TARGET} ${EXECUTABLE_SOURCES} "Config/Resources/resource.rc")
27+
else()
28+
add_executable(${APP_TARGET} ${EXECUTABLE_SOURCES})
29+
endif()
2630
endif()
2731

2832
include(SetupTargetSettings)

Framework/cmake/SetupSources.cmake

+1-5
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,7 @@ if (USE_KNOBS_MODULE)
107107
endif()
108108

109109
if (USE_SPINNER_MODULE)
110-
if (WIN32)
111-
file(GLOB_RECURSE UGUI_SPINNER_HEAD "${UIMGUI_SRC_PREFIX}/Framework/Modules/Spinners/*.h")
112-
else()
113-
file(GLOB_RECURSE UGUI_SPINNER_HEAD "${UIMGUI_SRC_PREFIX}/Framework/Modules/Spinners/*.h")
114-
endif()
110+
file(GLOB_RECURSE UGUI_SPINNER_HEAD "${UIMGUI_SRC_PREFIX}/Framework/Modules/Spinners/*.h")
115111
endif()
116112

117113
if (USE_TOGGLES_MODULE)

export.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,13 @@ cp -r "${real_framework_path}" . || die_
9696

9797
while true; do
9898
if [ "$macos" = true ]; then
99-
cd Config/macOS || break
99+
cd Config/Resources || break
100100
iconutil -c icns Icon.iconset || break
101101
cd ../../ || break
102+
elif [ "$windows" = true ]; then
103+
cd Config/Resources || break
104+
whick magick && magick Icon.iconset/* Icon.ico
105+
cd ../../ || break
102106
fi
103107
break
104108
done

0 commit comments

Comments
 (0)