Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMediaPlayer cmake not found in Qt 6
Qt 6.11 is out! See what's new in the release blog

QMediaPlayer cmake not found in Qt 6

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lunnis
    wrote on last edited by Lunnis
    #1

    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()
    
    

    alt text

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you sure you installed Qt Multimedia ?
      Double check with the maintenance tool.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Are you sure you installed Qt Multimedia ?
        Double check with the maintenance tool.

        L Offline
        L Offline
        Lunnis
        wrote on last edited by
        #3

        @SGaist said in QMediaPlayer cmake not found in Qt 6:

        maintenance tool

        Thank you, but there is no QMediaPLayer trace in the installer/maintenance.exe programs.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          That's normal, it's a class. You need to check for the module itself.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          L 1 Reply Last reply
          0
          • SGaistS SGaist

            That's normal, it's a class. You need to check for the module itself.

            L Offline
            L Offline
            Lunnis
            wrote on last edited by
            #5

            @SGaist Thank you, digging deeper founded that I need to install the multimedia codec manually. Thanks again, please mark it as SOLVED :)

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved