I'm using CMake generate build files for a cross platform game and want to specify custom NSMainNibFile
and NSPrincipalClass
values in certain bundle's Info.plist file
Here's the relevant portion of my Info.plist.in template:
<key>NSMainNibFile</key>
<string>${MAIN_NIBFILE}</string>
<key>NSPrincipalClass</key>
<string>${PRINCIPAL_CLASS}</string>
What I'm doing in my CMakeLists.txt is:
set_target_properties(GLWindow PROPERTIES
MACOSX_BUNDLE_BUNDLE_NAME "OpenGL Test"
MAIN_NIBFILE "MainMenu"
PRINCIPAL_CLASS "NSApplication")
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/CMake/Info.plist.in)`
If I get the MAIN_NIBFILE
property for the target, it returns MainMenu as expected, but the actual generated Info.plist is empty.
BUT...
If I globally set these variables, it works fine.
# I would prefer to set these at target scope,
# but it doesn't bloody work!
set(MAIN_NIBFILE "MainMenu")
set(PRINCIPAL_CLASS "NSApplication")
Am I missing something here or is this a limitation of CMake or how it handles macOS bundles?