cmake rework (not again, still)

Tomaz Canabrava tcanabrava at kde.org
Mon Nov 23 07:32:56 PST 2015


On Mon, Nov 23, 2015 at 1:26 PM, Dirk Hohndel <dirk at hohndel.org> wrote:

> On Mon, Nov 23, 2015 at 01:07:59PM -0200, Tomaz Canabrava wrote:
> > So, a bit of history
> >
> > Dirk asked me to make subsurface compile in iOS and adding another target
> > to our cmake would be quite a task in the state that it currently was:
> >
> > we could:
> >  - use the desktop version on mobile
> > - use the mobile on desktop
> > - use cmake to find some libraries
> > - use pkg-config to find the same libraries
> > - a *lot* of boilerplate code on cmake
> > - build subsurface in source, outsorce
> >
> > I oversimplified some things and not everybody will be happy, so this is
> a
> > call for a little chat, nothing that I did is fixed in stone and I can
> > revert lots
> >
> > now, in my desktop I  have around 25 patches that rework the cmake in the
> > following way:
> >
> > - desktop version only on desktop
>
> Anton will be unhappy, but I'll let him comment on that
>

as I said, tons of what I did I can rework to make people happy.

>
> > - mobile version only on android (iOS to come)
>
> That's not going to work. The turn-around time for development of the
> mobile app if you have to deploy on a mobile OS (even if it's an
> emulation) is at least an order of magnitude longer than just doing a
> build on Linux (or MacOS) and running Subsurface-mobile there. While for
> many things you have to build and test for/on iOS and Android, for a lot
> of other code that is not necessary at all. In fact, I tend to do all the
> work I do on Subsurface-mobile on Linux and only once it works there to my
> satisfaction do I try an Android build and test on a device.
>
> So no, Subsurface-mobile needs to be able to be compiled at least on
> Linux, and likely on MacOS as well.
>

okay, will redo that part.


>
> > - need to pass -DSUBSURFACE_TARGET_PLATFORM on compile time, if not
> passed
> > it defaults to "Desktop"
>
> So we already have SUBSURFACE_MOBILE which is set to indicate that you are
> building Subsurface-mobile, if it isn't set, you're building the dekstop
> version. Can you explain what this new define does that we don't have
> already?
>

it fails if you try to compile for something that doesn't exists with a
message explaining what is missing / how to use
the code is more clear ( we had checks for 'if ( linux and not android ) '
followed by if (linux)' followed by if (android and not linux)

what I tried to do is to make very well separated targets so the cmake code
was easier to follow.


>
> And the naming is terrible - TARGET_PLATFORM should be the name of an OS,
> of a platform, not a concept like "Deksop" vs. "Mobile".
>

usually the 'Destkop' is the desktop on what the build is hapening, cmake
figures out the platform targed later ( so linux vs mac vs windows works
out of the box if you pass the type as desktop ) it only means that it's
not the mobile version.

I'll add another target 'MobileOnDestkop' or something like that that will
not have the if (android) tests on it.


> - out-of-source-build only
>
> That I'm OK with. build.sh has done this for a long time and I believe at
> this point most people at least start by using build.sh
>

yup =)


>
>
> /D
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20151123/8e8932a0/attachment.html>


More information about the subsurface mailing list