Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake file cannot locate Qt charts module

I'm trying to start writing my Qt project inside JetBrains' Clion but I need to link some libraries in my Cmake file first. There's no problem when trying to find packages like Qt5Core, Qt5Widgets, Qt5Gui but when it come to finding Qt5Charts an error is thrown:

By not providing "FindQt5Charts.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Charts", but CMake did not find one.

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

Qt5ChartsConfig.cmake
qt5charts-config.cmake

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

This is my CMake file right now.

All packages are installed via the Qt's Linux(ubuntu) maintanence tool. Any ideas how to help Cmake find the Charts module ?


1 Answers

Using the following and see if it helps:

sudo apt install libqt5charts5-dev

Src: https://stackoverflow.com/a/46765025

like image 123
Mehrshad Zandigohar Avatar answered Sep 08 '25 20:09

Mehrshad Zandigohar