[CMake] Listing header files in Visual Studio

William A. Hoffman billlist at nycap.rr.com
Tue Jan 18 08:33:37 EST 2005


At 07:55 AM 1/18/2005, Brad King wrote:
>E. Wing wrote:
>>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?
>
>As far as I know this is not supported as a feature, but there may be ways to do it.  One easy way is just to add a library with a dummy source file and then list all the headers.  As long as nothing links to it it shouldn't affect anything.  There might also be a way using ADD_CUSTOM_TARGET, but I don't know off the top of my head how it might work.

Another thing you can do is just add the header files to any one of the other libraries
using full paths with the project source variable, then use a source group to put
them in a different folder in the IDE.  Pretty much what would happen if you were
doing it from the IDE.

-Bill



More information about the CMake mailing list