CMake gurus

Assuming a corectly written CMakeLists.txt the CMake processes doesn’t need to be anymore complicated than:

mkdir build
cd build
cmake … (-G Xcode for an Xcode project)

Then run make && sudo make install on Linux and OSX , or open the geneated Visual Studio project on Windows.

Is that so complicated? If you need extra parameters t is not harder than if you were using a configure script.

I agree with all of the above comments that any users of the library who struggle with that process probeably should just be using pre-built binaries.

I personally love CMake and find it relatively easy to use, so perhaps my point of view is somewhat biased, but other than providing pre-generated projects I’ve seen no mention of anything in this thread that CMake can’t do.

Then run make && sudo make install on Linux and OSX , or open the geneated

Visual Studio project on Windows.

Is that so complicated? If you need extra parameters t is not harder than
if you were using a configure script.

I agree with all of the above comments that any users of the library who
struggle with that process probeably should just be using pre-built
binaries.

I personally love CMake and find it relatively easy to use, so perhaps my
point of view is somewhat biased, but other than providing pre-generated
projects I’ve seen no mention of anything in this thread that CMake can’t
do.

I think we are discussing about a complexity that it exists, and it’s
minimal, but that let you do things that at the moment on
XCode/VisualStudio projects cannot do and never will.

I’m talking about “adapting” the build to your architecture (availability
of certain subsystems, for instance X11 on OSX or standard headers on
recent visual studios…), at the moment there is a single SDL_config_osx /
SDL_config_win32 that dictates how SDL must configure on these archs, using
CMake will make these platforms use the “real” SDL_config.h

Developers that do not want to install CMake can use the prebuilt DLL +
headers, that, as said multiple times in this thread, is the usual approach
a win32 developer will try first.

Another plus of CMake is how easy it is to cross-build, for instance for a
project I’m working on with two simple toolchain files I can build on the
same machine for Linux, OSX and Win32. The CMakelists.txt (I agree is an
ugly name, Ryan) is the same if you build on the target or through a
crosscompiler.

Remember also that once you know a bit CMake, write a CMakeLists.txt or a
macro file is far easier that working with autotools, and CMake files are
also smaller and easier to be read than the autoconf scripts.–
Bye,
Gabry

Cross compiling for OSX from Linux? Tell me more.On 25/03/13 14:31, Gabriele Greco wrote:

Another plus of CMake is how easy it is to cross-build, for instance for
a project I’m working on with two simple toolchain files I can build on
the same machine for Linux, OSX and Win32.

Another plus of CMake is how easy it is to cross-build, for instance for

a project I’m working on with two simple toolchain files I can build on
the same machine for Linux, OSX and Win32.

Cross compiling for OSX from Linux? Tell me more.

