R
R
Roffor2017-07-22 00:10:28
Qt
Roffor, 2017-07-22 00:10:28

How to properly connect Qt to CLion?

Hi all!
I decided to sit down for an IDE editor and my choice fell on CLion. This is my first such editor and I could not figure out how to connect qt to cmake.
A quick search on the Internet gave me the following solution: https://toster.ru/q/305621 (I stupidly copy the above code)
But the compiler says:
CMake Error at CMakeLists.txt:12 (find_package):
By not providing "FindQt5Widgets.cmake " in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.

Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:

Qt5WidgetsConfig.cmake
qt5widgets-config.cmake

Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
"Qt5Widgets_DIR" to a directory containing one of the above files. If
"Qt5Widgets" provides a separate development package or SDK, be sure it has
been installed.

Unfortunately, I don't understand what I'm doing wrong. I would be grateful for chewing or a link to a detailed article.
Ps Worth ubuntu, qt downloaded from https://www.qt.io/download-open-source/#section-2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2017-07-27
@Skapix

Cmake does not see the qt you installed, or rather the QWidgets module (which is part of qt). The question is how did you install it.
Guide for installing more or less fresh Qt on Ubuntu: https://wiki.qt.io/Install_Qt_5_on_Ubuntu
In general, it is better to install the qt5-default package through the packet manager

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question