|
-
May 9th, 2013, 08:20 AM
#1
Thread Starter
Addicted Member
VS2010. Conditional Build. Two versions of same program in one solution ?
I didn't see a forum area specifically about configuring visual studio. So here goes.
I've got a program but now I want to make two versions of it. Lets call them 'Home' and 'Pro' where the Home simply has some features disabled based on the value of a boolean const or variable.
To do it manually I'd change the value of the boolean. Change the output exe name and build. Then change the bool again, change the output name and build. I've now got two different programs.
But is there some way to automate that so I just hit the button to build and VS does that for me ?
Sorry if this is the wrong area (I'm sure the mods will move it) and I'm also sorry if I didn't explain very well - I'm sure you know what I mean though.
Thanks
Ax
-
May 9th, 2013, 08:32 AM
#2
Re: VS2010. Conditional Build. Two versions of same program in one solution ?
You know how you can select Debug or Release for the build? Those are two different configurations and the output for each one goes into a different folder. You can open the Configuration Manager and create additional configurations if you so desire. From the Compile page of the project properties, you can add custom compilation constants for certain configurations and then use those constants in your code to include and exclude certain code based on the current configuration. When it's time to build, you select one configuration and build, then select another configuration and build again. Go to the bin folder and get the two separate outputs from the two separate subfolders.
-
May 9th, 2013, 08:58 AM
#3
Thread Starter
Addicted Member
Re: VS2010. Conditional Build. Two versions of same program in one solution ?
 Originally Posted by jmcilhinney
You know how you can select Debug or Release for the build? Those are two different configurations and the output for each one goes into a different folder. You can open the Configuration Manager and create additional configurations if you so desire. From the Compile page of the project properties, you can add custom compilation constants for certain configurations and then use those constants in your code to include and exclude certain code based on the current configuration. When it's time to build, you select one configuration and build, then select another configuration and build again. Go to the bin folder and get the two separate outputs from the two separate subfolders.
Wow, it's that simple ? I feel silly for asking the question. 
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|