Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
>> I haven't seen that documented anywhere. IMHO this >> behavior is counter-intuitive, in general I expect the scope of a >> target to not depend on the cmake command I am trying to use. > > > I think it is sensible that the definition of a target is scoped to one > single directory. > Where the

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
On 4 August 2015 at 14:32, Iosif Neitzke wrote: > And: > > "A target created in the same directory (CMakeLists.txt file) that > specifies any output of the custom command as a source file is given a > rule to generate the file using the command at build time." > > http://www.cmake.org/cmake/help/v

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
On 4 August 2015 at 14:20, Iosif Neitzke wrote: > "Dependencies listed with the DEPENDS argument may reference files and > outputs of custom commands created with add_custom_command() in the > same directory (CMakeLists.txt file)." > > http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:add_

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Iosif Neitzke
And: "A target created in the same directory (CMakeLists.txt file) that specifies any output of the custom command as a source file is given a rule to generate the file using the command at build time." http://www.cmake.org/cmake/help/v3.3/command/add_custom_command.html But it's not super clear

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Nils Gladitz
On 04.08.2015 23:15, Dan Liew wrote: foolib is defined in this CMakeLists.txt: https://github.com/delcypher/cmake_add_custom_command_bug/blob/master/lib/CMakeLists.txt That is the (only) context in which you can extend the definition of the target with custom commands. Since when? As far as I

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Iosif Neitzke
"Dependencies listed with the DEPENDS argument may reference files and outputs of custom commands created with add_custom_command() in the same directory (CMakeLists.txt file)." http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:add_custom_target On Tue, Aug 4, 2015 at 4:15 PM, Dan Liew w

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
For reference I've opened up a bug report http://www.cmake.org/Bug/view.php?id=15681 -- 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

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
> foolib is defined in this CMakeLists.txt: > https://github.com/delcypher/cmake_add_custom_command_bug/blob/master/lib/CMakeLists.txt > > That is the (only) context in which you can extend the definition of the > target with custom commands. Since when? I haven't seen that documented anywhere. IM

Re: [CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Nils Gladitz
On 04.08.2015 22:46, Dan Liew wrote: The target name "foolib" is unknown in this context. This warning is for project developers. Use -Wno-dev to suppress it ``` This doesn't make sense the target **clearly exists and is in scope** because the ``simple_test`` executable links against it an

[CMake] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Dan Liew
Hi, I'm almost certain this is a bug but I thought I'd ask the mailing lists first. I'm observing a problem with CMake's add_custom_command() when using the TARGET version of the signature. Code demonstrating the issue can be found at [1] In ``test/CMakeLists.txt`` [2] I try using add_custom_co