See if we can get the icon for macOS associated with bundle.

This commit is contained in:
Adam Treat 2023-04-24 00:33:57 -04:00
parent a4126d4863
commit 57276d3520

View File

@ -103,12 +103,19 @@ set_target_properties(chat PROPERTIES
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE_ICON_FILE "favicon.icns"
) )
if(${CMAKE_SYSTEM_NAME} MATCHES Darwin) if(${CMAKE_SYSTEM_NAME} MATCHES Darwin)
set_target_properties(chat PROPERTIES set_target_properties(chat PROPERTIES
OUTPUT_NAME gpt4all 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() endif()
target_compile_definitions(chat target_compile_definitions(chat