[CMake] header-only project for VS2005

Hicham Mouline hicham at mouline.org
Wed Apr 29 15:33:56 EDT 2009


> -----Original Message-----
> From: Tyler Roscoe [mailto:tyler at cryptio.net]
> Sent: 29 April 2009 19:50
> To: Hicham Mouline
> Cc: cmake at cmake.org
> Subject: Re: [CMake] header-only project for VS2005
> 
> On Wed, Apr 29, 2009 at 07:27:05PM +0100, Hicham Mouline wrote:
> > I use cmake to generate a VS2005 solution as well as linux/g++
> makefiles.
> > I have a directory containing headers only and subdirs also with
> headers
> > only,
> > However I wish to display 1 project for that directory, and filters 1
> for
> > each of the subdirs.
> > There is nothing to build for that dir, but I wish to show it in
> VS2005.
> 
> I believe that if you add the list of headers to your add_library() or
> add_executable() (do you have those commands for these projects? what
> do your header-only projects actually do?), they will show up as header
> files in VS.

The thing is, this is the dir structure for e.g.

Lib1 (library with source files)
+ cmakelists.txt
+
Lib2 (header only, contains template functions, no source files)
+
+
 
If I add the headers to Lib1' cmakelists.txt, the headers will appear under
that project Lib1
They reside under directory lib2 and I wish to see them under project
"Lib2", which not built

I am playing with ADD_CUSTOM_TARGET as we speak,

> Note that there is a bug in CMake 2.6.3 related to headers in VS. If
> you're using that version, you might want to check if that bug applies
> to your situation.
> 
> tyler
Using cmake 2.6.4 rc1 which fixes that, so we're fine.
Besides the bug was just a visual bug showing headers excluded from build in
vs2005,
no problems.

thanks



More information about the CMake mailing list