Copying config.ini from %{sourceDir} to %{buildDir} with MinGW on Windows
-
Hi,
I would like to copy a file (config.ini) from %{sourceDir} to %{buildDir} with MinGW on Windows and I don't know how to do this on Windows with MinGW. On Linux I just needed to add a "Custom process step" using "cp" command like this:
Command : cp Arguments: %{sourceDir}/config.ini %{buildDir}/config.ini Working directory: %{buildDir}On Windows with MinGW "cp" command is not valid. If anyone has an idea about how to do something like this on Windows I would be very pleased. Thank you very much for your attention.
-
here's one way, not quite what you had in mind but should work
https://forum.qt.io/topic/130098/save-values-to-a-config-file/21here is an other one, pretty much on point, on what you're asking:
https://forum.qt.io/topic/17415/qmake-copy-files-in-target-directory/2if you're using cmake, I can't help you, but there should be a solution as well
-
You can use copy in cmd, something like
Command : cmd Arguments: /c copy %{sourceDir}\config.ini %{buildDir}\config.iniIf you have cmake installed on all platforms, then you can write like this as a cross-platform solution
Command : cmake Arguments: -E copy %{sourceDir}/config.ini %{buildDir}/config.ini -
You can use copy in cmd, something like
Command : cmd Arguments: /c copy %{sourceDir}\config.ini %{buildDir}\config.iniIf you have cmake installed on all platforms, then you can write like this as a cross-platform solution
Command : cmake Arguments: -E copy %{sourceDir}/config.ini %{buildDir}/config.ini