[CMake] Rules for files with non-standard extensions

Steven Wilson steven.wesley.wilson at gmail.com
Thu Mar 5 11:29:21 EST 2009


The example I gave is only just an example for illustrating my question
about Xcode and the true source files.   The actual code does have unique
names for tmpfile so it will work correctly in a parallel build.

On Thu, Mar 5, 2009 at 6:28 AM, Mathieu Malaterre <
mathieu.malaterre at gmail.com> wrote:

> On Tue, Mar 3, 2009 at 9:06 PM, Steven Wilson
> <steven.wesley.wilson at gmail.com> wrote:
> > As a new member of the list, I just wanted to say thanks for providing
> this
> > forum as a place to get answers about cmake!
> > First, the problem:   I have a software system composed of a number of
> > source files in C.   These files have an alternate file extension .bc.
> In
> > order to compile these files, the build system first needs to pass them
> > through two preprocessors; 1. The C preprocessor and 2. a homegrown
> > preprocessor that handles a private C language extension and converts
> > occurrences of that language extension to standard C.   Finally the
> > preprocessed source is handed to the C compiler.    My initial port of
> this
> > build system used the following kind of construct:
> > macro(process_bc_files INPUT_FILE)
> >
> > add_custom_command(OUTPUT ${INPUT_FILE}.c
> >
> > COMMAND preprocessor1 ${INPUT_FILE} > tmpfile
> > COMMAND preprocessor2 tmpfile > ${INPUT_FILE}.c
> >
> > )
> >
> > endmacro(process_bc_files)
>
> Just out of curiosity, does this work in parallel build (make -j4) ? I
> am seeing a single 'tmpfile' for all your input files ...
>
> --
> Mathieu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090305/4e3a09f1/attachment.htm>


More information about the CMake mailing list