Skip to content

Commit

Permalink
Added app icon on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jrouwe committed Jan 12, 2025
1 parent 53c5190 commit dc07f34
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Build/iOS/JoltViewerInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string></string>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.joltphysics.joltviewer</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Build/iOS/SamplesInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string></string>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.joltphysics.samples</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down
Binary file added Build/macOS/icon.icns
Binary file not shown.
6 changes: 5 additions & 1 deletion JoltViewer/JoltViewer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ source_group(TREE ${JOLT_VIEWER_ROOT} FILES ${JOLT_VIEWER_SRC_FILES})

# Create JoltViewer executable
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
add_executable(JoltViewer MACOSX_BUNDLE ${JOLT_VIEWER_SRC_FILES} ${TEST_FRAMEWORK_ASSETS})
# Icon
set(JPH_ICON "${CMAKE_CURRENT_SOURCE_DIR}/macOS/icon.icns")
set_source_files_properties(${JPH_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")

add_executable(JoltViewer MACOSX_BUNDLE ${JOLT_VIEWER_SRC_FILES} ${TEST_FRAMEWORK_ASSETS} ${JPH_ICON})
set_property(TARGET JoltViewer PROPERTY MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/iOS/JoltViewerInfo.plist")
set_property(TARGET JoltViewer PROPERTY XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.joltphysics.joltviewer")
else()
Expand Down
6 changes: 5 additions & 1 deletion Samples/Samples.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,12 @@ source_group(TREE ${SAMPLES_ROOT} FILES ${SAMPLES_SRC_FILES})

# Create Samples executable
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
# Icon
set(JPH_ICON "${CMAKE_CURRENT_SOURCE_DIR}/macOS/icon.icns")
set_source_files_properties(${JPH_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")

# macOS configuration
add_executable(Samples MACOSX_BUNDLE ${SAMPLES_SRC_FILES} ${TEST_FRAMEWORK_ASSETS} ${SAMPLES_ASSETS})
add_executable(Samples MACOSX_BUNDLE ${SAMPLES_SRC_FILES} ${TEST_FRAMEWORK_ASSETS} ${SAMPLES_ASSETS} ${JPH_ICON})

# Make sure that all samples assets move to the Resources folder in the package
foreach(ASSET_FILE ${SAMPLES_ASSETS})
Expand Down

0 comments on commit dc07f34

Please sign in to comment.