[CMake] Need some directions for non-trivial setup

Marcel Loose loose at astron.nl
Tue Dec 7 03:35:44 EST 2010


Hi Klaim,

I would try to start with just one (base-)project, try to get
everything in place and building the way you want it. If you're new to
CMake, that's really the way to go. Once you have this base-project
ready, you can think of starting a second project, using the
base-project as EXTERNAL_PROJECT(), etc. 

Good luck.
Marcel Loose.

>>> On 6-12-2010 at 21:46, in message
<AANLkTimmVBBX-BQ1kceAhsxd=pkZ-AagKBsJ5dsCUv-z at mail.gmail.com>, Klaim
<mjklaim at gmail.com> wrote: 
>> 
>>
>> It's a bit clearer to me  now ;-)
>> Reading between the lines I get the feeling that you're probably
better
>> off using just a single project anyway.
>> A developer doesn't need to continuously update the whole project
when
>> working on his subproject. Building the whole thing once in his
working
>> copy should suffice.
>>
>> Most of those projects (and future related projects) are not
> interdependent. I had a repository with everything inside before
(using
> MSVC10 projects files) but it don't suit the developpement as each
project
> really need a separate repository with separate history and separate
teams
> working on it. I know I could use branches but that would make things
harder
> when managing the different projects separately.
> 
> They have to be separate. That's not a question to me anymore.
> 
> 
>> Personally, I have not yet gained any experience with
>> EXTERNAL_PROJECT(), so I cannot really help you there. If your
>> subsystems are *really* stand-alone pieces of software, then you
should
>> create different CMake projects for them. However, like I said, I
get
>> the feeling that that's not the case in your situation.
>>
> 
> It is this very case. I need them to be separate projects, sometime
linked
> because sometime you need some dependencies and maybe those
dependencies are
> in the same "family of projects" or something. Those dependencies
might be
> from outside too, but those projects have to be isolated.
> 
> 
>>
>> You might consider to use multiple PROJECT() commands inside your
>> source tree. It will make your life slightly easier when you later
>> decide you do want to split things up.
>>
> 
> That's already what I do. Well that's what's i'm trying but until now
I
> can't find a way to say to CMake where are the other projects. I
think I'm
> misusing EXTERNAL_PROJECT() but I'm not sure how.
> I'll get back on this issue in the week, see if I can make
> EXTERNAL_PROJECT() work as I need. I really think I don't have all
the
> pieces of the puzzle. I'm reading the other thread about how to make
> libraries works correctly with CMake and I think I don't know a lot
about
> what's really required.
> 
> Anyway, thanks for your help.
> 
> 
>>>> On 3-12-2010 at 13:13, in message
>> 
>
<AANLkTimfWeyEJP+MAQKZcg-7a92beBvxhGO0BXRLjP9x at mail.gmail.com<AANLkTimfWeyEJP%2
> BMAQKZcg-7a92beBvxhGO0BXRLjP9x at mail.gmail.com>>,
>> Klaim
>> <mjklaim at gmail.com> wrote:
>> > Thanks for pointing EXTERNAL_PROJECT , I've looked at it but
can't
>> > understand how to get the path from outside.
>> > I'll try again see if I missed something about this feature and
get
>> back to
>> > you.
>> >
>> > The projects are almost all independent and I need to allow
working
>> with a
>> > clone of one subproject without retrieving everything, just it
>> dependencies.
>> >
>> > I'll try to be more clear :
>> >  - there is a common language used to describe a "Sequence" (it's
>> not
>> > important so just understand that the important projects in the
>> framework
>> > will require this)
>> >  - there are tools, all made to manipulate the sequences, so each
>> project is
>> > independant (separate repo) but some projects need to use other
>> projects, so
>> > we need to provide their path in their Cmake
>> >  - there are players that are like tools but are just interpreter
>> projects -
>> > anyway they are as indpendant or dependant as tools
>> projects/subrepos
>> >  - now I have central repository ("default") that is just meant
to
>> gather
>> > everything together; That's for people wanting everything but
they
>> are few.
>> > Most subproject developers will just get their dependencies and
work
>> from
>> > their, without updating the dependencies while developping. If
you
>> get the
>> > "default" repo, you have synchronized repos togethere (read: we
use
>> specific
>> > tags for each subrespo). So the default repository is mainly for
the
>> > developers needing to touch everything. Like me.
>> >
>> > Is it more clear?
>> >
>> > On Fri, Dec 3, 2010 at 11:16, Marcel Loose <loose at astron.nl>
wrote:
>> >
>> >> >>> On 2-12-2010 at 16:12, in message
>> >>
>> >
>> 
>
<AANLkTimJU5WAv=EKxnbmkpLnL7dN_c+XsSgKOEFm5Le6 at mail.gmail.com<EKxnbmkpLnL7dN_c%
> 2BXsSgKOEFm5Le6 at mail.gmail.com>
>> <EKxnbmkpLnL7dN_c%
>> > 2BXsSgKOEFm5Le6 at mail.gmail.com>>,
>> >> Klaim
>> >> <mjklaim at gmail.com> wrote:
>> >> > Hi!
>> >> >
>> >> > I'm currently trying to understand how to use CMake for a
>> non-trivial
>> >> setup
>> >> > of multiple-projects-framework. I'm a beginner at CMake (as
>> developer
>> >> I
>> >> > mean, not as library user).
>> >> > I've read the docs and I tried to read the Ogre project CMake
>> >> organization
>> >> > but it's a bit overkill for my project I think. Anyway, I'm
lost
>> >> here
>> >> > because
>> >> > I think I don't understand all I need to achieve what I want.
>> >> >
>> >> > My project is made of several sub projects that are all in
>> separate
>> >> > (mercurial) repositories.
>> >> > There is one "default" repository that use the mercurial
subrepos
>> >> feature to
>> >> > gather everything in one big framework project.
>> >> > You can see the repos there :
>> >> > http://code.google.com/p/art-of-sequence/source/browse/ (it's
an
>> open
>> >> source
>> >> > project but Idon't have the website ready yet to explain the
>> >> concept)
>> >> >
>> >> > The Cmake organisation I want to setup I've already seen
>> somewhere
>> >> else I
>> >> > think, but I'm a bit lost with all the ways to do it and I
think
>> I'll
>> >> make
>> >> > something very bad if I don't ask here for help here.
>> >> > I need each project (subrepo) to be available separately and
can
>> be
>> >> built
>> >> > giving to Cmake the paths of the project's dependencies.
>> >> > And I need the default repo to provide the paths.
>> >> >
>> >> > So I have this folder organisation in the default repo (that
>> gather
>> >> all
>> >> > subrepos) :
>> >> >
>> >> > /language                       # the intermediate language
>> (AOSL)
>> >> > definition project/subrepo
>> >> > /tools/                            # the folder that will
contain
>> all
>> >> the
>> >> > tools projects/subrepos
>> >> > /tools/aosdesigner           # a tool project/subrepo (in fact
>> the
>> >> most
>> >> > important) - an executable
>> >> > /tools/aoslcpp                 # a tool project/subrepo that is
a
>> >> dependency
>> >> > of aosdesigner - a library (shared)
>> >> > /players/                         # the folder that will
contain
>> all
>> >> the
>> >> > players (AOSL interpreters)
>> >> > /players/aoswebplayer     # a player project/subrepo
>> >> >
>> >> > There will be additional "tools" and "players" projects, and I
>> think
>> >> I'll
>> >> > need another folder for "exporters" but that's another
subject.
>> >> >
>> >> > Here, what I'm trying to do, is to have a CMakeLists.txt for
each
>> >> project
>> >> > (but "/language" that is not source code but xsd, xml and
text).
>> >> > Those projects will need the path of dependencies, like
>> >> "/tools/aosdesigner"
>> >> > will require the path of "/tools/aoslcpp".
>> >> >
>> >> > Then I want to set the paths of each project at the root
level.
>> It
>> >> would be
>> >> > perfect if I could symply get the name of all folders in
>> "/tools/"
>> >> and
>> >> > "/players/"
>> >> > and simply provide them to the CMakeLists.txt of the sub
>> projects.
>> >> >
>> >> > Is there a simple example of this kind of organisation out
there
>> that
>> >> I
>> >> > could be inspered of?
>> >> > Do you have some guidance to give me to setup all this?
>> >> > I tried to write this organisation but I'm clueless on how to
>> gather
>> >> and
>> >> > provide the paths of each projects...
>> >> >
>> >> > Once I understand how to do this I think I'll use this
>> organisation
>> >> for
>> >> > another big project too.
>> >> >
>> >> > Any help would be really.....helpful :)
>> >> > Thanks for reading. Tell me if I was not clear on some points.
>> >> >
>> >> > Klaim
>> >>
>> >> Hi Klaim,
>> >>
>> >> It's not completely clear to me how tightly your subprojects are
>> >> coupled.
>> >>
>> >> I would suggest you'd create a CMake project for each of your
>> >> subprojects and use the EXTERNAL_PROJECT feature to import the
>> required
>> >> subproject. UNLESS: your subprojects cannot really exist as
>> stand-alone
>> >> products, but are just parts of one overall project. In that
case,
>> I
>> >> would choose to create just one CMake project.
>> >>
>> >> HTH,
>> >> Marcel Loose.
>> >>
>>
>>
>>




More information about the CMake mailing list