[CMake] Question about ADD_CUSTOM_COMMAND

2011-02-12 Thread Carminati Federico
Dear All, I have a question about ADD_CUSTOM_COMMAND. I read in the doc If DEPENDS specifies any target (created by an ADD_* command) a target-level dependency is created to make sure the target is built before any target using this custom command. Additionally, if the target is an

Re: [CMake] Question about ADD_CUSTOM_COMMAND

2011-02-12 Thread Michael Hertling
On 02/12/2011 03:00 PM, Carminati Federico wrote: Dear All, I have a question about ADD_CUSTOM_COMMAND. I read in the doc If DEPENDS specifies any target (created by an ADD_* command) a target-level dependency is created to make sure the target is built before any target using this

Re: [CMake] Question about add_custom_command

2010-09-13 Thread David Aldrich
Hi Michael set(SRCS a.c b.c d.c e.c) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/f.c COMMAND ... DEPENDS ${SRCS} COMMENT Generating f.c VERBATIM) list(APPEND SRCS ${CMAKE_BINARY_DIR}/f.c) add_executable(main ${SRCS}) Thanks - that worked nicely. Now I have another problem.

Re: [CMake] Question about add_custom_command

2010-09-13 Thread Michael Wild
On 13. Sep, 2010, at 13:03 , David Aldrich wrote: Hi Michael set(SRCS a.c b.c d.c e.c) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/f.c COMMAND ... DEPENDS ${SRCS} COMMENT Generating f.c VERBATIM) list(APPEND SRCS ${CMAKE_BINARY_DIR}/f.c) add_executable(main ${SRCS})

Re: [CMake] Question about add_custom_command

2010-09-13 Thread David Aldrich
Hi Michael You never link static libraries. They are more like zip files than actual libraries and just contain the compiled object files and for if you ran ranlib on it, also a table-of-contents to speed link up. If you do target_link_libraries in CMake, where the target is a static

Re: [CMake] Question about add_custom_command

2010-09-13 Thread Michael Wild
On 13. Sep, 2010, at 14:57 , David Aldrich wrote: Hi Michael You never link static libraries. They are more like zip files than actual libraries and just contain the compiled object files and for if you ran ranlib on it, also a table-of-contents to speed link up. If you do

Re: [CMake] Question about add_custom_command

2010-09-13 Thread David Aldrich
Hi Michael I have found that I had an 'add_executable' call left in accidentally. Sorry for wasting your time. It works well now. Thanks again for your help. BR David ___ Powered by www.kitware.com Visit other Kitware open-source projects at

Re: [CMake] Question about add_custom_command

2010-09-11 Thread Michael Hertling
On 09/10/2010 05:25 PM, Ingolf Steinbach wrote: 2010/9/10 Michael Wild them...@gmail.com: Does this also create dependencies on the multitude of header files included by the .c files in SRCS (which would probably be desired in case of the OP)? Ingolf No, it will not. But usually you have

Re: [CMake] Question about add_custom_command

2010-09-10 Thread David Aldrich
Hi Michael Thanks for your help. Please see question below. CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) PROJECT(GENDEP C) FILE(WRITE ${CMAKE_BINARY_DIR}/g.c void g(void){}\n) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_BINARY_DIR}/f.c COMMAND echo void f(void){} ${CMAKE_BINARY_DIR}/f.c

Re: [CMake] Question about add_custom_command

2010-09-10 Thread Michael Wild
On 10. Sep, 2010, at 12:38 , David Aldrich wrote: Hi Michael Thanks for your help. Please see question below. CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) PROJECT(GENDEP C) FILE(WRITE ${CMAKE_BINARY_DIR}/g.c void g(void){}\n) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_BINARY_DIR}/f.c

Re: [CMake] Question about add_custom_command

2010-09-10 Thread David Aldrich
That's great. Thanks for your patience! David -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Michael Wild Sent: 10 September 2010 12:30 To: David Aldrich Cc: cmake@cmake.org Subject: Re: [CMake] Question about add_custom_command

Re: [CMake] Question about add_custom_command

2010-09-10 Thread Ingolf Steinbach
2010/9/10 Michael Wild them...@gmail.com: set(SRCS a.c b.c d.c e.c) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/f.c  COMMAND ...  DEPENDS ${SRCS}  COMMENT Generating f.c  VERBATIM) Does this also create dependencies on the multitude of header files included by the .c files in SRCS (which

Re: [CMake] Question about add_custom_command

2010-09-10 Thread Michael Wild
On 10. Sep, 2010, at 15:16 , Ingolf Steinbach wrote: 2010/9/10 Michael Wild them...@gmail.com: set(SRCS a.c b.c d.c e.c) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/f.c COMMAND ... DEPENDS ${SRCS} COMMENT Generating f.c VERBATIM) Does this also create dependencies on the

Re: [CMake] Question about add_custom_command

2010-09-10 Thread Ingolf Steinbach
2010/9/10 Michael Wild them...@gmail.com: Does this also create dependencies on the multitude of header files included by the .c files in SRCS (which would probably be desired in case of the OP)? Ingolf No, it will not. But usually you have anyways something like: set(SRCS a.c b.c c.h d.c

[CMake] Question about add_custom_command

2010-09-09 Thread David Aldrich
Hi As mentioned before, I am replacing a manually built gnu makefile (for Linux) that builds a library, with CMake. A required build step is to run an executable called versionInfo that processes all the source files of the library and generates a new source file called SourceFileInfo.cpp.

Re: [CMake] Question about add_custom_command

2010-09-09 Thread Michael Hertling
On 09/09/2010 06:53 PM, David Aldrich wrote: Hi As mentioned before, I am replacing a manually built gnu makefile (for Linux) that builds a library, with CMake. A required build step is to run an executable called versionInfo that processes all the source files of the library and