Change build target in visual studio 2012

Get answers to all your basic programming questions. No Ogre questions, please!
Post Reply
royibernthal
Halfling
Posts: 41
Joined: Fri Feb 08, 2013 8:16 pm

Change build target in visual studio 2012

Post by royibernthal »

How do I change the build target in visual studio 2012?

The tutorial asks me to do that and I have no idea how:
http://www.ogre3d.org/tikiwiki/tiki-ind ... Tutorial+2

When I build a solution doesn't it just build everything in it?
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: Change build target in visual studio 2012

Post by spacegaier »

I assume the wiki page refers to the build output (so change the naming settings for the resulting EXE name to not overwrite the one from the previous tutorial), but I might be wrong here.
royibernthal wrote:When I build a solution doesn't it just build everything in it?
Not necessarily. You might have a solution with multiple projects in it and you can specify dependences between them and then depending on which projects you build, only some will be taken into account as needed. But in the specific case of the tutorials: Only those files that are included in your main file will be compiled, so if you have 5 files: main.cpp (with your main-method) and 2 x 2 tutorial files (header and source each for tutorial A and tutorial B) and you include only the header of tutorial A in your main.cpp, then I think tutorial B would not get compiled at all, since it is not reference/included.
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
royibernthal
Halfling
Posts: 41
Joined: Fri Feb 08, 2013 8:16 pm

Re: Change build target in visual studio 2012

Post by royibernthal »

I don't really have a main.cpp. or perhaps I have one and don't know where to look?

Do you think the tutorial wants me to create a new project for each part?
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Change build target in visual studio 2012

Post by Transporter »

royibernthal wrote:Do you think the tutorial wants me to create a new project for each part?
Yes, and with different names not to overwrite the previous one.

If you only like to prevent the overwriteing, you can go to the General properties and change the Target Name for each tutorial.
royibernthal
Halfling
Posts: 41
Joined: Fri Feb 08, 2013 8:16 pm

Re: Change build target in visual studio 2012

Post by royibernthal »

Change the target name to a class name in General Properties?

Is there a way to duplicate a project with all of its settings? Creating a new project and changing the settings all over again every tutorial is not very comfortable.
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Change build target in visual studio 2012

Post by Transporter »

royibernthal wrote:Change the target name to a class name in General Properties?
Whatever you want! This property is for the output.
royibernthal wrote:Is there a way to duplicate a project with all of its settings? Creating a new project and changing the settings all over again every tutorial is not very comfortable.
Copy the project folder to a new location. Open the project copy and
Transporter wrote:go to the General properties and change the Target Name for each tutorial.
royibernthal
Halfling
Posts: 41
Joined: Fri Feb 08, 2013 8:16 pm

Re: Change build target in visual studio 2012

Post by royibernthal »

I think I understand (correct me if I'm wrong), I'm not really concerned about building over existing builds since I'm still at a learning phase.

Do you mean copying the project in Windows Explorer? Looks like I'll have to rename many stuff.

I don't see a right click -> copy inside visual studio.
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Change build target in visual studio 2012

Post by Transporter »

royibernthal wrote:Do you mean copying the project in Windows Explorer? Looks like I'll have to rename many stuff.

I don't see a right click -> copy inside visual studio.
Are you making fun of me?
  1. Open the windows explorer
  2. Navigate to the folder of your tutorial project
  3. Go one directory up
  4. Make a copy of the folder with you tutorial project
  5. Rename the copy of your first tutorial folder
  6. Open the Visual Studio Solution
  7. Right click on the project in SolutionExplorer
  8. Choose Properties
  9. Click on General in left tree
  10. Change the Target Name property on the right side
  11. Close the dialog by clicking on ok
royibernthal
Halfling
Posts: 41
Joined: Fri Feb 08, 2013 8:16 pm

Re: Change build target in visual studio 2012

Post by royibernthal »

I did just that then thought you wanted me to rename the newer folder instead of the older folder (meaning its files as well), that way indeed makes more sense.

As for the Target Name, is it to avoid building over previous tutorial builds? If so it should be fine for me to leave it the same if I don't mind that happening right?
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Change build target in visual studio 2012

Post by Transporter »

royibernthal wrote:As for the Target Name, is it to avoid building over previous tutorial builds? If so it should be fine for me to leave it the same if I don't mind that happening right?
The Target Name property sets the file name for the output file, so if you change it you have different output files. A second solution is renameing the project in Visual Studio because the Target Name consists of the project name.
royibernthal
Halfling
Posts: 41
Joined: Fri Feb 08, 2013 8:16 pm

Re: Change build target in visual studio 2012

Post by royibernthal »

Okay got it. Thanks again you helped alot.
Post Reply