[CMake] Interresting dependency problem

Félix C. Morency felix.morency at gmail.com
Thu Sep 27 09:33:16 EDT 2007


Hi,

Thank you for anwsering so fast.

>> 1. What solution do you think is the best: "A main master script" that
>> knows every dependencies of every projects VS "Completly indenpendant
build
>> script" that we could simply include if we need them and their
dependencies
>> ? Please justify.

> If these are independent solutions, then there is no real choice. If there
is
> such one, then they are not really independent and you could use the
simplest
> approach of a master script.

Actually, I would like to be able to build "A" and "B" independantly. If I
decide to build "B", then "B" and only "B" is built. If I decide to build
"A", then "B" and "A" are built. This is the actual definition of
"independance".

>> 2. How can I achieve the first solution with CMake ? (Is it possible ?)

> You can let cmake write another cmake script with SET statements that you
> include in yet another cmake script.

It sounds like a big "configuration" file. But how could this solve the
src/file1.cpp problem ? Do you have any little practical example ?

>> 3: Is there any better solution that I don't see ?

> Yes.

> Every solution comes down to a classic common thing: a development kit for
C
> (used by B) and B (used by A).
> An automatically written cmake script is one solution (somewhat limiting
the
> dependent build environments to cmake) or something else like pkgconfig,
or
> shell scripts that set environment variables, or whatever. Very much
depends
> on the target audience and personal preferences.

Could you please elaborate on "an automatically written cmake script". I
would like to know more about it and how it can be acheived. The use of
pkgconfig is prohibited, just like shell scripts and env. variables. The
solution has to be as portable as it can be (win32, linux, macosx, etc.)

Thank you again,
Félix C. Morency

------------------------------

Message: 3
Date: Thu, 27 Sep 2007 04:26:32 +0200
From: Hendrik Sattler <post at hendrik-sattler.de>
Subject: Re: [CMake] Interresting dependency problem
To: cmake at cmake.org
Message-ID: <200709270426.32513.post at hendrik-sattler.de>
Content-Type: text/plain;  charset="utf-8"

Am Donnerstag 27 September 2007 schrieb Félix C. Morency:
> 1. What solution do you think is the best: "A main master script" that
> knows every dependencies of every projects VS "Completly indenpendant
build
> script" that we could simply include if we need them and their
dependencies
> ? Please justify.

If these are independent solutions, then there is no real choice. If there
is
such one, then they are not really independent and you could use the
simplest
approach of a master script.

> 2. How can I achieve the first solution with CMake ? (Is it possible ?)

You can let cmake write another cmake script with SET statements that you
include in yet another cmake script.

> 3: Is there any better solution that I don't see ?

Yes.

Every solution comes down to a classic common thing: a development kit for C
(used by B) and B (used by A).
An automatically written cmake script is one solution (somewhat limiting the
dependent build environments to cmake) or something else like pkgconfig, or
shell scripts that set environment variables, or whatever. Very much depends
on the target audience and personal preferences.

HS


------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070927/ccf22df3/attachment.html


More information about the CMake mailing list