Unless I misunderstand the documentation a target level dependency is
automatically added if the command references a target created by
add_executable.
So the order at least should be guaranteed?
Though either way your second argument is still valid.
Nils
On 05/14/2013 07:57 PM, Matthew Woehlke wrote:
On 2013-05-14 06:19, Nils Gladitz wrote:
I think something like this:
add_executable(2 2.cpp)
add_executable(gen gen.cpp)
add_custom_command(OUTPUT 2.cpp
COMMAND gen "${CMAKE_CURRENT_SOURCE_DIR}/2.txt" -o 2.cpp
DEPENDS 2.txt
)
'DEPENDS 2.txt gen' :-). You want the dependency on 'gen' to ensure it
has been built before trying to run the custom command (also because
you usually want to re-run the command if 'gen' changes).
--
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