[CMake] header files with visual studio

Oliver kfsone Smith osmith at playnet.com
Fri Nov 5 20:54:48 EDT 2010


Michael Jackson said the following on 11/4/2010 12:34 PM:
> Like, others have stated: You MUST include them in the add_executable 
> or add_library call. The macro I give above can help keep those files 
> organized in the Project/Solution file if you want the organization to 
> mimic the file system for instance. Otherwise CMake will create the 
> project will all the files in a single "Source" folder.
> HTH
Thanks for the detailed response, Michael :)

I guess I wasn't quite clear enough in the OP, I was really hoping it 
could be done automatically, perhaps through the dependency generator. 
Our project is fairly complex (it's a distributed client-server-server 
system with multiple distributed server processes each with their own 
project). A little over 5000 header files. And, never mind lines of 
code, there are 108,425 #include statements in our source tree.

So, the question is actually:

Is there a way to have CMake automatically add included headers to 
visual studio project files or do you need to use a dependency system to 
generate the lists by hand?

- Oliver



More information about the CMake mailing list