[CMake] add_custom_command: regenerate all on modifcation?

Dave Milter davemilter at gmail.com
Sun Jun 1 02:52:32 EDT 2008


On 6/1/08, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> Dave Milter wrote:
>  \
>
> >
> > I look at generated by cmake makefiles, and all generated files depend on
> > CMakeLists.txt
> >
>
>  Please create a small example that shows your problem.
>

I hope this mailing list accept attachments.
Look at regenerate_problem.tar.gz in attachment.
It compiles on only unix like os,  because of it uses /bin/sh.

Part of CMakeLists.txt looks like this:
------------------------------------------------------
ADD_EXECUTABLE(regenerate_problem
        main.cpp
        ${CMAKE_CURRENT_BINARY_DIR}/ui_foo.hpp
        foo.cpp
        #foo2.cpp
)
------------------------------------------------------
if build project, and after that uncomment foo2.cpp,
it calls script to regenerate ${CMAKE_CURRENT_BINARY_DIR}/ui_foo.hpp,
but rule to build ui_foo.hpp not changed, script to build ui_foo.hpp
not changed,
and ui_foo.hpp exists and uptodate, but
generated by cmake makefile cause it reneration, and this of cause rebuild
files which depends on ui_foo.hpp.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regenerate_problem.tar.gz
Type: application/x-gzip
Size: 592 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080601/fb372532/attachment.bin>


More information about the CMake mailing list