[CMake] Creating projects with no source files?

Robert Dailey rcdailey at gmail.com
Sun Jan 18 00:48:42 EST 2009


Hi,

I have a sort of interesting project design that I'm using that is really
the source of this complication. Let me start by explaining my project
structure.

I have a set of reusable C++ libraries, each library can be thought of as a
component. The structure is very easy to grasp:

my_components/
  component1/
  component2/
  component3/

Each component is its own project in CMake. Most components have both H and
CPP files, but they aren't required to have CPP files. I notice in CMake
that you cannot call add_library() if no CPP files have been added. I need
this to work since I still want my header files to show up in visual studio
so I can edit them. Note that I'm currently creating visual studio targets,
so my needs might be special case to that generator.

Suppose component2 (above) has only header files in it. Is there any way I
could get these files to show up in the visual studio projects/solutions so
I can view them/edit them? A good idea would be to create a solution folder
instead of a visual studio project for CMake projects that only have header
files when add_executable() or add_library() is called.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090117/8c286e41/attachment.htm>


More information about the CMake mailing list