User forums > Using Code::Blocks

Workspace Variables

(1/1)

AndyJ:
Does CodeBlocks support variables defined as part of the workspace? From what I've seen so far I can define global variables (part of the application such as #wx) or project variables (compiler defines etc), but not ones that apply to all projects within a particular workspace.

One reason for wanting this is that I have embedded applications that comprise the same set of projects, but are targeted at different platforms and it would be great to just be able to have a different workspace for each platform which does something equivalent to adding -DBUILDFORPLATFORMX to all the projects within the workspace.

Thanks for any help,

Andy

stahta01:
Have you looked at targets?
Because there is no workspace wide MACRO defines.

Tim S.

AndyJ:

--- Quote from: stahta01 on November 24, 2009, 04:14:14 pm ---Have you looked at targets?

--- End quote ---

I have, but it doesn't seem like it will do the same thing. I might be misunderstanding, but if I use targets then I will have to create a new target for every possible combination in every project. As I have workspaces containing 10+ different projects and a similar number of potential targets (treating debug/release versions as 2), most of which are very similar apart from a few global defines it seems like a very messy solution.

Of course I could be completely missing the obvious....

Thanks for the help,

Andy

stahta01:
You could also; just create a project that just creates an header file that is used by all the other projects; this is the way many non Code::Blocks based projects are done.

Tim S.

AndyJ:

--- Quote from: stahta01 on November 24, 2009, 05:19:55 pm ---You could also; just create a project that just creates an header file that is used by all the other projects

--- End quote ---

That seems like an interesting approach - I'll investigate further.

Thanks for the idea!

Andy

Navigation

[0] Message Index

Go to full version