23

I'm trying to import my Cmake project in QtCreator, which I'd want to use as code editor, but with completition for Qt classes an the possibility to do the build via Ctrl+R

When importing the Cmake project, the QtCreator ide hangs when running CMakeWizard when I try to select RunCmake. If I cancel an empty windows pops up and the project is not generated.

Is it possible to import an existing cmake project in QtCreator?

Ubuntu 10.10 x86_64, QtCreator 2.6

linello
  • 8,451
  • 18
  • 63
  • 109

2 Answers2

32

Normally you just do "Open Project" and then select the CMakeLists.txt as the project file. QtCreator will then ask you to run CMake once (to generate a CodeBlocks build file, which is then interpreted by QtCreator). After that you have native support for your CMake project.

It even works with rather complicated CMake scripts. If you observe hangs etc., you should probably file a bug report with the QtCreator project.

ypnos
  • 50,202
  • 14
  • 95
  • 141
  • 1
    yes, probably I have to file a bug to the qtcreator project...thanks! – linello Dec 04 '12 at 09:18
  • 4
    can you link to the bug report? I am having the same issue. – andrewrk Jan 26 '14 at 02:16
  • 1
    The same problem here. My qtCreator just crashes every time I try to open CMakeLists.txt created by qtCreator last time a few minutes ago. – JavaRunner Sep 29 '17 at 19:59
  • 3
    You need to remove the `CMakeLists.txt.user` file in case you have moved the project to a different location after creation. – qed Apr 22 '19 at 11:19
1

I had a similar issue when qtcreator crashed when opening cmake projects created in older versions of qtcreator. Removing CMakeLists.txt.user and running qt from terminal resolved issue for me.

cd /path/to/project/
qtcreator .
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Nick Kashkin
  • 35
  • 2
  • 9