c++ - Automatic Copy of Dependent Files in Qt Creator -
i've build program using qt creator 2.2.1 , qt 4.7.4 (32 bit) output executable. opening exe using dependencywalker shows exe uses following dlls:
- kernel32.dll
- msvcrt.dll
- mingwm10.dll
- libgcc_s_dw2-1.dll
- qtcore4.dll
- qtgui4.dll
i want after build dependent files (which may different in other project) except windows specific files (the first 2 in above list) automatically copied in directory exe located.
how can in qt creator or qt system without using command line scripting? thanks.
in qt 5.3, may able use windeployqt
qt tool automatically copy needed libraries.
the following additions project's .pro file should trick, might have make adjustments based on particular situation.
isempty(target_ext) { win32 { target_custom_ext = .exe } macx { target_custom_ext = .app } } else { target_custom_ext = $${target_ext} } win32 { deploy_command = windeployqt } macx { deploy_command = macdeployqt } config( debug, debug|release ) { # debug deploy_target = $$shell_quote($$shell_path($${out_pwd}/debug/$${target}$${target_custom_ext})) } else { # release deploy_target = $$shell_quote($$shell_path($${out_pwd}/release/$${target}$${target_custom_ext})) } # # uncomment following line debug deploy command when running qmake # warning($${deploy_command} $${deploy_target}) # use += instead of = if use multiple qmake_post_links qmake_post_link = $${deploy_command} $${deploy_target}
Comments
Post a Comment