Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [solved] copying/renaming a project
Forum Updated to NodeBB v4.3 + New Features

[solved] copying/renaming a project

Scheduled Pinned Locked Moved Qt Creator and other tools
18 Posts 4 Posters 23.9k Views 1 Watching
  • 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #7

    Thanks, Volker. So...if I rename the .pro file, and change the entry for the build directory, am I covered?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #8

      That should basically work, yes.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #9

        OK, thanks, guys.

        1 Reply Last reply
        0
        • mzimmersM Offline
          mzimmersM Offline
          mzimmers
          wrote on last edited by
          #10

          Actually, two follow-up questions:

          1. am I correct in assuming I should rename the .pro.user file, too?
          2. what's the best way to get Creator to make me a build directory? Or will this happen for me automatically, like when I create a new project?

          Thanks.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #11
            1. I recommend deleting the .pro.user file - it contains absolute paths that may clutter with the original paths of your copy.

            2. If you import a project, select "shadow build" in the wizard that pops up. Creator and/or qmake will create any missing build directories.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • mzimmersM Offline
              mzimmersM Offline
              mzimmers
              wrote on last edited by
              #12

              Regarding #2...I just copied the entire project file structure. Should I not have done that? I can't import that way.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #13

                Oh, no problem with that. I do that regularly :-) Just make sure to not re-use the .pro.user file. If you open the .pro files in Creator the project wizards start over. This ensures that your paths are not messed up with the old project (original copy).

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply
                0
                • mzimmersM Offline
                  mzimmersM Offline
                  mzimmers
                  wrote on last edited by
                  #14

                  OK, so maybe a recommended procedure (if it's not documented elsewhere, this might help someone later) is:

                  1. copy the directory structure.
                  2. delete the .pro.user file
                  3. change the build directory in Projects->Build
                  4. modify the name of the .pro file if desired (or edit the TARGET tag in the .pro file)
                  5. run qmake

                  Did I leave anything out?

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #15

                    Sounds good to me.

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply
                    0
                    • mzimmersM Offline
                      mzimmersM Offline
                      mzimmers
                      wrote on last edited by
                      #16

                      Excellent...thanks again.

                      1 Reply Last reply
                      0
                      • EddyE Offline
                        EddyE Offline
                        Eddy
                        wrote on last edited by
                        #17

                        [quote author="mzimmers" date="1320972557"]OK, so maybe a recommended procedure (if it's not documented elsewhere, this might help someone later) is:

                        1. copy the directory structure.
                        2. delete the .pro.user file
                        3. change the build directory in Projects->Build
                        4. modify the name of the .pro file if desired (or edit the TARGET tag in the .pro file)
                        5. run qmake

                        [/quote]

                        You could make a doc note / wiki page for that and it will be documented...

                        Qt Certified Specialist
                        www.edalsolutions.be

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          seaworthy
                          wrote on last edited by
                          #18

                          Run this script in the folder where your project is located. It will fix rename the files and change their contents accordingly.

                          @#!/bin/bash
                          echo "old: $1", "new: $2"

                          rename "s/$1/$2/" *
                          cd $2
                          rename "s/$1/$2/" *
                          find $NEW -type f -exec sed -i "s/$1/$2/g" {} ;

                          echo "Done"@

                          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