[CMake] Re: IDE directly supporting CMakeLists.txt?

Alexander Neundorf a.neundorf-work at gmx.net
Wed Feb 7 02:58:39 EST 2007


Von: "wedekind" <wedekind at caesar.de>

...
> But this is not exactly what I want. I'm looking for an IDE that
> supports the CMakeLists.txt such that it interprets them and translates
> them into a GUI-dialog for build configuration. Maybe an example will
> clarify the reason behind it:
> 
> Say you are working with CMake-generated VisualStudio project files. If
> you
> want to add a file, you cannot use the IDE for it. I.e. you cannot
> drag-and-drop it on your IDE or add it via a context dialog. You need to
> add
> the new file to your CMakeLists.txt and this change will be realized in
> the IDE the next time you build (and reload) your project.
> 
> You can do that with a little discipline, but there is of course a
> source of
> error (and little annoyance) if you cannot use the IDE as usual with
> CMake-generated build-files. It would be really cool, if you could make
> changes to the build config with your IDE and they are reflected in the
> CMakeLists.txt. At best the IDE would be cross-platform ;)

As Bill mentioned, the KDevelop team is working in this direction for KDevelop 4. It's not sure yet how the results of this will look in the end.

Personally I'm not sure it is actually a good idea to try to do this.
I see two options:
-use cmake "behind the back" for building and don't let the user see any cmake stuff at all, so he can't edit the file manually (and break them). This should be quite simple, good enough for small projects.

-try to parse the cmake files and turn this into a GUI. I'm not sure this is really possible. E.g. if you want to link to libjpeg with CMake. with cmake you should do:

find_package(JPEG REQUIRED)
...
target_link_libraries(foo ${JPEG_LIBS})

How to put that in a GUI where the user doesn't have to know anything about CMake ?
If the user shouldn't have to know cmake syntax, you could:
-let him select the library via a file dialog -> unportable cmake files
-let him enter "jpeg" or "-ljpeg" directly in a line edit -> unportable
-let him find out about the available cmake modules for libraries and use what they provide. But in this case he has to know about cmake and then IMHO hiding some thing isn't a good idea. 
It will also get very complicated if the cmake files are advanced, containing e.g. if()s, execute_process(), match regexps and deal with the results etc. I don't know how to put that into a GUI which would be easier to handle than the plain cmake script. I also think if an IDE would try to do this, it should be able to handle 100% of all cmake files, otherwise the user won't trust it (at least I wouldn't).

After all, the developer is able to write C++ software with thousands lines of code, so he should be able to manage to write a 50 lines cmake script.

Bye
Alex

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the CMake mailing list