Failing to set LSApplicationCategoryType

I added:

set(CMAKE_XCODE_ATTRIBUTE_INFOPLIST_KEY_LSApplicationCategoryType "public.app-category.astronomy" CACHE STRING "")

to my top level CMake file, but nothing ends up in the Info.plist file?

Am I doing this wrong?

Thanks
David

I have no experience with this directly (or XCode itself, for that matter), but note that this variable is of the type which pre-initialises target properties when targets are created, and it’s target properties themselves which carry the semantics. IOW, you have set this variable before you create the target(s) to which you want it to apply. Double-check that this is the case.

To test, you can also set the target property XCODE_ATTRIBUTE_INFOPLIST_KEY_LSApplicationCategoryType directly on a target and verify whether it does what you need.

Also, do you need/want it to be a cache variable (which is what you’re setting now). You could also try setting a plain variable instead and seeing if anything changes.