Skip to content

Commit 846251a

Browse files
Ericzklmfyex
authored andcommitted
Linked SerialPrograms Icon on MacOS
1 parent ae9bcdc commit 846251a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

IconResource/icon.icns

44.8 KB
Binary file not shown.

SerialPrograms/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}../../ FILES ${MAIN_SOURCES})
20382038

20392039
if (APPLE)
20402040
# TODO: set up the correct application icon
2041-
# set(SerialPrograms_ICON ${CMAKE_CURRENT_SOURCE_DIR}/../Resources/icon.icns)
2041+
set(SerialPrograms_ICON ${CMAKE_CURRENT_SOURCE_DIR}/../IconResource/icon.icns)
20422042
# set_source_files_properties(SerialPrograms_ICON PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
20432043

20442044
# Links on how to create a MacOS app bundle with cmake
@@ -2051,9 +2051,10 @@ if (APPLE)
20512051
MACOSX_BUNDLE_BUNDLE_NAME SerialPrograms
20522052
MACOSX_BUNDLE_BUNDLE_VERSION "0.1"
20532053
MACOSX_BUNDLE_SHORT_VERSION_STRING "0.1"
2054-
# MACOSX_BUNDLE_ICON_FILE icon
2054+
MACOSX_BUNDLE_ICON_FILE "icon.icns"
20552055
# MacOSXBundleInfo.plist.in is modified from https://github.com/Kitware/CMake/blob/master/Modules/MacOSXBundleInfo.plist.in
20562056
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in
2057+
RESOURCE ${SerialPrograms_ICON}
20572058
)
20582059
else() # WIN and Linux:
20592060
add_executable(SerialPrograms WIN32 ${MAIN_SOURCES})

0 commit comments

Comments
 (0)