QT 6.3 cmake adding icons OSX
-
Hi everyone,
CMake help files can be a bit obscure - however, I sorted it out. I think a bit more in integrating cmake with QT Creator would help.
Anyway, for anyone else trying to add icns to QT with OSX, you need to add these lines before "find package" (substitute your icns file and names as appropriate):
set(MACOSX_BUNDLE_ICON_FILE Stubtiler.icns)
set(Stubtiler_ICON "${CMAKE_CURRENT_SOURCE_DIR}/Stubtiler.icns")
set_source_files_properties(${Stubtiler_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")Then in:
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(StubTiler
MANUAL_FINALIZATION
StubResources.qrc # add resources files
${Stubtiler_ICON} # add icns here
${PROJECT_SOURCES}
)Hope this helps anyone else facing the same problem
Ziggx