How to configure CLion IDE for Qt Framework? Is this IDE compatible with Qt, or are there other IDEs compatible with Qt?
I just want to try to use something else tha
As Tom Lank mentions, Qt projects can now be managed with, and built under CMake, which makes CLion happy.
Qt5's CMake manual describes how. Qt provides a lot of magic under the hood here, and it's explained much better in the CMake documentation.
One thing that isn't mentioned in the Qt CMake manual or above is that you'll also need the lines:
set(CMAKE_AUTOUIC ON) # if you have any .ui files
set(CMAKE_AUTORCC ON) # if you have any .qrc files
All of these calls to set() should probably come before the line find_package(Qt5Widgets REQUIRED). Also include any .ui or .qrc files as dependencies in the call to add_executable() along with your .cpp files.
This was initially very confusing to me from browsing the web, but you shouldn't need any calls to qt_*() or qt5_*(). These have been superseded so far as I can tell.
To test that your CMakeLists.txt actually works correctly, you can try building within Qt Creator, by loading CMakeLists.txt as a project and building.
Once confirmed, you can load the CMakeLists.txt file as a project in CLion.
Most likely, you'll need to tell CMake where to find your Qt packages with a line like this before your find_package's:
set(CMAKE_PREFIX_PATH "C:/Qt/5.9/msvc2015_64")
Finally, if you're running on / building for windows, Qt no longer comes pre-built with GCC/Mingw32 libraries. You need to build with visual studio. Luckily, CLion now supports Visual Studio experimentally and I've found it to work for Qt projects; just be sure to set the architecture (under Settings->Build, Execution, Development->CMake) to x86_amd64, in order to build in 64-bit mode and be compatible with Qt's pre-build libs.
All of this is tested with CLion 2017.1, Qt 5.9, and the Visual Studio 2015 compiler.