[CMake] How to generate preprocessed file?

Bill Hoffman bill.hoffman at kitware.com
Mon Mar 23 07:56:32 EDT 2009


Marcel Loose wrote:
> Hi all,
> 
> I was trying to figure out how to generate a preprocessed file. By
> browsing the CMake modules and by printing all CMake variables I
> discovered CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE variables. That
> suggests that there is support for generating preprocessed files. 
> 
> However, there's no mention of these variables in the documentation, or
> the FAQ or the Wiki. How should I tell CMake to add rules to my Unix
> Makefiles for generating preprocessed (.i) files?
> 

Just run make foo.i in the directory of the target that contains foo.c. 
  If you run make help in any directory it will list these types of targets.

-Bill


More information about the CMake mailing list