0
votes

I create empty C++ project in QT Creator using cmake. After some menus where I choose "cmake" as a building tool I see a project hierarchy:

- MyTestCMake2
    - CMakeLists.txt

(New Project -> Non-Qt Project -> Plain C++ Application -> checked CMake for building system)

And that's all! It's strange but QTCreator opens main.cpp with some C++ code but QTCreator tells me that this file does not a part of my project. I try to add main.cpp manually to MyTestCMake2 project but I can't do it. It's disabled.

CMakeLists.txt content is:

cmake_minimum_required(VERSION 2.8)
project(MyTestCMake2)
add_executable(${PROJECT_NAME} "main.cpp")

I try to run cmake with: Build -> Run CMake but nothing happens. What's wrong? Why QTCreator doesn't work with CMake properly?

My env is:

cmake: 3.9.1
Qt Creator: 4.3.1 (Qt: 5.9.1)
Mac OS Sierra 10.12.5

SOLVED I've upgraded Qt Creator to 4.4 and it worked out of the box! I did the same steps as before but now it works without any problems! What a magic.

1
I have experienced that only Console applications work. What kind of project are you creating and which version of Qt, CMake?Jens Munk
A simple test case works for me on Fedora 26 with QtCreator and CMake installed. I did: "New Project", "Non-Qt Project", "Plain C++ Application", and "CMake" under Build System.Alexander Huszagh
@JensMunk, cmake: 3.9.1, Qt Creator: 4.3.1, Qt: 5.9.1, Mac OS Sierra 10.12.5JavaRunner

1 Answers

0
votes

I've upgraded Qt Creator to 4.4 and it worked out of the box! I did the same steps as before but now it works without any problems! What a magic.