News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Multiple Self Contained Libraries

Started by rioki, December 15, 2010, 01:55:15 PM

Previous topic - Next topic

rioki

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.

oBFusCATed

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!]

rioki

Quote from: oBFusCATed on December 15, 2010, 02:58:17 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...

stahta01

Do you know about Global Variables? If not, look them up.

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

Jenna

Quote from: rioki on December 20, 2010, 02:41:39 PM
Quote from: oBFusCATed on December 15, 2010, 02:58:17 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.