From 1a43c10c24545a5513fa88654a6fc4c7942a723a Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Mon, 24 Apr 2023 00:33:57 -0400 Subject: [PATCH] See if we can get the icon for macOS associated with bundle. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32972485..3230b8f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,12 +103,19 @@ set_target_properties(chat PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE_ICON_FILE "favicon.icns" ) if(${CMAKE_SYSTEM_NAME} MATCHES Darwin) set_target_properties(chat PROPERTIES OUTPUT_NAME gpt4all ) + set(MACOSX_ICON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/icons/favicon.icns") + set(MACOSX_ICON_FILE_DEST "${CMAKE_BINARY_DIR}/chat.app/Contents/Resources/favicon.icns") + add_custom_command(TARGET chat POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MACOSX_ICON_FILE} ${MACOSX_ICON_FILE_DEST} + COMMENT "Copying icon file to bundle" + ) endif() target_compile_definitions(chat