[CMake] How to create preprocess-only file rule

Nikolay Mitev face.mitev at gmail.com
Fri Apr 24 06:47:06 EDT 2009


Hi

I'm trying to create a rule which will only run the C++ preprocessor on a
file, without compiling it. I know about the make file.i rule, but if
file.cpp is not a dependency of some target it does not get generated.
Setting header_file property doesn't work either. Adding a custom rule
works, but I have to manually assemble the include paths, defines, etc...
I found the CMAKE_CXX_CREATE_PREPROCESSED_SOURCE rule in the modules dir,
but I guess it can't be used directly in a cmake file. So, is there a way to
generate a *.i target without the cpp file being included in any target?

Nikolay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090424/7ba8c033/attachment.htm>


More information about the CMake mailing list