Calvin1602
Calvin1602

Reputation: 9547

Copy Qt4's DLLs with CMake

I want to copy QtCore4.dll and QtGui4.dll in my Install/ dir as a post-build step.

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

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

Ugly, and problably only works on Windows.

Is there a variable I'm not aware of ? Or should I do completely another way ?

Thanks !

Upvotes: 4

Views: 1967

Answers (1)

Calvin1602
Calvin1602

Reputation: 9547

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

#  QT_BINARY_DIR               Path to "bin" of Qt4

I wasn't too far away with QT_BIN_DIR...

Upvotes: 1

Related Questions