title: Customising MacOS Bundle's Info.plist file with CMake
body: <p>I'm using CMake generate build files for a cross platform game and want to specify custom <code>NSMainNibFile</code> and <code>NSPrincipalClass</code> values in certain bundle's Info.plist file</p>
  
  <p>Here's the relevant portion of my Info.plist.in template:</p>
  
  <pre><code>&lt;key&gt;NSMainNibFile&lt;/key&gt;
  &lt;string&gt;${MAIN_NIBFILE}&lt;/string&gt;
  &lt;key&gt;NSPrincipalClass&lt;/key&gt;
  &lt;string&gt;${PRINCIPAL_CLASS}&lt;/string&gt;
  </code></pre>
  
  <p>What I'm doing in my CMakeLists.txt is:</p>
  
  <pre><code>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)`
  </code></pre>
  
  <p>If I get the <code>MAIN_NIBFILE</code> property for the target, it returns MainMenu as expected, but the actual generated Info.plist is empty.</p>
  
  <p>BUT...</p>
  
  <p>If I globally set these variables, it works fine.</p>
  
  <pre><code># I would prefer to set these at target scope, 
  # but it doesn't bloody work!
  set(MAIN_NIBFILE "MainMenu")
  set(PRINCIPAL_CLASS "NSApplication")
  </code></pre>
  
  <p>Am I missing something here or is this a limitation of CMake or how it handles macOS bundles?</p>