I use a cross compiler I’ve found in a ubuntu repository (
https://launchpad.net/~flosoft/+archive/cross-apple ) :

dpkg -l | grep apple

ii apple-uni-framework-sdl 1.2.14-0flosoft3
MacOSX SDL-framework for
apple cross compiler
ii apple-uni-sdk-10.5 20110407-0.flosoft1
MacOSX 10.5 SDK for apple
cross compiler
ii apple-uni-sdk-10.6 20110407-0.flosoft1
MacOSX 10.6 SDK for apple
cross compiler
ii apple-x86-gcc 4.2.1~5646.1flosoft2
Apple i686/x86_64
crosscompiler
ii apple-x86-odcctools 758.159-0flosoft11
Apple Darwin crosscompiler
i686/x86_64 “binutils”.

I’ve added the libraries I use (SDL, GTK…) in the SYSROOT of the apple
compiler, and I’ve added pkg-config files pointing to the right paths.

I use the following toolchain file (the last lines are important to avoid
to “poison” the cross-compiler with linux headers):

this one is important

SET(CMAKE_SYSTEM_NAME Darwin)

specify the cross compiler

SET(CMAKE_C_COMPILER i686-apple-darwin10-gcc)
SET(CMAKE_CXX_COMPILER i686-apple-darwin10-g++)

where is the target environment

SET(CMAKE_FIND_ROOT_PATH /usr/lib/apple/SDKs/MacOSX10.5.sdk/usr)

search for programs in the build host directories

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

for libraries and headers in the target directories

SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(ENV{PKG_CONFIG_PATH} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig)–
Bye,
Gabry

Cool. Thanks for the tip.On 25/03/13 15:14, Gabriele Greco wrote:

I use a cross compiler I’ve found in a ubuntu repository (
https://launchpad.net/~flosoft/+archive/cross-apple ) :

Yea, I’m gonna have to try that out when my new mobo arrives (grabbed a
project Q mobo from kickstarter, supposed to be able to run any OS, but
mostly it will be my triple boot hackintosh experiment :slight_smile:

  • Swyped from my droid.On Mar 25, 2013 10:17 AM, “Tim Angus” wrote:

On 25/03/13 15:14, Gabriele Greco wrote:

I use a cross compiler I’ve found in a ubuntu repositor…
Cool. Thanks for the tip.


SDL mailing list
SDL at lists.libsdl.org
http://lists

Pros:

  • ?
  • One file to rule all projects!
  • parallel builds
  • colorized output :slight_smile:

Cons:

  • Additional build dependency on all platforms
    That would be in substitution of auto tools so a ‘different’ rather
    than 'additional
  • Not as well supported in debian build environment
    Umh?
  • Not as easy to change configuration parameters
    That’s the only limitation I see but as a workaround one could always
    grep for OPTION on the main cmakelists
  • Can’t pre-generate Visual Studio projects for end users
  • Can’t pre-generate Xcode projects for end users
    That’s a PRO, think how many bugs because of broken projects you are
    preventing! Also bundling project file in the repository would
    needlessly burn up revisions IMHO
  • Needs additional coding to support build steps and special features of existing projects

Sorry if I sound blunt, but as a user, if you can’t handle generating
(simple) project files from cmake, maybe it’s better that you stay out
of sdl source code altogether…

Jm2c,
Vittorio

They’re not quite the same thing. Autotools doesn’t create a build dependency.
The maintainers of the project need autotools, but the users of the project do
not. Cmake requires everyone to have cmake installed.On 03/28/2013 04:15 PM, Vittorio Giovara wrote:

Cons:

  • Additional build dependency on all platforms
    That would be in substitution of auto tools so a ‘different’ rather
    than 'additional

Gabomdq wrote:

Anyone with premake [1] experience? On paper it looks like it fits the bill

I’d just like to repeat this. Has anyone used this? Any experience with it?

I’ve been eyeing premake myself for some of the commercial projects I’ve been working on. I know it supports relative paths, or at least it did as of a few years ago (according to a forum post by one of its authors, at: http://www.ogre3d.org/forums/viewtopic.php?f=10&t=54399#p370399). It seems to be under active development as well (at https://bitbucket.org/premake).

Cheers,
– David Ludwig

That’s true, but I have about 7 versions of automake, autoconf, libtool,
etc. installed on my machine for various different libraries.

Sometimes autotools don’t require a build dependency, but often it has
multiple dependencies, which are a pain to get, install and configure the
correct versions of, because the developer hasn’t created a proper portable
configuration file.

I’m sure we could work around that if we wanted to, I’m just saying. It’s
not quite that simple; lots and lots of libraries screw this up.

Honestly though, as far as I’m concerned, the flexibility of cmake
outweighs any of these potential griefs.
I routinely use cmake -G “Ninja” now, and don’t use make at all, and it’s
fantastic.

That’s simply not possible using the autotools, afaik.~
Doug.

On Fri, Mar 29, 2013 at 5:11 AM, John wrote:

On 03/28/2013 04:15 PM, Vittorio Giovara wrote:

Cons:

  • Additional build dependency on all platforms

That would be in substitution of auto tools so a ‘different’ rather
than 'additional

They’re not quite the same thing. Autotools doesn’t create a build
dependency. The maintainers of the project need autotools, but the users of
the project do not. Cmake requires everyone to have cmake installed.

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