[CMake] custom command question

Doug Henry develop at brilligent.com
Mon Aug 28 10:27:53 EDT 2006


No, since it is a dependency of a source file that is included in the
executable I would expect it to be handled (it was in previous releases).
It seems that cmake does know about it, because it gives an error with the
correct path to the file that needs to be generated.  I don't know why cmake
will not run the custom command anymore.  I suspect that the source files I
generate this way are created because they are in the list as you suggest.


On 8/28/06, Filipe Sousa <filipe at ipb.pt> wrote:
>
> 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
>
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060828/6c8b8a2b/attachment.html


More information about the CMake mailing list