Author Topic: One workspace; two projects  (Read 4741 times)

trafalgrar

  • Guest
One workspace; two projects
« on: October 26, 2007, 07:53:09 pm »
Hi!
I'd like to have a workspace with two projects. The first one should be a static library [ using C++ language ]. The second should be a normal console application which links the library from the first project. How to prepare such hierarchy? It would be nice if compilation of the second project will be starting a build process of the first one.

mariocup

  • Guest
Re: One workspace; two projects
« Reply #1 on: October 26, 2007, 10:55:30 pm »
Hi trafalgrar,

in CB you can define so called project dependencies in a workspace. So save the projects in a workspace and then go to the project properties and choose project dependencies. This will sove your problem.

trafalgrar

  • Guest
Re: One workspace; two projects
« Reply #2 on: October 26, 2007, 11:41:06 pm »
Project dependencies work good. But what about saving the workspace? When I choose "save workspace" what file extensions should I use? *.cbp doesn't work.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: One workspace; two projects
« Reply #3 on: October 26, 2007, 11:50:28 pm »
*.workspace

trafalgrar

  • Guest
Re: One workspace; two projects
« Reply #4 on: October 28, 2007, 11:39:32 am »
It seems projects dependencies doesn't work as they are supposed to. For example - Project2 depends on Project1. If I change something in Project1 while Project2 is already built then nothing is going to happen [ CB says everything is up to date ]. I have to build Project1 manually and after that rebuild Project2. It's annoying. How to make it work.

mariocup

  • Guest
Re: One workspace; two projects
« Reply #5 on: October 28, 2007, 06:46:20 pm »
Can you attach a small example?

trafalgrar

  • Guest
Re: One workspace; two projects
« Reply #6 on: October 28, 2007, 07:48:34 pm »
Sure, check an attachment for example workspace.

If I modify main.cpp in the DEP_LIB and if I want to have a new library to be compiled into the DEP_APP, I have to either rebuild the the DEP_APP or rebuild DEP_LIB first and then DEP_APP. In MSVC for example such dependencies work that I need to build [ not rebuild! ] only DEP_APP [ IDE checks all dependant projects if they are up to date ]. CB seems it doesn't check this properly.

[attachment deleted by admin]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: One workspace; two projects
« Reply #7 on: October 28, 2007, 10:46:06 pm »
last week I had a minor chat with the Don about this, I was gonna experiment with this, since waht I recall was that there were issues, and I think this is an important one to solve, will make CB a real build system then and will be very good for usability since CB then does what most users will expect from it.

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: One workspace; two projects
« Reply #8 on: November 02, 2007, 10:39:12 am »
To me and for the workspace you uploaded, that works with the expected behaviour.
 I mean before building DEP_APP (modified or not) CB will first look if DEP_LIB is up_to_date, and compile it if it's not.
Config for that : WIN XP SP2, CB (svn 4564), gcc compiler


But i remember having this problem sometimes in the past too.
windows XP SP2
mingw gcc 3.4.5
svn Code::Blocks and M$ Visual Studio 2005 and .NET to eat!! SVNInside plugin :http://forums.codeblocks.org/index.php/topic,7063.0.html