[CMake] add_dependencies being ignored for add_custom_command?

Iosif Neitzke iosif.neitzke+cmake at gmail.com
Sat Oct 31 11:53:42 EDT 2015


Yes, Header.hpp will be generated before the target is built.  I do
not believe the order of files listed in add_library() matters at all.

On Mon, Oct 26, 2015 at 5:31 PM, Martin Braun <martin.braun at ettus.com> wrote:
> 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
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake


More information about the CMake mailing list