Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Copying config.ini from %{sourceDir} to %{buildDir} with MinGW on Windows

Copying config.ini from %{sourceDir} to %{buildDir} with MinGW on Windows

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 432 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    iodev
    wrote on last edited by iodev
    #1

    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.

    1 Reply Last reply
    0
    • J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      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/21

      here 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/2

      if you're using cmake, I can't help you, but there should be a solution as well


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bonnie
        wrote on last edited by
        #3

        You can use copy in cmd, something like

        Command : cmd
        Arguments: /c copy %{sourceDir}\config.ini %{buildDir}\config.ini
        

        If 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
        
        I 1 Reply Last reply
        3
        • B Bonnie

          You can use copy in cmd, something like

          Command : cmd
          Arguments: /c copy %{sourceDir}\config.ini %{buildDir}\config.ini
          

          If 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
          
          I Offline
          I Offline
          iodev
          wrote on last edited by
          #4

          @Bonnie I used command "cmd" and it works perfectly. Thank you so much for your help!

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved