[Cmake] RE: header files in .dsps

Bitter, Ingmar (NIH/CC/DRD) IBitter at cc.nih.gov
Tue Apr 1 13:37:41 EST 2003


Thanks for the info.
Actually, as I found out, 
SET (SRC_TABLE foo.cpp foo.h bar.cpp bar.h)
Will not work, as the header files are looked for relative from the main
directory (not the library subdir).   Hence, it should be 
SET (SRC_TABLE foo.cpp subdir/foo.h bar.cpp subdir/bar.h)
This works but does not look very intuitive.
In addition I would like to not have to list any filename explicitly.

-Ingmar

-----Original Message-----
From: hvanderpool at xn-tech.com [mailto:hvanderpool at xn-tech.com] 
Sent: Tuesday, April 01, 2003 11:22 AM
To: cmake at public.kitware.com; IBitter at cc.nih.gov
Subject: Re: header files in .dsps

Hello all.  I've been enjoying getting to know CMake for the last couple of
weeks.  It is a terrific tool.
Perhaps I can help on this question and save the gurus some work..

Your code snippet, Ingmar was
AUX_SOURCE_DIRECTORY(../t_base SRC_TBASE )
ADD_LIBRARY (tbase       STATIC ${SRC_TBASE} )

I believe that AUX_SOURCE_DIRECTORY only adds .cpp and .c files to the list
variable SRC_TBASE.
Since I wanted the header files included in the .dsp for easy access
through VC60, I added them explicitly with:

SET (SRC_TABLE foo.cpp foo.h bar.cpp bar.h)

Kind of a nuisance but it works, perhaps there is an easier way.

I'm sure you could also do the following now that I see the typing that can
be saved.

AUX_SOURCE_DIRECTORY(../t_base SRC_TBASE )
SET (SRC_TBASE "${SRC_TBASE} foo.h bar.h")






More information about the CMake mailing list