c++ - How to get the target directory in PRO file -


i building application in debug mode, how target directory in pro file. didnt explicitly mentioned target directory using "destdir"

    core_api_path = $$pwd/../bin     separator = "/"      qt       += core gui xml widgets printsupport svg      greaterthan(qt_major_version, 4): qt += widgets      target = cinemas     template = app      rc_icons += cinemas-icon.ico      qthavemodule(opengl) {         defines += qt_opengl_support         qt += opengl     }      libs += -lqt5concurrent -lglu32 -lopengl32 -lglut32 -lc:\qt\qt5.3.2\tools\mingw482_32\i686-w64-mingw32\lib\glut -lc:\qt\qt5.3.2\tools\mingw482_32\i686-w64-mingw32\lib\glu32       win32:config(release, debug|release): libs += "$$quote($${core_api_path}/release/coreapi.dll)"     else:win32:config(debug, debug|release):  libs += "$$quote($${core_api_path}/debug/coreapid.dll)"      win32:config(release, debug|release): libs += -l$$pwd/ssh/lib/ -lssh2     else:win32:config(debug, debug|release): libs += -l$$pwd/ssh/lib/ -lssh2     else:unix: libs += -l$$pwd/ssh/lib/ -lssh2      win32:config(release, debug|release): libs += -l$$pwd/3rdparty/qwt/lib/ -lqwt     else:win32:config(debug, debug|release): libs += -l$$pwd/3rdparty/qwt/lib/ -lqwtd     else:unix: libs += -l$$pwd/qwt/lib/ -libqwt       qt += concurrent network      config += c++11      resources += \         cinemasresource.qrc      forms += \ 

i want copy app.exe current folder other folder

on windows can use dlldestdir variable specifies copy target dll or exe. add .pro :

config(release, debug|release): dlldestdir +=  $$pwd/../exec 

on linux can use qmake_post_link variable contains command execute after linking target together. like:

config(release, debug|release): qmake_post_link += $$quote(cp project $$pwd/../exec) 

here project name of target file provide target = project

these copy executable binary directory named exec 1 level upper program working directory. can have arbitrary path.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -