I don't know if this is still true, but when I ran into this on my
project, trying to call ADD_LIBRARY or ADD_EXECUTABLE with only headers
caused CMake to complain that it couldn't figure out the appropriate
linker language.

My solution was to write an empty .c or .cpp file, use ADD_LIBRARY to
build a static library from it and the headers, and mark the library as
EXCLUDE_FROM_ALL so it never actually gets built.  If there's a better
way to do this I'd love to hear about it too.
-  
Gregory Peele, Jr.
Applied Research Associates, Inc.
(407) 384-2721
[email protected]


-----Original Message-----
From: Philip Lowman <[email protected]>
To: Hicham Mouline <[email protected]>
Cc: [email protected]
Subject: Re: [CMake] header-only project for VS2005
Date: Thu, 30 Apr 2009 08:23:46 -0400

On Thu, Apr 30, 2009 at 8:20 AM, Philip Lowman <[email protected]> wrote:
        On Wed, Apr 29, 2009 at 2:27 PM, Hicham Mouline
        <[email protected]> wrote:
                Hello,
                
                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.
                
                How to do?
        
        Firstly, don't use CMake 2.6.3 for this because it won't work
        (there is a bug).  Use 2.6.2 or the latest 2.6.4RC.

What I meant to say is that "intellisense" or "autocomplete" or whatever
the heck they call it will not work.  I assume this is the reason for
using the header-only project.


-- 
Philip Lowman
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to