Преглед на файлове

Added app icon on macOS

Jorrit Rouwe преди 6 месеца
родител
ревизия
dc07f34605
променени са 5 файла, в които са добавени 12 реда и са изтрити 4 реда
  1. 1 1
      Build/iOS/JoltViewerInfo.plist
  2. 1 1
      Build/iOS/SamplesInfo.plist
  3. BIN
      Build/macOS/icon.icns
  4. 5 1
      JoltViewer/JoltViewer.cmake
  5. 5 1
      Samples/Samples.cmake

+ 1 - 1
Build/iOS/JoltViewerInfo.plist

@@ -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>

+ 1 - 1
Build/iOS/SamplesInfo.plist

@@ -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>

BIN
Build/macOS/icon.icns


+ 5 - 1
JoltViewer/JoltViewer.cmake

@@ -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()

+ 5 - 1
Samples/Samples.cmake

@@ -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})