[Cmake] using make clean

David Svoboda xsvobod2 at informatics . muni . cz
Wed, 26 Nov 2003 17:42:32 +0100


On Wed, 26 Nov 2003, Brad King wrote:

> On Wed, 26 Nov 2003, David Svoboda wrote:
>
> > I have to following problem. I created a new custom command (as below) and
> > therefore a new set of *.hh files was created from *.idl files. These *.hh
> > files are used as header files in the next step. But I don't know, how to
> > delete these *.hh files with "make clean" command. Is there any reasonable
> > way?
> >
> >    ADD_CUSTOM_COMMAND(
> >       OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${FNAME}.hh
> >       DEPENDS ${IDL_FILE}
> >       COMMAND ${IDL_PROGRAM}
> >       ARGS -bcxx ${IDL_FILE}
> >       )
>
> I've just added a FAQ entry for this issue:
>
> http://www . cmake . org/cgi-bin/cmakefaq . cgi?req=all#5 . 8
>
> -Brad

Well, if I understood correctly, it is better to create i.e. the following
directory tree:

/myproject - my project direcotry
/myproject/src - here, the source files are stored
/myproject/src/linux-gcc3.0 - here the binaries and objs for spec.
compiler or platform are stored

And therefore the source fiels are left untouched. Object files and all
the others are stored in anoter directory - in this case in
"linux-gcc-3.0".

Therefore I would like to move the "CMakeLists.txt" file to the
"/myproject/src/linux-gcc3.0" directory. But now, I have got a question -
how to tell the cmake to read my the source files from the upper
- here "/myproject/src" directory?

I do not want to list all the source files from that directory - only some
of them. And I do not want to type SET(SOURCES ../file1 ../file2 ../file3
...) everywhere - I'd prefer something like:

USE_SOURCE_DIRECTORY(..)
SET(SOURCES file1 file2 file3 ...)


David