title: Adding files to CMake but not compiling them
body: <p>My company has their own idl compiler, and I have CMake generating the files as a part of the build process.  I want the .idl files to be in the visual studio project, but that means I end up with microsoft trying to compile the idl files with midl (which fails miserably).</p>
  
  <p>I know my question is extremely similar to <a href="https://stackoverflow.com/questions/7455280/adding-data-files-to-cmake-generated-projects/7455452#7455452">Adding data files to cmake-generated projects</a>, but the major difference is that microsoft does have a compiler I just don't want them to use it.</p>
  
  <p>-update-</p>
  
  <p>Here is a code sample from the function that adds the idl file to the solution (The entirety of the code is too much, but if there are any declarations that might help in answering the question let me know):</p>
  
  <pre><code>function foo()
      add_custom_command...
      set(HEADERS ${HEADERS} bar.idl PARENT_SCOPE)
      source_group("Source Files\\idl Files" REGULAR_EXPRESSION .*.idl)
  endfunction()
  </code></pre>
  
  <p>Then later - after I call foo - I call <code>add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})</code></p>
  
  <p>One thing I noticed is that nmake will compile how I want it to compile, but visual studio adds the call to midl that I don't want.</p>
  
  <p>Any help will be greatly appreciated.</p>
  
  <p>-update 2-</p>
  
  <p>I can hack a way of 'fixing' the problem by adding a /? to the midl command line inside visual studio (but I can't ask every dev to do that each time they build), so if anyone knows how to add an argument to the midl command line from cmake that would help as well.</p>