[CMake] Bug? Broken header files in Visual C++ 2008 project

Alexander Neundorf a.neundorf-work at gmx.net
Wed Sep 3 11:52:02 EDT 2008


On Thursday 28 August 2008, Andreas Pakulat wrote:
> On 28.08.08 10:16:48, BRM wrote:
...
> IMHO the approach to regenerate project description files for an IDE
> from a buildsystem tool is simply broken. 

Well, it has to. Otherwise the project file become wrong. That's not a big 
problem for the makefile-based project generators (KDevelop, Eclipse, 
CodeBlocks), but a real one for XCode and MSVC.

> A buildsystem will never
> support all the things in a more complex IDE, so you either stick to
> what it generates and never change the result 

Yes. Ideally IDEs would have their "settings" so separated into files that 
settings which don't actually change the build (like maybe indentation style, 
or VCS integration or tab width etc.) are in a file separate from another 
file which contains the settings which actually change the build (compiler 
flags etc.)

> or you change the settings
> here and there but then you can't have CMake re-generate the project
> files.
>
> > This is probably what has kept me from using KDevelop3 as much too - I
> > tend towards using CMake to generate Makefiles under Linux b/c it's
> > easier to get to things than trying to find a source file with the header
> > in KDevelop3 

What do you mean wit "trying to find a source file with the header" ?

> > since I can't (by CMake's functionality) add headers to the
> > project.

So if you do 
add_executable(foo foo.c foo.h)
foo.h is ignored and doesn't appear in the list of project files ?

> KDevelop3 doesn't need that information at all, or rather it completely
> ignores the CMake files anyway. 

Which files do you mean with "the CMake files" ?

> The generator for KDevelop3 projects in CMake is ok if you want to get an
> initial project status, but after that you shouldn't use it anymore. 

Why ?

> > Any
> > how...I think the differentiation (clarity) provided by the
> > ADD_HEADER() proposed above would be good and helpful to a lot of
> > others than just myself.

You could do 
set_source_files_properties( foo.h bar.h 
                             PROPERTIES  XYZ_THIS_KIND_OF_HEADER TRUE)

and then some IDE project generator could check this special source file 
property and do something according to it.
Currently none of the generators does that.

Alex


More information about the CMake mailing list