title: CMake: how to disable optimization of a single *.cpp file?
body: <p>I would like to disable the optimization of a single *.cpp file within my CMake project. I found out that CMake provides the following to achieve this: </p>
  
  <pre><code>SET_SOURCE_FILES_PROPERTIES(${FILE} PROPERTIES COMPILE_FLAGS -O0)
  </code></pre>
  
  <p>However, this seems not to work for me. I generate a Visual Studio 2013 Project and whenever I change to 'Release' or 'RelWithDebInfo' it still fully optimizes that file as can be seen under the properties. </p>
  
  <p>Does it matter where the above command is placed? I have multiple cmake files distributed over the whole project. I placed the above command directly in the cmake file where the *.cpp file gets added to the project.  </p>
  
  <p>Or is there any other way to tell CMake that this file should not get optimized at all?</p>