1
0
mirror of synced 2024-11-28 01:20:51 +01:00

build: Fix Icon on macOS (#417)

* build: Try to fix macOS icon

* add debugging

* Copy icon file manually

Fixes #414
This commit is contained in:
WerWolv 2022-02-06 22:29:16 +01:00 committed by GitHub
parent 2577a2f637
commit f1c7dea0ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -105,7 +105,7 @@ macro(configurePackingResources)
endif()
if (WIN32)
set(application_type)
set(APPLICATION_TYPE)
set(IMHEX_ICON "${CMAKE_SOURCE_DIR}/resources/resource.rc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--allow-multiple-definition")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-subsystem,windows")
@ -126,8 +126,8 @@ macro(configurePackingResources)
set (IMHEX_ICON "${CMAKE_SOURCE_DIR}/resources/AppIcon.icns")
if (CREATE_BUNDLE)
set(application_type MACOSX_BUNDLE)
set_source_files_properties(${IMHEX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(APPLICATION_TYPE MACOSX_BUNDLE)
set_source_files_properties(${IMHEX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
set(MACOSX_BUNDLE_ICON_FILE "AppIcon.icns")
set(MACOSX_BUNDLE_INFO_STRING "WerWolv")
set(MACOSX_BUNDLE_BUNDLE_NAME "ImHex")
@ -231,6 +231,9 @@ macro(createPackage)
# FIXME: Remove this once we move/integrate the plugins directory.
add_custom_target(build-time-make-plugins-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${bundle_path}/Contents/MacOS/plugins")
add_custom_target(build-time-make-resources-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${bundle_path}/Contents/Resources")
install(FILES ${IMHEX_ICON} DESTINATION "${bundle_path}/Contents/Resources")
# Update library references to make the bundle portable
postprocess_bundle(imhex main)

View File

@ -1,6 +1,6 @@
project(main)
add_executable(main ${application_type}
add_executable(main ${APPLICATION_TYPE}
source/main.cpp
source/window/window.cpp