@Archie888 said in Need help with .pro file, copy files at build:
@Paul-Colby
Thanks for the tip to the right direction, very helpful!!
The .qrc was a mistake, meant .pro, sorry.
QMAKE_SUBSTITUTES seems like an interesting cross-platform way to copy files to the build destination from project, and it worked, thanks. However, having to have the .in extension creates issues, having to create a copy automatically with .in and so on, which I can do, but it's not very elegant. But I will definitely keep that in mind.
As I checked into the issue again, I now finally got QMAKE_SUBSTITUTES working to run the .bat file, but it needs to be like this:
QMAKE_POST_LINK += $$PWD/my_batch_file.bat
Unlike with OTHER_FILES, it needs the $$PWD/ as the starting point.
Also, no cmd window is opened unlike I was expecting. The execution will be part of the Qt build process, and any echo ouput in your .bat file is shown in the Compile Output tab.
However, now I am running into problems with getting access denied with copying with the .bat, so I will have to look into this issue later.
Here is the .bat again, which is giving the :
@echo off
setlocal
set BUILD_DIR=%1
set SOURCE_DIR=%~dp0A8NodeAssistant
echo Copying A8NodeAssistant folder from %SOURCE_DIR% to %BUILD_DIR%...
xcopy /s /e /y %SOURCE_DIR% %BUILD_DIR%\
pause
Any help appreciated of course what the mystery could be, if someone has info at the tip of the fingers, but I'll get into this later again myself.
Cheers!
(I might have to implement the nasty .in file generator in the end, LOL!)
Typo on the line:
"As I checked into the issue again, I now finally got QMAKE_SUBSTITUTES working to run the .bat file, but it needs to be like this:"
Meant:
"As I checked into the issue again, I now finally got QMAKE_POST_LINK working to run the .bat file, but it needs to be like this:"
It seems that the time period to edit comments here has been decreased.