Qt 6.11 is out! See what's new in the release
blog
QMediaPlayer cmake not found in Qt 6
-
QMediaPlayer cmake not found in Qt 6
cmake_minimum_required(VERSION 3.5) project(main VERSION 0.1 LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) find_package(Qt6 REQUIRED COMPONENTS Multimedia) set(PROJECT_SOURCES mainwindow.cpp mainwindow.h mainwindow.ui ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) qt_add_executable(main MANUAL_FINALIZATION ${PROJECT_SOURCES} ) else() if(ANDROID) add_library(main SHARED ${PROJECT_SOURCES} ) else() add_executable(main ${PROJECT_SOURCES} ) endif() endif() target_link_libraries(main PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) target_link_libraries(main PRIVATE Qt6::Multimedia) set_target_properties(main PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE ) install(TARGETS main BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) if(QT_VERSION_MAJOR EQUAL 6) qt_finalize_executable(main) endif()
-
Hi and welcome to devnet,
Are you sure you installed Qt Multimedia ?
Double check with the maintenance tool. -
Hi and welcome to devnet,
Are you sure you installed Qt Multimedia ?
Double check with the maintenance tool. -
That's normal, it's a class. You need to check for the module itself.
-
You can mark the thread as solved yourself :-)
You can use the "Topic Tools" button or the three dotted menu beside the answer you deem correct.