Qt3D: Using Qt3DExtras Module in Qt C++ with Cmake.
-
Hi,
I am working on a Qt application using Qt C++ and Qt3D. I am using Cmake to build my project. I want to use Qt3DExtras module but it is showing the error in the line contained in my CMakeLists.txt :find_package(Qt REQUIRED COMPONENTS 3DCore 3DInput 3DExtras)
:Could not find a package configuration file provided by "Qt53DExtras" with any of the following names: Qt53DExtrasConfig.cmake qt53dextras-config.cmake Add the installation prefix of "Qt53DExtras" to CMAKE_PREFIX_PATH or set "Qt53DExtras_DIR" to a directory containing one of the above files. If "Qt53DExtras" provides a separate development package or SDK, be sure it has been installed. my_project/CMakeLists.txt:36 (find_package)
I am using Qt 5.10.1 on Ubuntu 16.04.
Thanks. -
Hi and welcome to devnet,
How did you install Qt ?
Did you check the content of thelib/cmake
folder ins your Qt installation ? -
Then how are you calling cmake to build your project ?
-
I am following the Qt5 docs for building with CMake: https://doc.qt.io/archives/qt-5.10/cmake-manual.html.
All the other modules are loading fine(3DCore,3DRenderer,etc.), but the 3DExtras Module is giving errors. -
I found the problem: The linux environment variable path was set to the default Qt directory with missing modules. Despite changing the Qt's path from QtCreator, it was still accessing from the old Qt directory. I set the path in CMakeLists.txt by:
set(Qt5Core_DIR "/usr/local/Qt-5.10.1/lib/cmake/Qt5Core") set(Qt5_DIR "/usr/local/Qt-5.10.1/lib/cmake/Qt5") set(QT_QMAKE_EXECUTABLE "/usr/local/Qt-5.10.1/bin/qmake")