Followed the directions here for OSX: http://doc.qt.io/qt-5/appicon.html
stating that all I need to do is add ICON = myapp.icns
to my project file.
I used one of the ICNS files I stole from Qt itself (in other words, it should work, its not a conversion problem) and when build after running qmake I get the error
make: *** No rule to make target '1.22/MyProject.icns', needed by 'myapp.app/Contents/Resources/MyProject.icns'
I regularly use make but have little experience with Qt so I have no idea what it's trying to tell me here (I don't even know where these file paths are coming from). The .icns file has been added to the resources .qrc and is in the base directory of the project.
Any help is much appreciated. Thanks!
EDIT: Ok, the space in the file path was preventing the build. It now compiles and runs but still does not have a dock icon.
Here is the output of the grep command, as requested by Simon Warta:
_Qt_5_1_1_clang_64bit-Debug/Makefile | grep -C 3 icns
443
444 :
445 @$(DEL_FILE)
446 @sed -e "s,@SHORT_VERSION@,1.22,g" -e "s,@TYPEINFO@,????,g" -e "s,@ICON@,myapp.icns,g" -e "s,@EXECUTABLE@,myapp,g" -e "s,@TYPEINFO@,????,g" ../myapp1.22/myapp.plist >
447 myapp.app/Contents/Resources/myapp.icns: ../myapp1.22/myapp.icns
448 @test -d myapp.app/Contents/Resources/ || mkdir -p myapp.app/Contents/Resources/
--
448 @test -d myapp.app/Contents/Resources/ || mkdir -p myapp.app/Contents/Resources/
449 @$(DEL_FILE) myapp.app/Contents/Resources/myapp.icns
450 @$(COPY_FILE) ../myapp1.22/myapp.icns myapp.app/Contents/Resources/myapp.icns
451 dist:
452 @test -d .tmp/myapp1.22 || mkdir -p .tmp/myapp1.22
[[All my source files]]
477 compiler_rcc_clean:
478 -$(DEL_FILE) qrc_myapp.cpp
479 qrc_myapp.cpp: ../myapp1.22/myapp.qrc \
480 ../myapp1.22/myapp.icns \
481 ../myapp1.22/images/splashmyapp2.png \
482 ../myapp1.22/images/splashmyapp1.png \
483 ../myapp1.22/images/About.png \
--
--
481 ../myapp1.22/images/splashmyapp2.png \
482 ../myapp1.22/images/splashmyapp1.png \
483 ../myapp1.22/images/About.png
486 /Users/EngMac/Qt5.1.1/5.1.1/clang_64/bin/rcc -name myapp ../myapp1.22/myapp.qrc -o qrc_myapp.cpp
From myapp.pro:
ICON = myapp.icns
QMAKE_INFO_PLIST = myapp.plist