[Cmake] header files
Geoffrey Cross
geoff at robots.ox.ac.uk
Thu Dec 13 06:48:57 EST 2001
This is another case where the
SOURCE_FILES( wibble *.cxx )
IF( WIN32 )
SOURCE_FILES( wibble *.h )
END( WIN32 )
might be nice.
Geoff.
P.S. Wouldn't it be better just to make the unix makefile generator
create an empty rule for *.h files, rather then excluding them
deliberately?
> -----Original Message-----
> From: cmake-admin at public.kitware.com
> [mailto:cmake-admin at public.kitware.com] On Behalf Of Phil Pritchett
> Sent: Thursday, December 13, 2001 11:41 AM
> To: 'ian.m.scott at stud.man.ac.uk'
> Cc: Cmake at Public. Kitware. Com (E-mail)
> Subject: RE: [Cmake] header files
>
>
> Thanks Ian, just what I was looking for.
> Why did you decide to put the headers in a seperate file
> though ? Wouldn't
> it be better to put them in the CMakeLists.txt file and put
> the inclusion guard round the second SOURCE_FILES command ?
>
> Phil
>
> > -----Original Message-----
> > From: Ian Scott [mailto:ian.m.scott at stud.man.ac.uk]
> > Sent: Thursday, December 13, 2001 11:33 AM
> > To: Phil Pritchett
> > Cc: Cmake at Public. Kitware. Com (E-mail); Geoff Cross (E-mail)
> > Subject: RE: [Cmake] header files
> >
> >
> > Phil,
> >
> > We have done it for some things in $VXLROOT/mul, where it
> > very usefully
> > causes the identifier name, and class member completion to work.
> >
> > You can just add the .h files to SOURCE_FILES list. This does
> > the correct
> > thing under MSVC.
> > Unfortunately under Unix makefiles, this causes the make to
> attempt to
> > compile the .h files. So you simply put a guard around the
> > addition of the
> > .h files as in the following example.
> >
> > e.g. in $VXLROOT/mul/mbl/CMakeLists.txt
> >
> > > ADD_LIBRARY(mbl mbl_sources)
> > >
> > > SOURCE_FILES(mbl_sources
> > > mbl_gamma.cxx
> > > mbl_matrix_products.cxx
> > ...
> > > )
> > >
> > ...
> > >
> > > IF (WIN32)
> > > IF (NOT CYGWIN)
> > > INCLUDE( ${allvxl_SOURCE_DIR}/mul/mbl/CMakeListsHeaders.txt )
> > > ENDIF (NOT CYGWIN)
> > > ENDIF(WIN32)
> >
> > and then in $VXLROOT/mul/mbl/CMakeListsHeaders.txt
> >
> > > SOURCE_FILES(mbl_sources
> > > mbl_gamma.h
> > > mbl_matrix_products.h
> > ...
> > > )
> >
> >
> > You could of course put the contents of CMakeListsHeaders.txt
> > directly into
> > the CMakeLists.txt file.
> >
> > I guess we should extend this system to the rest of VXL -
> it has been
> > working with no problem for over a month now.
> >
> > Regards,
> > Ian
> > --------------------------------------------------------------
> > Ian Scott BT/Royal Commission Industrial Fellow
> > Dept. of Imaging Science ian.m.scott at stud.man.ac.uk
> > Stopford Building tel: +44
> > (0)161 275 7357
> > University of Manchester fax: +44 (0)161 275 5145
> > http://www.isbe.man.ac.uk/~iscott/
> >
> >
> >
> > > -----Original Message-----
> > > From: Phil Pritchett [mailto:p.pritchett at 2d3.com]
> > > Sent: Thursday, December 13, 2001 11:20 AM
> > > To: Cmake Mailing List (E-mail)
> > > Subject: [Cmake] header files
> > >
> > >
> > > Is there anything I can do in CMake so that my header
> files appear
> > > in dsp files (preferably under the Header Files folder) ?
> > >
> > > Cheers,
> > > Phil
> > >
> > > This e-mail, and any attachment, is confidential. If you have
> > > received it in error, please delete it from your system,
> do not use
> > > or disclose the information in any way, and notify me immediately.
> > > _______________________________________________
> > > Cmake mailing list
> > > Cmake at public.kitware.com
> > > http://public.kitware.com/mailman/listinfo/cmake
> > >
> >
>
> This e-mail, and any attachment, is confidential. If you have
> received it in error, please delete it from your system, do
> not use or disclose the information in any way, and notify me
> immediately. _______________________________________________
> Cmake mailing list
> Cmake at public.kitware.com
> http://public.kitware.com/mailman/listinfo/cma> ke
>
>
More information about the CMake
mailing list