Author Topic: Shared properties  (Read 5011 times)

Offline MrDoomMaster

  • Multiple posting newcomer
  • *
  • Posts: 10
Shared properties
« on: September 23, 2008, 09:39:25 pm »
Hi,

My current workspace setup in C::B consists of around 20 projects. Each project represents a "component" in my application. Since I have 20 projects, I do not want to have to cumbersomely duplicate common settings between each.

Coming from Visual Studio, one feature I fine extremely useful are Property Sheets. I realize C::B is not trying to be like Visual Studio- I also want to establish that I'm not asking it to be like Visual Studio. I simply am wondering if there is a way to share options between projects in a workspace. Here is a list of a couple of things I might want to share:

  • Include directories
  • Library directories
  • Warning level
  • Preprocessor definitions
  • Many others...
Thanks for reading.

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Shared properties
« Reply #1 on: September 23, 2008, 09:48:36 pm »
Hi !

Did you try to modify compiler settings (Settings->Compiler and debugger) ?
Be careful ! Doing this, all your future projects using this compiler will "benefit" from the changes !

Dje

Offline MrDoomMaster

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Shared properties
« Reply #2 on: September 23, 2008, 09:49:48 pm »
Hi !

Did you try to modify compiler settings (Settings->Compiler and debugger) ?
Be careful ! Doing this, all your future projects using this compiler will "benefit" from the changes !

Dje

Thanks for your response!

I was actually looking for these settings to *only* be shared between projects in this workspace only. I do not want future (other) workspaces' projects to inherit these properties.

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Shared properties
« Reply #3 on: September 23, 2008, 09:53:02 pm »
Do you know a project can have many targets ?

Is it possible for you to have one project with 20 targets instead of 1 workspace and 20 projects ?
That way, you can apply project settings to all your targets.

Dje

Offline MrDoomMaster

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Shared properties
« Reply #4 on: September 23, 2008, 09:53:53 pm »
Do you know a project can have many targets ?

Is it possible for you to have one project with 20 targets instead of 1 workspace and 20 projects ?
That way, you can apply project settings to all your targets.

Dje

Can the targets have targets? If I make each project a target, it will need to have "Debug", and "Release" targets. This is just getting silly now :P

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Shared properties
« Reply #5 on: September 23, 2008, 09:58:11 pm »
You can (un)check the project options debub check box, define an environment variable or create a debug and a release project or create debug and release versions of each target. Does any solution fit approximatively your need ?

Dje

Offline MrDoomMaster

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Shared properties
« Reply #6 on: September 23, 2008, 10:01:09 pm »
You listed at least 3 solutions I see, but I am not very familiar with C::B so I'm going to have to research them before I can say they solve my problem. From the sounds of things, though, it all seems very "hacky" and unintuitive.

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Shared properties
« Reply #7 on: September 23, 2008, 10:08:26 pm »
Not really, C::B introduce the target notion that does not exist in Visual studio.

In VS, workspaces contains projects that contains files, with an output/project.
In C::B, targets appears below project level and defines an output generated from a project files set.
It can be very useful, just have a look at codeblocks.cbp to be convinced.

Projects settings are applied to all targets, that way, you can check debug option at target level and it will be applied to all target.
Quite logical but new compared to VS approach.

Dje

Offline MrDoomMaster

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Shared properties
« Reply #8 on: September 23, 2008, 10:14:11 pm »
Using targets instead of projects *is* very intuitive. So, I could have the following:

Code
Workspace
 - MyProject
   + Component1
   + Component2
   + Component3
   + Component4

This setup is okay for me. I can modify project settings for "MyProject" and all of my Component# targets would inherit those settings. However, my concern at this point are having "debug" and "release" for each of my targets. For example, I would expect the hierarchy to look like this:

Code
Workspace
 - MyProject
   + Component1
      + Debug
      + Release
   + Component2
      + Debug
      + Release
   + Component3
      + Debug
      + Release
   + Component4
      + Debug
      + Release

But in order to do this I need to be able to have targets inside of targets. According to my understanding, there can only be 1 project in the workspace or else I end up duplicating common settings.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Shared properties
« Reply #9 on: September 24, 2008, 09:32:28 am »
Hi,

My current workspace setup in C::B consists of around 20 projects. Each project represents a "component" in my application. Since I have 20 projects, I do not want to have to cumbersomely duplicate common settings between each.

Coming from Visual Studio, one feature I fine extremely useful are Property Sheets. I realize C::B is not trying to be like Visual Studio- I also want to establish that I'm not asking it to be like Visual Studio. I simply am wondering if there is a way to share options between projects in a workspace. Here is a list of a couple of things I might want to share:

  • Include directories
  • Library directories
  • Warning level
  • Preprocessor definitions
  • Many others...
Thanks for reading.

Read this.
Be patient!
This bug will be fixed soon...