CMake gurus

I want CMake to replace the visual studio and xcode projects if possible.
Can that be done?

If we can get CMake to generate complete projects for Visual C++
2008/2010/2012 and Xcode Mac OS X and iOS, with all current functionality,
and with relative paths so the projects can be redistributed, then I’ll
drop autotools. :)On Thu, Mar 14, 2013 at 10:17 PM, Sam Lantinga <@slouken> wrote:

I want CMake to replace the visual studio and xcode projects if possible.
Can that be done?

Great idea. :slight_smile:

The xcode build (cmake -G Xcode) already works for targeting mac (32 bit
only because of linking); I imagine it’d be fairly trivial (for someone who
knows iOS dev) to update it to support that too. A build flag to choose
which project type to created (same as the xcode and xcode-ios already
there) would be the way to go.

Not sure about VS work; that’s possibly tricker, I think the linker flags
for the mingw build would have to be updated somewhat…~
Doug.

On Fri, Mar 15, 2013 at 1:24 PM, Sam Lantinga wrote:

If we can get CMake to generate complete projects for Visual C++
2008/2010/2012 and Xcode Mac OS X and iOS, with all current functionality,
and with relative paths so the projects can be redistributed, then I’ll
drop autotools. :slight_smile:

On Thu, Mar 14, 2013 at 10:17 PM, Sam Lantinga wrote:

I want CMake to replace the visual studio and xcode projects if possible.
Can that be done?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

On, Fri Mar 15, 2013, Sam Lantinga wrote:

If we can get CMake to generate complete projects for Visual C++
2008/2010/2012 and Xcode Mac OS X and iOS, with all current functionality,
and with relative paths so the projects can be redistributed, then I’ll
drop autotools. :slight_smile:

For Visual C++, CMake did that when I initially sent the files around
and put them into Bugzilla. I did not track the latest changes (of the
last 4 months), so I will have to catch up with that and update the
cmake scripts, if that was not done by someone else already (can someone
comment on this?).

One of the missing functionality for CMake ist the creation of a test
project for executing the test suite as well as the exclusion of certain
files (doe the SDL_test* files to be installed? I do not think so).

I can’t say anything about the Mac OS part, though.

Cheers
Marcus
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130315/9ee840c3/attachment.pgp

Yes, the test includes and the static lib should be installed. The idea
is, that the functionality such as the logger, harness and fuzzer can be
used across other projects (SDL_image, apps, etc.).

I wouldn’t worry about automatic execution of the testautomation quite
yet. The suite is not complete and also has some invalid tests (ported
from existing code) that fail in it right now. (FYI - I am planning on
launching a GSOC project around finishing this up.)On 3/15/2013 3:03 AM, Marcus von Appen wrote:

On, Fri Mar 15, 2013, Sam Lantinga wrote:

If we can get CMake to generate complete projects for Visual C++
2008/2010/2012 and Xcode Mac OS X and iOS, with all current functionality,
and with relative paths so the projects can be redistributed, then I’ll
drop autotools. :slight_smile:
For Visual C++, CMake did that when I initially sent the files around
and put them into Bugzilla. I did not track the latest changes (of the
last 4 months), so I will have to catch up with that and update the
cmake scripts, if that was not done by someone else already (can someone
comment on this?).

One of the missing functionality for CMake ist the creation of a test
project for executing the test suite as well as the exclusion of certain
files (doe the SDL_test* files to be installed? I do not think so).

I can’t say anything about the Mac OS part, though.

Cheers
Marcus


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I want CMake to replace the visual studio and xcode projects if possible.
Can that be done?

I’m not using SDL yet, but I’m subscribed to this mailing list with great
interest because I plan to use SDL 2.0 for the Android and iOS ports of
some of my applications. One of my mandatory requirements though is that I
need to build my apps through command-line tools available on all modern
OSs. Well, it’s OK if the iOS version of SDL is built as Xcode projects,
but my apps cannot, so I really need that SDL client applications have a
command-line build method for all target ports.

I don’t know if your call regarding cmake applies to the SDL lib only, or
if it can already be used for client apps on all targets. If the later is
affirmative, please ignore my comment. Otherwise, please provide a way for
building apps on the command line for both iOS and Android.

Thanks a lot for all the hard work you’re doing,

ardiOn Friday, March 15, 2013, Sam Lantinga wrote:

2013/3/16 Ardillas del Monte > On Friday, March 15, 2013, Sam Lantinga wrote:

I want CMake to replace the visual studio and xcode projects if possible.
Can that be done?

I’m not using SDL yet, but I’m subscribed to this mailing list with great
interest because I plan to use SDL 2.0 for the Android and iOS ports of
some of my applications. One of my mandatory requirements though is that I
need to build my apps through command-line tools available on all modern
OSs. Well, it’s OK if the iOS version of SDL is built as Xcode projects,
but my apps cannot, so I really need that SDL client applications have a
command-line build method for all target ports.

I don’t know if your call regarding cmake applies to the SDL lib only, or
if it can already be used for client apps on all targets. If the later is
affirmative, please ignore my comment. Otherwise, please provide a way for
building apps on the command line for both iOS and Android.

Thanks a lot for all the hard work you’re doing,

ardi

SDL can be fully compiled from the command line right now using the
familiar configure;make process, even for iOS and Android. Check out the
build-scripts/iosbuild.sh script for an example on how to do that.


Gabriel.

On, Sat Mar 16, 2013, Gabriel Jacobo wrote:

2013/3/16 Ardillas del Monte

I want CMake to replace the visual studio and xcode projects if possible.
Can that be done?

I’m not using SDL yet, but I’m subscribed to this mailing list with great
interest because I plan to use SDL 2.0 for the Android and iOS ports of
some of my applications. One of my mandatory requirements though is that I
need to build my apps through command-line tools available on all modern
OSs. Well, it’s OK if the iOS version of SDL is built as Xcode projects,
but my apps cannot, so I really need that SDL client applications have a
command-line build method for all target ports.

I don’t know if your call regarding cmake applies to the SDL lib only, or
if it can already be used for client apps on all targets. If the later is
affirmative, please ignore my comment. Otherwise, please provide a way for
building apps on the command line for both iOS and Android.

Thanks a lot for all the hard work you’re doing,

ardi

SDL can be fully compiled from the command line right now using the
familiar configure;make process, even for iOS and Android. Check out the
build-scripts/iosbuild.sh script for an example on how to do that.

The same is valid for Win32 platforms (Visual C++) and Makefile-based
solutions using CMake. I would guess that Xcode also features a non-GUI
driven build approach.

Cheers
Marcus
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130316/7cb12825/attachment.pgp> > On Friday, March 15, 2013, Sam Lantinga wrote:

On, Sat Mar 16, 2013, Gabriel Jacobo wrote:

2013/3/16 Ardillas del Monte <@Ardillas_del_Monte <javascript:;>>

I want CMake to replace the visual studio and xcode projects if
possible.

Can that be done?

I’m not using SDL yet, but I’m subscribed to this mailing list with
great

interest because I plan to use SDL 2.0 for the Android and iOS ports of
some of my applications. One of my mandatory requirements though is
that I

need to build my apps through command-line tools available on all
modern

OSs. Well, it’s OK if the iOS version of SDL is built as Xcode
projects,

but my apps cannot, so I really need that SDL client applications have
a

command-line build method for all target ports.

I don’t know if your call regarding cmake applies to the SDL lib only,
or

if it can already be used for client apps on all targets. If the later
is

affirmative, please ignore my comment. Otherwise, please provide a way
for

building apps on the command line for both iOS and Android.

Thanks a lot for all the hard work you’re doing,

ardi

SDL can be fully compiled from the command line right now using the
familiar configure;make process, even for iOS and Android. Check out the
build-scripts/iosbuild.sh script for an example on how to do that.

The same is valid for Win32 platforms (Visual C++) and Makefile-based
solutions using CMake. I would guess that Xcode also features a non-GUI
driven build approach.

Cheers
Marcus

Ok, thanks a lot. Actually my interest on the build method applies to
applications, and not SDL itself, but I suppose that what you said is also
true for applications.

My interest is just based on simplifying my code maintenance. SDL lets you
minimize the need for platform-specific code. It’s so a nonsense to be
forced to maintain your project on a different way on each platform, I need
just a cross-platform way for project management. Standard make is fine for
me, and most other command line utilities too, provided they’re available
on most modern OSs.

Thanks!

ardiOn Saturday, March 16, 2013, Marcus von Appen wrote:

On Friday, March 15, 2013, Sam Lantinga wrote:

The same is valid for Win32 platforms (Visual C++) and Makefile-based
solutions using CMake. I would guess that Xcode also features a non-GUI
driven build approach.

xcodebuild from the sdl ios project directory used to work last time I
tried it (ages ago), actually I compile SDL for iOS as static framework
using some useful scripts available on github:

They also use a command line only approach.–
Bye,
Gabry

I want CMake to replace the visual studio and xcode projects if possible.
Can that be done?

Visual Studio: Yes, I believe it can be done.

Mac: Yes, I think that can be done too.

iOS: Might be harder. There is an experimental iOS/CMake utility
project (similar to the Android/CMake utility project). I haven’t had
a chance to play with it. (I have played with the Android one.) It’s
definitely more steps for a end user though which makes it tougher.

and with relative paths so the projects can be redistributed

Relative paths don’t really work in CMake. In general, you can’t
really redistribute generated projects. It just doesn’t work right.
Just finding the path to the compiler is an incredibly hard problem.
(Windows is particularly hard because drive letters make things even
harder.)

