Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
653 views
in Technique[技术] by (71.8m points)

c++ - Xcopy files to the new directory in pro/pri file

how can I copy the entire directory with the contents to new path using pro file. I tried "xcopy /S /I /Y" but its not working. Can someone point the error I am doing

    BINARY_DESTINATION_PATH = $$PWD$$SEPARATOR/dd/
    RESOURCE_SOURCE_PATH = $$PWD$$SEPARATOR/temp

    EXPORTED_DESTINATION_PATH = $${BINARY_DESTINATION_PATH}
    EXPORTED_DESTINATION_PATH ~= s,/,\,g

    EXPORTED_SOURCE_PATH = $${RESOURCE_SOURCE_PATH}
    EXPORTED_SOURCE_PATH ~= s,/,\,g

    QT += core
    QT -= gui

    CONFIG += c++11

    TARGET = sample
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp

    win32 {
        QMAKE_POST_LINK += $$quote(cmd /c xcopy /S /I /Y $${EXPORTED_SOURCE_PATH}\copy_to_output $${EXPORTED_DESTINATION_PATH})
    }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I think you looking for Qt deploy.

Deploying Qt Applications: Deploying an Qt application does not require any C++ programming. All you need to do is to build Qt and your application in release mode, following the procedures described in this documentation.

More info for deploy app in windows here.

The Windows Deployment Tool: The Windows deployment tool is designed to automate the process of creating a deployable folder containing the Qt-related dependencies (libraries, QML imports, plugins, and translations) required to run the application from that folder.

Also check my answer about Windeploy: https://stackoverflow.com/a/45531369/5068056

I explain it completely with screenshots.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...