QT 6.3 cmake adding icons OSX
-
wrote on 9 Nov 2021, 17:23 last edited by
Hi there,
I'm having problems trying to figure out how to add icons to my app. The help files are very confusing - can some one point me in the right direction?
Thanks in advance
Best wishes
Ziggx -
Hi there,
I'm having problems trying to figure out how to add icons to my app. The help files are very confusing - can some one point me in the right direction?
Thanks in advance
Best wishes
Ziggxwrote on 9 Nov 2021, 17:32 last edited by@ziggx said in QT 6.3 cmake adding icons OSX:
add icons to my app.
Define what icons you mean. Do you refer to this?
-
Hi there,
I'm having problems trying to figure out how to add icons to my app. The help files are very confusing - can some one point me in the right direction?
Thanks in advance
Best wishes
Ziggx -
wrote on 13 Nov 2021, 12:20 last edited by
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
1/4