I did some searching and on stackoverflow I found a post that had code in it to provide precompiled header support:<div><a href="http://stackoverflow.com/questions/148570/using-pre-compiled-headers-with-cmake">http://stackoverflow.com/questions/148570/using-pre-compiled-headers-with-cmake</a><br>
<div><br></div><div>Below is the relevant macro I am using from that post. Unfortunately this does not seem to work when generating for VS2008 or VS 2003. For some reason the CPP files other than the precompiled source itself do not have the &quot;Using precompiled headers&quot; option set on them when I view that file&#39;s properties.</div>
<div><br></div><div>What improvements could be made to this macro? I&#39;m not familiar at all with the command line parameters so I&#39;m hoping someone can help me out.</div><div><div><br></div><div>macro( set_precompiled_header pch_header pch_source source )</div>
<div>  IF(MSVC)</div><div>    GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE)</div><div>    SET(PrecompiledBinary &quot;${CMAKE_CURRENT_BINARY_DIR}/${PrecompiledBasename}.pch&quot;)</div><div>    SET(Sources ${${SourcesVar}})</div>
<div><br></div><div>    SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource}</div><div>                                PROPERTIES COMPILE_FLAGS &quot;/Yc\&quot;${PrecompiledHeader}\&quot; /Fp\&quot;${PrecompiledBinary}\&quot;&quot;</div>
<div>                                           OBJECT_OUTPUTS &quot;${PrecompiledBinary}&quot;)</div><div>    SET_SOURCE_FILES_PROPERTIES(${Sources}</div><div>                                PROPERTIES COMPILE_FLAGS &quot;/Yu\&quot;${PrecompiledBinary}\&quot; /FI\&quot;${PrecompiledBinary}\&quot; /Fp\&quot;${PrecompiledBinary}\&quot;&quot;</div>
<div>                                           OBJECT_DEPENDS &quot;${PrecompiledBinary}&quot;)  </div><div>  ENDIF(MSVC)</div><div>endmacro()</div><div><br></div><div>---------</div>Robert Dailey<br>
</div></div>