Qt5 + cmake + windows, windeploy qt doesn't work.



  • I have the following CMakeLists.txt file:

    cmake_minimum_required(VERSION 3.1)
    
    project(Flamingo)
    
    set (CMAKE_CXX_STANDARD 14)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_AUTORCC ON)
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    
    set(CMAKE_CXX_FLAGS_RELEASE "-O3")
    
    
    find_package(Qt5Widgets)
    find_package(Qt5Sql)
    find_package(Qt5Multimedia)
    find_package(Qt5MultimediaWidgets)
    
    
    include_directories(".")
    
    file(GLOB_RECURSE Flamingo_SRC
        "*.h"
        "*.cpp"
        "*.hpp"
    )
    
    add_executable(${PROJECT_NAME} ${Flamingo_SRC} "res/main.qrc")
    
    target_link_libraries(${PROJECT_NAME} -lpthread)
    
    target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
    target_link_libraries(${PROJECT_NAME} Qt5::Sql)
    target_link_libraries(${PROJECT_NAME} Qt5::Multimedia)
    target_link_libraries(${PROJECT_NAME} Qt5::MultimediaWidgets)
    

    I use the latest version(5.9.1) of Qt from official site and MSVC compiler. Everything is compiled, but windeployqt.exe generates about 100Mb of files with files like opengl32sw.dll, but without necessary files like Qt5Sql.dll.
    What's wrong? Is my cmake config incorrect?

    UPD: with qmake this project works, but I still want to know why this doesn't work with cmake



  • I use qt5_use_modules ...
    qt5_use_modules(${PROJECT_NAME} Core Concurrent Widgets)
    and its go perfect... each componet ...
    i have only not understand how to make mac bundle...
    for test i can live app like linux on mac .. one binary
    console ./app & go..
    http://doc.qt.io/qt-5/cmake-manual.html



  • @patrik08, documentation says that qt5_use_modules needs to use with CMake older than 2.8.11, but I use 3.9.1. I'll try it when I return to windows, but I am not sure that it's going to work.



  • Oh sorry i not see all... the last time who i use window & MinGW compiler was 9 years a go... first steeps on QT... now my box support only mac or linux...
    qmake -t vc : logical on mac...
    WARNING: Unable to generate output for: /Makefile [TEMPLATE vc] this is out ..


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    The QtMultimedia module uses OpenGL so that normal. It's however surprising that the QtSql module is not properly deployed. Just in case, you can pass it as argument to windeployqt in order for it to be manually installed.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.