[CMake] header files with visual studio

Oliver kfsone Smith osmith at playnet.com
Tue Nov 9 18:30:27 EST 2010


Michael Hertling said the following on 11/6/2010 7:39 AM:
> stored in the ${CMAKE_BINARY_DIR}/filelist.dat script as an assignment
> to the variable FILELIST. Subsequently, this filelist.dat is read via
> INCLUDE(), so CMake keeps track of it, i.e. changing the filelist.dat
> results in a rebuild. Finally, the filelist custom target regenerates
> filelist.dat by executing filelist.cmake. Hence, each time the set of
> *.c files in CMAKE_SOURCE_DIR changes, a "make filelist" will update
> filelist.dat, and the following "make" will rebuild - taking into
> account the refreshed list of source files. Maybe, this approach
> can be adapted to platforms other than *nix and large projects.
I already have the source files split up into their myriad sub-projects, 
all I really want is to tap into the dependency generator to get a list 
of header files pertinent to any given project.

In particular, this is useful for performing search operations.

Remember: Visual Studio allows you to constrain multi-file searches a 
number of ways, one of which is "Just this project".

When you have thousands of header files, having every header in your 
codebase arbitrarily crammed into your project file means that every 
project-only search is going to return too many results.




More information about the CMake mailing list