Important: Please read the Qt Code of Conduct -

QtCreator and CMake

  • I have a cmake project that is using qt libraries. The project builds just fine. When I open it in QtCreator I would expect it to show project files in Projects pane. Instead it only shows CMakeLists.txt file just under my project name. The .cbp file in build directory exists and contains references to my files. However, it doesn't seem to be used in any way by QtCreator.
    Should the files be shown in Projects pane? If so, how do I make it work?

  • It should show the project ,perfectly!

    When you open the cmakelists.txt , creator must ask you to run cmake first right. Check if cmake runs successfully.

  • It does ask, I select nmake vc 9.0 generator, I don't give any additional arguments, cmake runs and does not show any errors. Still the only file under my project name is CMakeLists.txt file. Maybe the CMakeLists.txt file needs to be written in some specific way to be picked up by QtCreator? Or maybe Qt has some log to be looked into? BTW, this is a dll project (qt designer plugin) and I'm using QtCreator 2.3.0 (same happens with 2.1.0).

  • May be you haven't selected the "Project View", i think you have selected the "class view " or so..

  • I moved my project to a different location and it started to work. Maybe QtCreator has problems with spaces in paths?

  • Yes, There are issues with spaces.. See project issues in "here":

  • Hi,

    I'm encountering the same problem. When i try to open a Cmake projet (on Qt 4.7) with qt-creator 2.3 (on Qt 4.8), it only shows CMakeLists.txt file. Paths or file names don't contain spaces or special characters.

    Is there any other explanation ?


  • Sorry for the bump, but since this shows up in Google as a first result for "qt creator cmake shows only cmakelists.txt", figured I'd reply directly.

    The solution to this is likely that the Qt Creator kit cmake properties aren't correctly set up to generate a Codeblocks project file. This could happen if you install Qt Creator before installing CMake.

    To fix, go to Tools -> Options -> Build & Run -> Kits -> Pick whatever you're using -> Set "CMake Generator" to "CodeBlocks - Unix Makefiles".

Log in to reply