[CMake] custom command question

Doug Henry develop at brilligent.com
Mon Aug 28 09:55:49 EDT 2006


Something about the custom command behavior has changed slightly and I am
hoping I am just missing something.  I have been able to do the following in
the past:

#
# reswrap log.sql file
#

SET(DBNAME log_sql)
SET(DBS ${PROJECT_BINARY_DIR}/${DBNAME}.h)
SET(LOGSQL ${PROJECT_SOURCE_DIR}/../data/log.sql)

ADD_CUSTOM_COMMAND (
        OUTPUT ${DBS}
        DEPENDS ${LOGSQL}
        COMMAND ${PROG_RESWRAP}
        ARGS -t -r ${DBNAME} ${LOGSQL} > ${DBS}
)

This cmake code basically generates a header file, which is included in
source files in the project.  Previous cmakes have been able to detect this
file as a dependency of the source, and it would be triggered when needed.
In the newest (2.4.3) this no longer occurs, instead I receive an error
message:

make[2]: *** No rule to make target `dtrand/src/log_sql.h', needed by
`dtrand/src/CMakeFiles/dtrand.dir/Dtrand.o'.  Stop.

I have other files that are generated in the same way, but they are source
(.cpp) files, and are included in the source list.  The sources files are
generated, but not the header files.  It seems that I may need to setup some
sort of explicit dependency now?

-thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060828/4dd2e282/attachment.htm


More information about the CMake mailing list