Re: [CMake] Problems with auto-generated sources

2013-10-01 Thread Williams, Norman K
I was under the impression that target_link_libraries implicitly mad the target depend on all mentioned libraries. Calling the custom command and library build twice during parallel builds is just wrong. If it's a known problem, it probably requires addressing at some point. Does this problem ex

Re: [CMake] Problems with auto-generated sources

2013-10-01 Thread Gregor Jasny
Hello, On 9/30/13 7:19 PM, Williams, Norman K wrote: cmake_minimum_required(VERSION 2.8) project(Test) add_custom_command(OUTPUT file.c COMMAND echo "GENERATING FILE" COMMAND ${CMAKE_COMMAND} -E remove file.c

Re: [CMake] Problems with auto-generated sources

2013-09-30 Thread Alexander Neundorf
On Monday 30 September 2013, Jakub Schmidtke wrote: > The workaround I found so far is to add a custom target that depends on the > targets I want to build. > So if I add this: > add_custom_target(test12 DEPENDS test1 test2) > > to my CMake file, and instead of running 'make -j test1 test2' I run

Re: [CMake] Problems with auto-generated sources

2013-09-30 Thread Williams, Norman K
Actually I see the problem now -- it works fine if you build with one job, but if you run 2 jobs, it for some reason runs the custom command and the library build command twice. Which is weird, and probably a bug. Without digging into the generated Makefiles, it seems like the custom command thro

Re: [CMake] Problems with auto-generated sources

2013-09-30 Thread Williams, Norman K
I don't see the problem you're having. I re-wrote your CMakeLists.txt slightly to not use Unix commands: cmake_minimum_required(VERSION 2.8) project(Test) add_custom_command(OUTPUT file.c COMMAND echo "GENERATING FILE"

Re: [CMake] Problems with auto-generated sources

2013-09-30 Thread Jakub Schmidtke
The workaround I found so far is to add a custom target that depends on the targets I want to build. So if I add this: add_custom_target(test12 DEPENDS test1 test2) to my CMake file, and instead of running 'make -j test1 test2' I run 'make -j test12' everything seems to be fine... On Mon, Sep

Re: [CMake] Problems with auto-generated sources

2013-09-30 Thread Rolf Eike Beer
Am Montag, 30. September 2013, 12:58:40 schrieb Jakub Schmidtke: > Hi, > > I am trying to get dependencies right in a project that uses auto-generated > sources. > I have a library, that uses auto-generated files, and other executables > that use that library. > I created a set of CMakeLists.txt f

[CMake] Problems with auto-generated sources

2013-09-30 Thread Jakub Schmidtke
Hi, I am trying to get dependencies right in a project that uses auto-generated sources. I have a library, that uses auto-generated files, and other executables that use that library. I created a set of CMakeLists.txt files that show the problem. To run it you need test.c and org.c in the source