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 "Using precompiled headers" option set on them when I view that file's properties.</div>
<div><br></div><div>What improvements could be made to this macro? I'm not familiar at all with the command line parameters so I'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 "${CMAKE_CURRENT_BINARY_DIR}/${PrecompiledBasename}.pch")</div><div> SET(Sources ${${SourcesVar}})</div>
<div><br></div><div> SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource}</div><div> PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""</div>
<div> OBJECT_OUTPUTS "${PrecompiledBinary}")</div><div> SET_SOURCE_FILES_PROPERTIES(${Sources}</div><div> PROPERTIES COMPILE_FLAGS "/Yu\"${PrecompiledBinary}\" /FI\"${PrecompiledBinary}\" /Fp\"${PrecompiledBinary}\""</div>
<div> OBJECT_DEPENDS "${PrecompiledBinary}") </div><div> ENDIF(MSVC)</div><div>endmacro()</div><div><br></div><div>---------</div>Robert Dailey<br>
</div></div>