, then I’ll drop autotools. :slight_smile:

Apple has already dropped autotools from their toolchain. That pretty
much means its only useful on Linux and maybe some of the other Unices
(but not Android). But all of those Unices can get CMake just as
easily as autotools through their package management tools. (And CMake
has fewer components and dependencies than autotools.)

Thanks,
Eric> On Thu, Mar 14, 2013 at 10:17 PM, Sam Lantinga wrote:

Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

Unfortunately relative paths for projects won’t work. Yes there is a flag in cmake to turn it on, but Cmake developers don’t support it, and at least for Xcode projects it doesn’t work at all. (went through this battle with David Rosen @ Wolfire as he switched all platforms to cmake after I introduced it to him doing the linux port of Overgrowth)

Though really it’s not that hard to use the cmake gui on windows + OS X.On Mar 15, 2013, at 1:24 , Sam Lantinga wrote:

If we can get CMake to generate complete projects for Visual C++ 2008/2010/2012 and Xcode Mac OS X and iOS, with all current functionality, and with relative paths so the projects can be redistributed, then I’ll drop autotools. :slight_smile:

On Thu, Mar 14, 2013 at 10:17 PM, Sam Lantinga wrote:
I want CMake to replace the visual studio and xcode projects if possible. Can that be done?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Edward Rudd
OutOfOrder.cc
Skype: outoforder_cc
317-674-3296

Perhaps a better question is: what would it take to fix this in cmake,
regardless of what the CMake developers think of that idea?

Sam and I were joking about committing a copy of cmake.exe and a perl
script to fix the absolute paths to Mercurial, so the final .vcproj
files we would ship would work anywhere…but I’ll tell you, if that
would actually work: a lot of truth is said in jest. :slight_smile:

–ryan.On 03/20/2013 01:00 AM, Edward Rudd wrote:

Unfortunately relative paths for projects won’t work. Yes there is a
flag in cmake to turn it on, but Cmake developers don’t support it, and
at least for Xcode projects it doesn’t work at all. (went through this
battle with David Rosen @ Wolfire as he switched all platforms to cmake
after I introduced it to him doing the linux port of Overgrowth)

Unless I’m missing something, it sounds like what you’re trying to achieve is contrary to how CMake is meant to work.

The whole point of CMake is that you DO NOT check in and redistribute the generated projects/makefiles/etc. Users are meant to check out the code, then run CMake to generate a project for the toolchain of their choice and go from there.

Is there a reason that a Visual Studio solution/XCode project has to be in the repo?

PS. I hate for my first post here to be critising the approach of a fantastic project like SDL.

SDL always had a Visual Studio project to go along with it, so I
assume it may be related to that. But yeah, CMake pretty much makes it
redundant…

2013/3/22, ADT7 :> Unless I’m missing something, it sounds like what you’re trying to achieve

is contrary to how CMake is meant to work.

The whole point of CMake is that you DO NOT check in and redistribute the
generated projects/makefiles/etc. Users are meant to check out the code,
then run CMake to generate a project for the toolchain of their choice and
go from there.

Is there a reason that a Visual Studio solution/XCode project has to be in
the repo?

PS. I hate for my first post here to be critising the approach of a
fantastic project like SDL.

That’s correct. What we actually want is a way to take a project
description and turn it into platform dependent projects for Visual Studio
and Xcode that end users don’t have to think about.

It may be that CMake is the wrong tool for this, in which case we can drop
CMake support.On Fri, Mar 22, 2013 at 7:14 AM, ADT7 wrote:

**
Unless I’m missing something, it sounds like what you’re trying to achieve
is contrary to how CMake is meant to work.

The whole point of CMake is that you DO NOT check in and redistribute the
generated projects/makefiles/etc. Users are meant to check out the code,
then run CMake to generate a project for the toolchain of their choice and
go from there.

Is there a reason that a Visual Studio solution/XCode project has to be in
the repo?

PS. I hate for my first post here to be critising the approach of a
fantastic project like SDL.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I think he meant that CMake makes the need for said projects redundant
in the first place (though it probably also isn’t a suitable tool for
making them).

Let’s get this out of the way quickly: what are the pre-made projects
needed for?

2013/3/23, Sam Lantinga :> That’s correct. What we actually want is a way to take a project

description and turn it into platform dependent projects for Visual Studio
and Xcode that end users don’t have to think about.

It may be that CMake is the wrong tool for this, in which case we can drop
CMake support.

On Fri, Mar 22, 2013 at 7:14 AM, ADT7 wrote:

**
Unless I’m missing something, it sounds like what you’re trying to
achieve
is contrary to how CMake is meant to work.

The whole point of CMake is that you DO NOT check in and redistribute the
generated projects/makefiles/etc. Users are meant to check out the code,
then run CMake to generate a project for the toolchain of their choice
and
go from there.

