Re: [CMake] Question about ADD_CUSTOM_COMMAND

2011-02-13 Thread Carminati Federico
Dear Michael, Thanks a lot! I upgraded cmake to the git "next" version and indeed it works now. Best regards, Federico Carminati CERN-PH 1211 Geneva 23 Switzerland Tel: +41 22 76 74959 Fax: +41 22 76 68505 Mobile: +41 76 487 4843 On 13 Feb 2011, at 05:34, Michael Hertling wrote: > On 02

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 t

[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 executab

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 http:

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

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 sta

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

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 anoth

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 : >>> 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 Ingolf Steinbach
2010/9/10 Michael Wild : >> 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 e.c

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 : >> 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 multi

Re: [CMake] Question about add_custom_command

2010-09-10 Thread Ingolf Steinbach
2010/9/10 Michael Wild : > 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 would pr

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

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_BIN

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_BINAR

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

[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. Th