[FR] Application Icon working for CLion exporter

Hi Juce team, I’m having issues with a Clion Exporter on Mac.
Already posted on another thread but this is a blocking issue, so sorry for being pedantic but I really need to solve this or a least know if it’s a dead end. Thanks!

Environment & Problem

  • Projucer project on Mac where I set the "Application Icon " i.e. Icon(small) and Icon(large) on the Xcode Exporter
  • CLion Exporter taking input from xcode+linux+xcodeblocks

When the application Icon is set CLion is actually trying to run the Icon.icns file instead of the executable inside the .app :open_mouth: if I chmod+x the icon it actually runs it!

Error is

Error running ‘APP’: Cannot run program “/cmake-build-debug/myproject/Builds/CLion/myproject.app/Contents/Resources/Icon.icns” (in directory “/cmake-build-debug/myproject/Builds/CLion/myproject.app/Contents/Resources”): error=13, Permission denied

CmakeLists changes when I add the App Icon is this line, along with all the HEADER_ONLY image lines:

set_source_files_properties ("…/MacOSX/Icon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION “Resources”)

I’m having this issue as well. Every time I re-save the .jucer file I have to go into the CMakeLists.txt file and remove the .icns file from the add_executable command.

thanks for the answer! one question tough :

I have Icon.icns twice in the Cmakelists file

  1. as the last file line in add_executable (APP ….
  2. as the first of the set_source_files_properties lines, i.e
    set_source_files_properties(“…/MacOSX/Icon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION “Resources”)

if I delete either of 1 or 2 the error goes away, but so does the app icon (executable has no icon, not in the mac dock bar nor looking at it with finder)

Is that your same behaviour?

1 Like

Can confirm. Removing the set_source_files_properties also works, but in either case the icon does not show up in Finder or the dock.

I’ve always just used CLion for developing and built and signed all releases using Xcode. This has not been a problem with that exporter.

Can we please just remove the icon from the Mac part of the CMakeLists.txt? That would unblock the issue, allowing an icon to be set for Xcode and VS projects without breaking Mac CLion projects.

1 Like