[CMake] QtCreator project generator

Marcus D. Hanwell marcus.hanwell at kitware.com
Tue Mar 1 09:47:12 EST 2011


On Tue, Mar 1, 2011 at 9:15 AM, John Drescher <drescherjm at gmail.com> wrote:
> On Tue, Mar 1, 2011 at 6:45 AM, Campbell Barton <ideasman42 at gmail.com> wrote:
>> QT-Creator which currently supports CMake by reading code::blocks project files.
>>
>> The problem with this is code::blocks project files don't write in
>> #defines, so the IDE shows #ifdef's incorrecyly.
>>
>> For the short term I wrote a eclipse -> qtcreator project converter in
>> python, which has a few hard coded values but could easily be made
>> generic.
>> http://www.pasteall.org/19595/python
>>
>> So I was wondering if CMake developers would accept a patch to add
>> native generation of qtcreator project files?
>>
>> An alternative solutions could be to write defines into code::blocks
>> files, or for qtcreator to read in eclipse files instead but qtcreator
>> project files are quite simple to write so if this feature is
>> acceptable I was thinking to try and write a patch.
>
> Recent versions of QtCreator use CMakeLists.txt directly? Is there
> something missing in this functionality?
>
You can open a CMakeLists.txt as a project, this then uses the CMake
plugin to create a build directory, use the CodeBlocks - Unix
Makefiles generator and then add a CMakeLists.txt.user with some
project settings. As stated, it lacks the #defines, although this is
less pronounced in many of the projects I work on where configured
headers are used.

I am not a core CMake developer, but it seems to me that extending the
CodeBlocks generator would be the right thing to do here (if that is
feasible). I think Alexander Neundorf did a lot of this work,
hopefully he will comment.

Marcus


More information about the CMake mailing list