[CMake] custom command question

Filipe Sousa filipe at ipb.pt
Mon Aug 28 10:18:29 EDT 2006


Doug Henry wrote:
> 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}
> )

Did you add ${DBD} to ADD_EXECUTABLE ?

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
ADD_EXECUTABLE(the_target ${DBS} other sources)

> 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.

-- 
Filipe Sousa

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://public.kitware.com/pipermail/cmake/attachments/20060828/f60633df/signature-0001.pgp


More information about the CMake mailing list