Qt5 - CMake, find ICU and ANGLE libraries

  • Hi,

    This is more of a CMake question, But I feel that it can be answered only by Qt guys than CMake guys. if this is not the right place, I am extremely sorry.

    I am using Qt 5.3 (Angle on Windows) with CMake 2.8.12. Qt 5.3 has dependencies on ICU and ANGLE libs. I wish to copy these dlls to the build directory. Is there any CMake variable that holds name of ICU and ANGLE libs?

    To copy other Qt libraries I am using the following sample code fragment-


    Here BUILD_TYPE can be Debug or Release

    If it is not possible to get the lib names, I wish to get the Qt bin dir path. Is any variable holding this value? I could find Qt5_DIR, but not a variable pointing to the bin directory.

    Is it possible for me to get the path to the "platforms" plugin-directory-path using CMake?


  • Hi Loyd,
    I'm just adding this here, because I'm searching for something similar - When working with cmake, qt and VS it's not possible to run the built application unless the appropriate qt-dlls are copied to the executable output folder or setting your PATH or "Executable Directories" in VS. I would appreciate to get some hints or links if someone knows an easy way to to achieve this, even if just hacked together. Neither the "CMake docs":http://www.cmake.org/cmake/help/v3.1/manual/cmake-qt.7.html nor the "qt docs":http://doc.qt.io/qt-5/cmake-manual.html contain any information about that.
    target_link_libraries(helloworld Qt5::Widgets)
    create_runtime(helloworld) # <- analyze target and copy all dependent dlls

    A simple cmake function that copies all dependent dlls (e.g. as post build step) into the executable output folder would be very helpful.

  • Seems like I've found something. The "windeployqt.exe":http://doc.qt.io/qt-5/windows-deployment.html#the-windows-deployment-tool
    does exactly what I want. :)

Log in to reply

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