> In the following example,
> the 'drop' target depends on dummy.cc which has an implicit dependency
> on blah.h, which means that 'drop' should be rebuilt after every change
> to blah.h. However, with CMake 2.6.4 (rpm from Fedora 11) and 2.8.0-rc6
> (self-compiled), the 'drop' target is never remade when blah.h is
> modified. Is this a bug?
>
> blah.h:
> inline int blah() { return 3; }
>
> dummy.cc:
> #include <iostream>
> #include "blah.h"
> void tester() { std::cout << blah() << std::endl; }
>
> CMakeLists.txt:
> cmake_minimum_required( VERSION 2.6.4 )
> add_custom_command( OUTPUT drop
> COMMAND touch drop
> IMPLICIT_DEPENDS CXX dummy.cc )
> add_custom_target( dropper ALL DEPENDS drop )
For the benefit of the archives, the solution was to provide a fully
qualified path name for the implicit dependency, like so:
cmake_minimum_required( VERSION 2.6.4 )
add_custom_command( OUTPUT drop
COMMAND touch drop
IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dummy.cc )
add_custom_target( dropper ALL DEPENDS drop )
Regards,
Ravi
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake