[CMake] add_dependencies being ignored for add_custom_command?

Martin Braun martin.braun at ettus.com
Mon Oct 26 18:31:31 EDT 2015


Gotcha, Iosif,

thanks for clearing that up for me. To summarize, I should ...

On 26.10.2015 12:51, Iosif Neitzke wrote:
> [...]
> add_library( somelib ${CMAKE_CURRENT_BINARY_DIR}/Header.hpp
> ${CMAKE_CURRENT_BINARY_DIR}/Header.cpp source.cpp )

...add the generated files as to the target.

That leads me to another question, though (hopefully the last): If
source.cpp depends on Header.hpp, is it guaranteed that Header.hpp will
be generated before the compiler tries to compile source.cpp? Does the
list order of the files inside add_library() matter?

Cheers,
Martin


More information about the CMake mailing list