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. Qt5 + cmake + windows, windeploy qt doesn't work.
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 2.1k 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.
  • D Offline
    D Offline
    DevAlone
    wrote on last edited by DevAlone
    #1

    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

    1 Reply Last reply
    0
    • P Offline
      P Offline
      patrik08
      wrote on last edited by patrik08
      #2

      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

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DevAlone
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          patrik08
          wrote on last edited by
          #4

          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 ..

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

            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.

            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
            2

            • Login

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