A few years later, but the question still matters. I had the same problem when you wanted to insert rclone .
In the .pro file add
# From http://stackoverflow.com/a/37561981 defineReplace(copyToDir) { files = $$1 DIR = $$2 LINK = for(FILE, files) { LINK += $$QMAKE_COPY $$shell_path($$FILE) $$shell_path($$DIR) $$escape_expand(\\n\\t) } return($$LINK) } defineReplace(copyToBuilddir) { return($$copyToDir($$1, $$OUT_PWD)) }
Please note that for each platform there are slight differences, but in general the approach is the same.
qmake will copy these files to the target directory, and they will be available, just calling the process in the local relative directory.
In the following code, I call the executable from QML, and it will also be very similar to C ++:
var rcloneCommand if (Qt.platform.os === "windows") { console.log("Windows") rcloneCommand = "rclone.exe" } else { console.log("OSX/Linux") rcloneCommand = "./rclone" } qProcess.start(rcloneCommand, ["--config", "rclone.conf", "-v", "copy", "--stats", "1s", source, destination]);
source share