Re: [CMake] add_dependencies being ignored for add_custom_command?

2015-10-31 Thread Iosif Neitzke
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 wrote: > Gotcha, Iosif, > > thanks for clearing that up for me. To summarize, I should

Re: [CMake] add_dependencies being ignored for add_custom_command?

2015-10-26 Thread Martin Braun
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

Re: [CMake] add_dependencies being ignored for add_custom_command?

2015-10-26 Thread Iosif Neitzke
On Mon, Oct 26, 2015 at 12:32 PM, Martin Braun wrote: > What exactly is a target? I thought if I do add_library(foo ${sources}), > then 'foo' is a target? You seem to suggest otherwise, which means I'm > misunderstanding some concepts. You are correct, "foo" is a target,

Re: [CMake] add_dependencies being ignored for add_custom_command?

2015-10-26 Thread Martin Braun
Iosif, thanks for your answer. I have some follow-up questions, though: On 23.10.2015 18:21, Iosif Neitzke wrote: > The command "add_dependencies" [0] only works on targets. What exactly is a target? I thought if I do add_library(foo ${sources}), then 'foo' is a target? You seem to suggest

Re: [CMake] add_dependencies being ignored for add_custom_command?

2015-10-23 Thread Iosif Neitzke
The command "add_dependencies" [0] only works on targets. See the CMake Tutorial for how to generate files as part of the build that later targets rely on. [1]. [0] https://cmake.org/cmake/help/v2.8.12/cmake.html#command:add_dependencies [1] https://cmake.org/cmake-tutorial/#s5 On Fri, Oct 23,

[CMake] add_dependencies being ignored for add_custom_command?

2015-10-23 Thread Martin Braun
Hey, I'm at a loss here: I have a command that's run with add_custom_command(). I need to run it before compiling a library that I add with add_library(), because it generates some header files. This was my first try: file1: {{{ add_custom_command( OUTPUT foo.hpp COMMAND bar ) }}}