Author Topic: Virtual Targets at the Workspace Level  (Read 6440 times)

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Virtual Targets at the Workspace Level
« on: July 26, 2007, 06:01:49 pm »
I have a Workspace that contains several projects.  I'd like to define a virtual target that includes a specific target from each of the projects.  I would then like to execute a post build process to archive everything in to a zip file.  Basically re-create a 'make dist' type scenario.

Is this possible?

mariocup

  • Guest
Re: Virtual Targets at the Workspace Level
« Reply #1 on: July 26, 2007, 08:48:34 pm »
Hi ironhead,

in the manual of Codeblocks http://www.codeblocks.org/manual.shtml you find a small example how to build virtual target and how to zip project files e.g.

zip -j9 $(PROJECT_NAME)_$(TODAY).zip src h obj $(PROJECT_NAME).cbp

You can have a virtual target 'All' that includes the build target default (see codeblocks.workspace). If all projects contain the virtual target 'All' and you select build workspace then all projects/targets will be built. Add a post build step with cb variables (see example above) or attach a script to a built target.


Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: Virtual Targets at the Workspace Level
« Reply #2 on: July 26, 2007, 10:24:03 pm »
That works for an individual project, but I have a workspace that contains 8 projects.  I'd like to create a Virtual Target that contains build targets from all 8 projects.  Is this possible?

mariocup

  • Guest
Re: Virtual Targets at the Workspace Level
« Reply #3 on: July 27, 2007, 09:31:04 am »
Well there a  two possibilities in CB to something like that (or perhaps I do not understand what you want to do):

1) Dependencies: In a workspace you may have so called dependencies. For example project 1 depends on project 2, project 3 etc. then building that project will build all project with their dependencies. The last project of the dependency could zip all projects.
2) All 8 projects contain the same build target All. Then building the workspace (not the project) will build all project with the corresponding target.

Is that what you are thinking about?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: Virtual Targets at the Workspace Level
« Reply #4 on: July 27, 2007, 03:47:33 pm »
I'd like to create a Virtual Target that contains build targets from all 8 projects.  Is this possible?
1..n projects contain a (virtual) target called "subset" (for example). Then C::B will offer at workspace level to compile this very target "subset". Select the "subset" target from the choicebox, hit "compile workspace". C::B will warn you if there are projects *not* containing this (virtual) target. Those who contain such a target will be compiled (this target of the project will be compiled to be precise). Notice the target must not neccesarily be virtual for that purpose. "Virtual" means a set of 1..n targets within a project.
So yes, C::B can handle such.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