Is there a reason that a Visual Studio solution/XCode project has to be
in
the repo?

PS. I hate for my first post here to be critising the approach of a
fantastic project like SDL.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Message-ID:
<CAEyBR+W4w9oGJkM=kNYHiXbhjZF0Sx5aXT08a1wGpDp+k=6aGQ at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

I think he meant that CMake makes the need for said projects redundant
in the first place (though it probably also isn’t a suitable tool for
making them).

Let’s get this out of the way quickly: what are the pre-made projects
needed for?

They’re needed for people that want to compile SDL, but don’t want to
deal with a lot of extra cruft. Not having tried compiling it recently
I can’t guess whether it’s possible to compile SDL 2 without
downloading lots of dependencies, but I can sympathize with the desire
itself.

Ideally we would use something make-ish that was generic enough to act
as both a build system, AND a configure system, but I don’t recall any
logic languages being standard installs anywhere.

I suppose SDL could switch to a makefile that generates either a
another makefile, or a Visual Studio project, depending on arguments,
but that strikes me as… insane.> Date: Sat, 23 Mar 2013 21:08:12 -0300

From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: SDL Development List
Subject: Re: [SDL] CMake gurus…

Huh, CMake is just download and run, there isn’t much more to it…
Just make sure Visual Studio is installed too. Also other libraries
such as PhysicsFS use CMake too.

The only important dependency SDL has on Windows are DirectX and
OpenGL as far as I know. OpenGL always comes bundled, and DirectX has
started to come bundled with Visual Studio in recent versions too.
Correct me if I’m wrong on this.

The only issue I had with CMake was it defaulting to Visual Studio on
a system that used MinGW instead (it assumed that Windows == Visual
Studio), but we’re talking about using CMake with Visual Studio so
that obviously isn’t the issue here.

2013/3/23, Jared Maddox :>> Date: Sat, 23 Mar 2013 21:08:12 -0300

From: Sik the hedgehog <@Sik_the_hedgehog>
To: SDL Development List
Subject: Re: [SDL] CMake gurus…
Message-ID:
<CAEyBR+W4w9oGJkM=kNYHiXbhjZF0Sx5aXT08a1wGpDp+k=6aGQ at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

I think he meant that CMake makes the need for said projects redundant
in the first place (though it probably also isn’t a suitable tool for
making them).

Let’s get this out of the way quickly: what are the pre-made projects
needed for?

They’re needed for people that want to compile SDL, but don’t want to
deal with a lot of extra cruft. Not having tried compiling it recently
I can’t guess whether it’s possible to compile SDL 2 without
downloading lots of dependencies, but I can sympathize with the desire
itself.

Ideally we would use something make-ish that was generic enough to act
as both a build system, AND a configure system, but I don’t recall any
logic languages being standard installs anywhere.

I suppose SDL could switch to a makefile that generates either a
another makefile, or a Visual Studio project, depending on arguments,
but that strikes me as… insane.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Ideally we would use something make-ish that was generic enough to act
as both a build system, AND a configure system, but I don’t recall any
logic languages being standard installs anywhere.

Ideally we want Windows people to find a Visual Studio project that
matches their version of Visual Studio, double-click it, and build the
library.

Right now we’re maintaining several .vcproj files for different
versions, and almost universally, some subset of them fails to get
updated when we change a project setting of add/remove files. Tests are
missing from many of them, etc.

XCode is slightly better about this, but still suffers from the fact
that it’s not necessarily our primary way to build SDL (even on Mac, I’m
using the configure script, for example), so it isn’t well-maintained
either.

If not CMake, something that allows us to do what CMake does is really
really interesting: we maintain one text file, it spits out projects for
lots of tools. But we really don’t want the Windows/Mac experience to be
like this:

  • Download SDL sources.
  • There’s no Visual Studio project?!
  • Read the readme, find out I’m supposed to use CMakeLists.txt (which is
    the worst naming choice ever, btw).
  • Download CMake.
  • Install CMake.
  • Run CMake-gui.
  • Maybe understand I was supposed to point it at the SDL root directory.
  • Maybe understand I should set the output directory somewhere outside
    of the source tree.
  • Maybe understand that the poorly-built dropdown list actually scrolls,
    and my compiler is, in fact, supported.
  • Click configure (maybe twice).
  • Generate project files.
  • Launch Visual Studio with the project files.
  • Compile.

What I’d rather they do is this:

  • Download SDL sources.
  • Double-click the correct .sln file in the “VisualStudio” directory,
    which we generated with CMake when packaging up the sources.
  • Compile.

I understand there are technical limitations that prevent what I’m
describing right now, but it drives me nuts that these are hand-waved
away as social limitations ("That’s not how CMake is meant to be used"
is just a bug report that no one is yet willing to fix).

–ryan.