Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QtMultimedia Cmake



  • Hello, I wrote some months ago about a problem with qtCreator and Ros plugin the QtMultimedia library. Most of you invited me to install also Qt to solve this problem. I did it but same problem. I am using cmake and i cannot stil find a way to include qMultimedia library. Any suggestion? thank you all



  • I solved it!

    i need to add the path where to find the package so I add in my cmake

    set(CMAKE_PREFIX_PATH "/opt/5.12.4/gcc_64/lib/cmake/")
    
    find_package(Qt5Multimedia) #then the package
    
    include_directories(
        ${Qt5Core_INCLUDE_DIRS}
        ${Qt5Gui_INCLUDE_DIRS}
        ${Qt5Widgets_INCLUDE_DIRS}
        ${Qt5PrintSupport_INCLUDE_DIRS}
        ${Qt5Sql_INCLUDE_DIRS}
        ${Qt5Multimedia_INCLUDE_DIRS}  #the directories 
    
    
    
    
    
        )
    
    
    

    and that's all!
    thanks
    cheers


  • Lifetime Qt Champion

    @AliM93 You can avoid hard coding the prefix file if you provide it as parameter when calling cmake:

    cmake -DCMAKE_PREFIX_PATH=/opt/5.12.4/gcc_64/lib/cmake/ ...
    


  • where i have to write it?


  • Lifetime Qt Champion

    @AliM93 When you call cmake. If you use QtCreator you should be able to set such variables.


Log in to reply