title: How to express that a map file depends on add_executable?
body: <p>I'm building an executable using the standard command:</p>
  
  <pre><code>add_executable(MyExe a.c b.c)
  </code></pre>
  
  <p>I'm adjusting the <code>CMAKE_EXE_LINKER_FLAGS</code> to emit a map file, and it works.</p>
  
  <p>If I delete the map file, though, performing an incremental build doesn't regenerate the map file.  This makes sense, since I haven't expressed to cmake that the map file depends on MyExe.  In the above scenario, the MyExe.map isn't even a target, so cmake doesn't even know it exists.</p>
  
  <p>I've tried creating a custom target, but I can't create a custom command that regenerates the map file, since it comes from <code>add_executable()</code>.  I then tried to use <code>add_dependencies()</code>, but that seems to only influence the build order.</p>
  
  <p>I could explicitly re-run the linker as a custom command that builds a custom target, but that seems wasteful since linking does take a bit of time.</p>
  
  <p>It almost seems like I need some way to tell add_executable that there are more outputs than just the executable image.  Is there a way to do this?</p>
  
  <p>If anybody could point me in the right direction, I'd appreciate it!  Thanks in advance for reading.</p>