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.

set(A_HDRS A/one.h A/two.h A/three.h)
source_group(A FILES ${A_HDRS})
add_executable(HeaderFiles dummy.c ${A_HDRS} EXCLUDE_FROM_ALL)

If that works successfully, you can use the file(GLOB..) command to
determine A_HDRS without listing every header file and then add B_HDRS,
C_HDRS, etc. as needed.

Obviously for dummy.c just use:

int main() { return 0; }

-- 
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

Reply via email to