[solved] copying/renaming a project
-
Hi -
Before I go off and clobber anything, I thought I'd ask here: is there a guide (or cheat sheet or anything) to renaming projects and/or copying them? I want to use one project as the basis for another. This will entail modifying pathnames, names of of the finished program and so on.
I already know that I'll need to change the build directory in Projects->Build. How do I go about renaming the executable...is that done by renaming the .pro file?
Thanks.
-
bq. How do I go about renaming the executable…is that done by renaming the .pro file?
Have a look at "target":http://doc.qt.nokia.com/4.7/qmake-variable-reference.html#target
-
Oh, I don't necessarily mind using the .pro file. It's just that since it was apparently built without an entry there, I was wondering whether I could preserve the way that the executable was named. Mostly for academic curiosity.
Anyway, if I go ahead and change the .pro file, and the build directory, is that it? Or is there more that I'll need to do? There are no absolute pathnames in any of my code.
-
-
-
I recommend deleting the .pro.user file - it contains absolute paths that may clutter with the original paths of your copy.
-
If you import a project, select "shadow build" in the wizard that pops up. Creator and/or qmake will create any missing build directories.
-
-
-
OK, so maybe a recommended procedure (if it's not documented elsewhere, this might help someone later) is:
- copy the directory structure.
- delete the .pro.user file
- change the build directory in Projects->Build
- modify the name of the .pro file if desired (or edit the TARGET tag in the .pro file)
- run qmake
Did I leave anything out?
-
[quote author="mzimmers" date="1320972557"]OK, so maybe a recommended procedure (if it's not documented elsewhere, this might help someone later) is:
- copy the directory structure.
- delete the .pro.user file
- change the build directory in Projects->Build
- modify the name of the .pro file if desired (or edit the TARGET tag in the .pro file)
- run qmake
[/quote]
You could make a doc note / wiki page for that and it will be documented...
-
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"@