Re: [CMake] errors with add_custom_command and add_custom_target

2016-01-26 Thread Petr Kmoch
Normally, you would want to keep your source tree clean from any build-time modifications (CMake *strongly discourages* in-source builds, with good reason). Therefore, you'd want to generate the files in CMAKE_CURRENT_BINARY_DIR. Assuming the generator always writes them into its current

Re: [CMake] errors with add_custom_command and add_custom_target

2016-01-26 Thread Vania Joloboff
Hi Petr, Thanks, indeed I had unset the property ! Cmake works fine with removing the line. But I have now a doubt. My generator generates the files in the current dir. Should I indicate the working directory in add_custom_command ? so that the generated sources are added in

[CMake] errors with add_custom_command and add_custom_target

2016-01-26 Thread Vania Joloboff
Hi I have a generator that generates some, but not all of the source files. My understanding was that I should use add_custom_command for that When I do set(EXIST_SOURCES A.cc B.cc C.cc) set(GEN_SOURCES X.cc Y.cc Z.cc) add_custom_command(OUTPUT ${GEN_SOURCES} COMMAND

Re: [CMake] errors with add_custom_command and add_custom_target

2016-01-26 Thread Petr Kmoch
Hi, Vania. You should remove this line: set_property(SOURCE ${GEN_SOURCES} PROPERTY GENERATED ) CMake will mark the files as generated automatically. What your line is actually doing is setting them as *not* generated, because you didn't pass any argument to set the property to, so it's