Author Topic: Multiple Self Contained Libraries  (Read 3234 times)

Offline rioki

  • Multiple posting newcomer
  • *
  • Posts: 13
Multiple Self Contained Libraries
« on: December 15, 2010, 01:55:15 pm »
Hi, this is a bit a tricky question and probably can't be really solved.

I have multiple libraries, each library has a project and is mostly self contained. There are some dependencies between the libraries but that is solved by using compiler variables. Each libraries lives in it's own git repository and it is intended to develop them mostly on their own.

I now want to create a "suite" that contains many libraries. To do that I would create a git repository with submodules that merge the different repos into one big one. (If you don't know what I am talking about, think I copied the folders all together.) I would then create one workspace that contains all the projects. By adding project dependencies I fix the build order, what is really nice. But here is my actual problem, in this case I want the libraries to link from the recently built libraries. To do that I have to change the include and lib path to point to the relative path, BUT I still want each library to be buildable on it's own.

Any ideas how I can solve this duality?

One idea I have is to have both relative and compiler variable path in the include and lib path and hope it turns out well. But I can imagine many ways how this could break. There must be a more elegant solution, like employment a build script, but I can't wrap my mind around it.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Multiple Self Contained Libraries
« Reply #1 on: December 15, 2010, 02:58:17 pm »
You can add another target for every library project used only when building as a suite.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline rioki

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Multiple Self Contained Libraries
« Reply #2 on: December 20, 2010, 02:41:39 pm »
You can add another target for every library project used only when building as a suite.

That is an option. But I am honestly evaluating if it is a really good idea. Since the libraries should be version compatible at all time...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Multiple Self Contained Libraries
« Reply #3 on: December 20, 2010, 03:34:06 pm »
Do you know about Global Variables? If not, look them up.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Multiple Self Contained Libraries
« Reply #4 on: December 20, 2010, 05:45:34 pm »
You can add another target for every library project used only when building as a suite.

That is an option. But I am honestly evaluating if it is a really good idea. Since the libraries should be version compatible at all time...

Multiple targets can have the same sources, so there should not be a compatibility problem.