[CMake] Listing header files in Visual Studio

E. Wing ewmailing at gmail.com
Tue Jan 18 07:44:52 EST 2005


I have a minor problem with getting some header files displaying in
Visual Studio. Everything builds so it's not critical, but has been a
minor annoyance so we're seeking a cosmetic solution.

My CMake build system has separated each subdirectory in my source
tree to be built as a separate library using ADD_LIBRARY and listing
all the files (including headers  in each directory. This has
generally worked well for us except for one case.

It turns out that one of the subdirectories contains only header files
which are C++ templates. In this case, I can't use ADD_LIBRARY since
there are no implementation files to make a library. Thus, I cannot
use this mechanism to list all my header files in this directory.

My Visual Studio users are complaining because they would like to see
these files in the IDE.  Is there an easy way I can get CMake to
create a "figure-head" project for this directoty that displays the
header files inside?

Thanks,
Eric


More information about the CMake mailing list