title: Generate list files with CMake
body: <p>I hope this is a simple question and I'm just missing something fundamental. </p>
  
  <p>I'm trying to emulate a binary build manager for an embedded Cortex-M0 target using a CMake project. I'm having some trouble figuring out how to generate list files for each dependency of my executable target.</p>
  
  <p>The current build system, when building a file called <code>main.c</code> passes <code>-Wa,-alh=.\CortexM0\ARM_GCC_493\Debug/main.lst</code> as an argument to gcc. I can't figure out how to get CMake to use the current filename without the extension to save the file.</p>
  
  <p>I've looked at the <a href="https://cmake.org/cmake/help/v3.7/command/get_filename_component.html" rel="nofollow noreferrer">get_filename_component</a> command, but it appears only to get the filename of the output:</p>
  
  <pre><code>add_executable(TestExe main.c)
  get_filename_component(curr_name TestExe NAME_WM)
  message(${curr_name})
  </code></pre>
  
  <p>As expected, this prints <code>TestExe</code> instead of the hoped for <code>main</code></p>
  
  <p>Is there a simple variable I'm overlooking that I could put in my toolchain file's CMAKE_C_FLAGS like <code>-Wa,-alh=${CURR_SOURCE}.lst</code>? Or some other method that I'm not seeing?</p>
  
  <p>System info:</p>
  
  <ul>
  <li>Windows 10 </li>
  <li>Msys shell</li>
  <li>CMake 3.7.2</li>
  <li>arm-none-eabi-gcc v4.9.3</li>
  </ul>