[CMake] header files with visual studio

Eric Noulard eric.noulard at gmail.com
Sat Nov 6 07:20:40 EDT 2010


2010/11/6 Pedro d'Aquino <budsbd at gmail.com>:
> On Friday, November 5, 2010, Oliver kfsone Smith <osmith at playnet.com>
>>
>> Thanks for the detailed response, Michael :)
>>
>> 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?
>
> Can't you just include "*.h" "*.hpp"? I find it scales much better
> that listing each file.

Initially it may be a pain to list them but after a while its generally better
to manually keep track of file (dis)appearing in your source tree.
(which is usually what you do when using an IDE without CMake)

I.e. if those files are/were added "by hand" into the build system then they
must but tracked by explicit list in CMakeLists.txt.

The only case (I see) you may faithfully glob for *.h *.whatever is when
those are generated files.

Not doing that means

"I don't care about source file which are added/removed
 I just want to compile those"

**MY** opinion is that this way of looking to source code is wrong.

That said I fully understand that the to CMake transition may be painful when
the project is big.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list