The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
FindSDL* CMake files
Charles Pigott
Guest

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




<LordAro> are there any "official" FindSDL2.cmake files anywhere?
<LordAro> i'm looking for SDL2 and SDL2_ttf
<ngladitz> LordAro: there aren't

<LordAro> ngladitz: any sort of an eta on them? SDL2 has been released for a while now
<ngladitz> 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
<LordAro> dang
<LordAro> should i? :L
<ngladitz> you could try to get SDL itself to provide cmake configuration files
<ngladitz> or try contributing those to SDL
<ngladitz> then cmake wouldn't need find modules for it
<LordAro> iirc SDL can be built with cmake, so...
<ngladitz> I guess ideally they would have to generate and install the cmake configuration files with all their supported build systems
<LordAro> indeed, in fairness they do also have premake and autotools build systems...
<ngladitz> I imagine it wouldn't be too difficult for someone who is familiar with those
<ngladitz> http://www.cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#package-layout
<ngladitz> for reference
<ngladitz> 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
FindSDL* CMake files
Fsmv


Joined: 29 Jan 2014
Posts: 3
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:
https://github.com/Fsmv/Tiny/blob/Tiny2D-C%2B%2B/Tiny2D/C%2B%2B/cmake/FindSDL2.cmake

FindSDL2_image.cmake:
https://github.com/Fsmv/Tiny/blob/Tiny2D-C%2B%2B/Tiny2D/C%2B%2B/cmake/FindSDL2_image.cmake

And here's my CMakeLists.txt if you're interested:
https://github.com/Fsmv/Tiny/blob/Tiny2D-C%2B%2B/Tiny2D/C%2B%2B/CMakeLists.txt
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
FindSDL* CMake files
Doug
Guest

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:
Quote:
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


<LordAro> are there any "official" FindSDL2.cmake files anywhere?
<LordAro> i'm looking for SDL2 and SDL2_ttf
<ngladitz> LordAro: there aren't
<LordAro> ngladitz: any sort of an eta on them? SDL2 has been released for a
while now
<ngladitz> 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
<LordAro> dang
<LordAro> should i? :L
<ngladitz> you could try to get SDL itself to provide cmake configuration
files
<ngladitz> or try contributing those to SDL
<ngladitz> then cmake wouldn't need find modules for it
<LordAro> iirc SDL can be built with cmake, so...
<ngladitz> I guess ideally they would have to generate and install the cmake
configuration files with all their supported build systems
<LordAro> indeed, in fairness they do also have premake and autotools build
systems...
<ngladitz> I imagine it wouldn't be too difficult for someone who is
familiar with those
<ngladitz>
http://www.cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#package-layout
<ngladitz> for reference
<ngladitz> 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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
FindSDL* CMake files
Carles Pagès
Guest

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

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:
Quote:
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:
Quote:
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


<LordAro> are there any "official" FindSDL2.cmake files anywhere?
<LordAro> i'm looking for SDL2 and SDL2_ttf
<ngladitz> LordAro: there aren't
<LordAro> ngladitz: any sort of an eta on them? SDL2 has been released for a
while now
<ngladitz> 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
<LordAro> dang
<LordAro> should i? :L
<ngladitz> you could try to get SDL itself to provide cmake configuration
files
<ngladitz> or try contributing those to SDL
<ngladitz> then cmake wouldn't need find modules for it
<LordAro> iirc SDL can be built with cmake, so...
<ngladitz> I guess ideally they would have to generate and install the cmake
configuration files with all their supported build systems
<LordAro> indeed, in fairness they do also have premake and autotools build
systems...
<ngladitz> I imagine it wouldn't be too difficult for someone who is
familiar with those
<ngladitz>
http://www.cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#package-layout
<ngladitz> for reference
<ngladitz> 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



Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org