Copy Qt4 DLL with CMake

I want to copy QtCore4.dll and QtGui4.dll to my Install / dir as a step after assembly.

In CMake, QT4 defines variables like $ {QT_DOC_DIR}, but not $ {QT_BIN_DIR}. So what I ended up doing:

add_custom_command( TARGET blahblah COMMAND ${CMAKE_COMMAND} -E copy ${QT_DOC_DIR}/../bin/QtCore4.dll ${INSTDIR} ) 

Ugly and probably only works on Windows.

Is there a variable that I don't know about? Or should I do completely differently?

Thanks!

+4
source share
1 answer

From share / cmake-2.8 / modules / FindQt4.cmake:

 # QT_BINARY_DIR Path to "bin" of Qt4 

I was not too far from QT_BIN_DIR ...

+1
source

Source: https://habr.com/ru/post/1341131/


All Articles