FindSDL* CMake files

Hi all

I was speaking to a CMake dev on the topic of getting some FindSDL2*.cmake
modules, but he somewhat redirected me here, saying that SDL itself should
generate the files, rather than CMake including them in their repo

are there any “official” FindSDL2.cmake files anywhere?
i’m looking for SDL2 and SDL2_ttf
LordAro: there aren’t
ngladitz: any sort of an eta on them? SDL2 has been released for
a while now
I don’t think anyone is working on any find modules for SDL2 (or
even intends to work on them) as far as I know
dang
should i? :L
you could try to get SDL itself to provide cmake configuration
files
or try contributing those to SDL
then cmake wouldn’t need find modules for it
iirc SDL can be built with cmake, so…
I guess ideally they would have to generate and install the
cmake configuration files with all their supported build systems
indeed, in fairness they do also have premake and autotools build
systems…
I imagine it wouldn’t be too difficult for someone who is
familiar with those

http://www.cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#package-layout
for reference
I imagine it would be similar to existing code that they have
for generating pkg-config files

So, thoughts? I could probably manage to write the files myself, but I
wouldn’t have much of an idea as to including them into SDL’s build
structure

Thanks
Charles

I have files for SDL2 and SDL2_image that I’m using, I got them from
another open source project and the credits are in the files commented
at the top.

FindSDL2.cmake:

FindSDL2_image.cmake:

And here’s my CMakeLists.txt if you’re interested:

mm… does the VS project even build an installer? I thought it just
emitted a DLL at the end.

I’m pretty sure the same is true for the mac framework distributable;
it’s a dmg not a pkg.

I suppose you could hack the autoconf setup to add another file in the
install step and push the FindSDL2.cmake file into the system on
install, but … is it really worth it?

I’ve always just had the SDL source as a subfolder and built it as
part of the child binary and bundled the result as part of the
installer for the child.

Given SDL doesn’t have an installer per-se that ever gets built, I
imagine that (or statically linking the SDL library) would be the best
solution anyway.

I appreciate that at some level it makes using SDL less annoying, but
add_subfolder(${PROJECT_SOURCE_DIR}/deps/sdl) is pretty trivial to do
too; the whole cmake find module thing makes a lot more sense (to me)
for large to deal with massive projects like QT and boost, where the
last thing in the world you want to do is recompile them.

For SDL where you might for various reasons (like they haven’t been
merged) want to patch in geometry rendering to some such, building
your own copy makes more sense than relying on specific system
binaries.~
Doug.

On Mon, Feb 24, 2014 at 12:51 AM, Charles Pigott wrote:

Hi all

I was speaking to a CMake dev on the topic of getting some FindSDL2*.cmake
modules, but he somewhat redirected me here, saying that SDL itself should
generate the files, rather than CMake including them in their repo

are there any “official” FindSDL2.cmake files anywhere?
i’m looking for SDL2 and SDL2_ttf
LordAro: there aren’t
ngladitz: any sort of an eta on them? SDL2 has been released for a
while now
I don’t think anyone is working on any find modules for SDL2 (or
even intends to work on them) as far as I know
dang
should i? :L
you could try to get SDL itself to provide cmake configuration
files
or try contributing those to SDL
then cmake wouldn’t need find modules for it
iirc SDL can be built with cmake, so…
I guess ideally they would have to generate and install the cmake
configuration files with all their supported build systems
indeed, in fairness they do also have premake and autotools build
systems…
I imagine it wouldn’t be too difficult for someone who is
familiar with those

http://www.cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#package-layout
for reference
I imagine it would be similar to existing code that they have for
generating pkg-config files

So, thoughts? I could probably manage to write the files myself, but I
wouldn’t have much of an idea as to including them into SDL’s build
structure

Thanks
Charles


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

I don’t agree that bundling libraries is a better solution, but that’s
another discussion :slight_smile:

As I’ve already seen many attempts at creating cmake find scripts, would it
be possible to add an ‘official’ version to the hg repo, so at least
there’s a central place to take them from and contribute back?

2014-02-25 16:30 GMT+01:00 Doug <douglas.linder at gmail.com>:> mm… does the VS project even build an installer? I thought it just

emitted a DLL at the end.

I’m pretty sure the same is true for the mac framework distributable;
it’s a dmg not a pkg.

I suppose you could hack the autoconf setup to add another file in the
install step and push the FindSDL2.cmake file into the system on
install, but … is it really worth it?

I’ve always just had the SDL source as a subfolder and built it as
part of the child binary and bundled the result as part of the
installer for the child.

Given SDL doesn’t have an installer per-se that ever gets built, I
imagine that (or statically linking the SDL library) would be the best
solution anyway.

I appreciate that at some level it makes using SDL less annoying, but
add_subfolder(${PROJECT_SOURCE_DIR}/deps/sdl) is pretty trivial to do
too; the whole cmake find module thing makes a lot more sense (to me)
for large to deal with massive projects like QT and boost, where the
last thing in the world you want to do is recompile them.

For SDL where you might for various reasons (like they haven’t been
merged) want to patch in geometry rendering to some such, building
your own copy makes more sense than relying on specific system
binaries.

~
Doug.

On Mon, Feb 24, 2014 at 12:51 AM, Charles Pigott wrote:

Hi all

I was speaking to a CMake dev on the topic of getting some
FindSDL2*.cmake
modules, but he somewhat redirected me here, saying that SDL itself
should
generate the files, rather than CMake including them in their repo

are there any “official” FindSDL2.cmake files anywhere?
i’m looking for SDL2 and SDL2_ttf
LordAro: there aren’t
ngladitz: any sort of an eta on them? SDL2 has been released
for a
while now
I don’t think anyone is working on any find modules for SDL2
(or
even intends to work on them) as far as I know
dang
should i? :L
you could try to get SDL itself to provide cmake configuration
files
or try contributing those to SDL
then cmake wouldn’t need find modules for it
iirc SDL can be built with cmake, so…
I guess ideally they would have to generate and install the
cmake
configuration files with all their supported build systems
indeed, in fairness they do also have premake and autotools
build
systems…
I imagine it wouldn’t be too difficult for someone who is
familiar with those

http://www.cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#package-layout

for reference
I imagine it would be similar to existing code that they have
for
generating pkg-config files

So, thoughts? I could probably manage to write the files myself, but I
wouldn’t have much of an idea as to including them into SDL’s build
structure

Thanks
Charles


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


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