[CMake] how to automatically make object from generated source?

Jens.M.Hoffmann at bahn.de Jens.M.Hoffmann at bahn.de
Tue Jun 12 08:51:58 EDT 2007





Hello,

thanks for the replies to my previous question. Here comes the next one.

I have got a couple of C and C++ sources with embedded SQL. These are
transformed into
real C and C++ sources with a preprocessor (Oracle proc). The resulting
sources should be
compiled with gcc with my ADD_DEFINITIONS and INCLUDE_DIRECTORIES settings.
The resulting object than must be linked with a custom command called
buildserver.

So what I'm trying now is

SET_SOURCE_FILES_PROPERTIES( ${src_dir}/admin/clean.cpp PROPERTIES
GENERATED true )

ADD_CUSTOM_COMMAND( OUTPUT ${src_dir}/admin/clean.cpp
                COMMAND proc MODE=ANSI code=cpp
                iname=${src_dir}/admin/clean.ec
                oname=${src_dir}/admin/clean.cpp
                DEPENDS ${src_dir}/admin/clean.ec )

ADD_CUSTOM_COMMAND( OUTPUT ${src_dir}/admin/clean
                COMMAND buildserver -o ${src_dir}/admin/clean
                      -f ${src_dir}/admin/clean.o
                  DEPENDS ${src_dir}/admin/clean.o )

ADD_CUSTOM_TARGET( dummy ALL DEPENDS ${src_dir}/admin/clean )

What I'm now getting is the following error message:

make[2]: *** No rule to make target `[...]/admin/clean.o', needed by
`[...]/admin/clean'.
Stop.

I thought about adding a custom command for this step (.cpp -> .o) but that
seems not so nice.
Is there a better way or am i missing something?

Regards
Jens-Michael



---------

Diese E-Mail könnte  vertrauliche und/oder rechtlich geschützte
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die
unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

----------


More information about the CMake mailing list