views:

21

answers:

2

I have a solution file that requires a third party library (open source). The containing solution uses the typical configuration names of "Debug" and "release".

The 3rd party one has debug and release configs for both DLL and static libs - their names are not "Debug" and "Release".

How do I tell the solution to build the dependency first and how do I correlate which config to the dependant config?

i.e. MyProject:Debug should build either 3rdParty:debug_shared or 3rdParty:debug_static

UPDATE:

I do not wish to correlate from one to many. I just want to be able to pick one and stick with it. So in my case I would correlate Debug in the main project to 3rdParty:shared_debug

How do I do that?

When I say build for the solution for debug I want the 3rd party stuff to build as well

+1  A: 

I do not think there is an easy way to have a single solution configuration switch between building different project configurations; if I understand correctly, you want

mySolution:debug -> myProject:debug, 3rdParty:debug_shared, ...

and at another point in time

mySolution:debug -> myProject:debug, 3rdParty:debug_static, ...

You could manually or even via macros change the build configuration for the solution each time you build but isn't that a bit tedious?

If you follow the VS way, you create extra solution configurations, and change the settings in the build Configuration Manager to have them match to the 3rd part ones.

mySolution:debug_shared -> myProject:debug, 3rdParty:debug_shared, ...
mySolution:debug_static -> myProject:debug, 3rdParty:debug_static, ...

This does not change your own project's configuration in any way, and it's relatively easy to switch between them.

edit: if your project depends on this 3rd party lib, then shouldn't it also need two configurations? Suppose your project wants to use the 3rd party static lib, then the linker needs to know it's name and path. On the other hand if you want to use the dll, the linker needs to know another name/path. How do you switch between these two without having two configurations? At some point you'll have to instruct the linker whcih lib to use, so you'll just end up with something like

mySolution:debug_shared -> myProject:debug_using_shared_3rdparty, 3rdParty:debug_shared, ...
mySolution:debug_static -> myProject:debug_using_static_3rdparty, 3rdParty:debug_static, ...
stijn
Ah, no - I just need to correlate to one of either shared or debug. THose were just used as examples. I will correct the question
Tim
I just want to know how to correlate my DEBUG tothe 3rd partyshared_debug and my release to the 3rd party shared_release
Tim
in that case, right-click on the soltion and select 'Configuration Manager'
stijn
+1  A: 

In the IDE there is "configuration manager" where you can stick project configurations with solution configurations. Also there is "build dependencies" tool to choose which project should be compiled first.

adf88
I know about the depende ncy order - not sure how to correlate with config names that are different. I will look at it. thanks
Tim
I'm not having access to VS now, I can only remember that the "configuration editor" can be access from drop-down list that you use to switch configurations (on the toolbar)
adf88
Thank you both for the answers. That was it. Not sure why I never saw that before.
Tim