My question probably boils down to "what is the module called".
I'd like to use the QSound class in Qt 5.4 and apparently the "Qt5Multimedia" module is not pulled in alongside QtGui and QtCore when calling
find_package(Qt5Widgets REQUIRED)
So I browse my Qt 5.4 installation (locally on Debian) and in fact find a directory
~/sw/Qt/Qt_5_4/5.4/gcc_64/lib/cmake/Qt5Multimedia
However, naively adding
find_package(Qt5Multimedia REQUIRED)
to my CMakeLists.txt fails with this paraphrasis of "File not found error.":
By not providing "FindQt5Multimedia.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"Qt5Multimedia", but CMake did not find one.
So, within said directory, I ask ls -1 and actually get more than I wanted:
Qt5Multimedia_CameraBinServicePlugin.cmake
Qt5MultimediaConfig.cmake
Qt5MultimediaConfigVersion.cmake
Qt5Multimedia_QAlsaPlugin.cmake
Qt5Multimedia_QGstreamerAudioDecoderServicePlugin.cmake
Qt5Multimedia_QGstreamerCaptureServicePlugin.cmake
Qt5Multimedia_QGstreamerPlayerServicePlugin.cmake
Qt5Multimedia_QM3uPlaylistPlugin.cmake
Qt5Multimedia_QPulseAudioPlugin.cmake
Could any of you tell me, which to take, if any, in order to being able to use the QSound class to play some .wav files?
Converting my comment into this answer to close this question:
CMake needs to know where the Qt5 specific files are located.
Therefore you should add ~/sw/Qt/Qt_5_4/5.4/gcc_64/
either to the environment variable $CMAKE_PREFIX_PATH
or set it using
set(CMAKE_PREFIX_PATH "~/sw/Qt/Qt_5_4/5.4/gcc_64/")
Then CMake will be able to perform find_package(Qt5Multimedia)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With