Commit Graph

8 Commits

Author SHA1 Message Date
Anonymous Maarten 1087eaad7e cmake: install SDL2::SDL2test when configuring with SDL2_TEST enabled 2022-06-03 12:41:36 -07:00
Neal Gompa 0696fc0134 cmake: Split SDL2-static and SDL2main into their own target exports
This makes it so that the generated targets are not interdependent,
which allows Linux distributions to split libraries into the
appropriate subpackages as needed.
2022-01-08 09:50:14 -08:00
Daniel Gibson 87ac373493 Fix Debug-only builds with CMake
"get_filename_component(SDL2_LIBDIR ${sdl2implib} PATH)" failed if
sdl2implib was set from sdl2implibdbg instead of ${sdl2implibdbg}

Thanks to seyuup from the SDL Discourse for pointing this out.
2021-10-05 18:45:53 -07:00
Ivan Epifanov 407867cf72 Alias SDL2::SDL2 to SDL2::SDL2-static on static-only builds 2021-10-04 11:17:30 -07:00
Daniel Gibson c20207d787 SDL2Config.cmake: Clean it up a bit, remove gcc-style SDL2_LIBRARIES
The GCC-style SDL2_LIBRARIES were lacking the rpath on Linux, which
seems to be implicitly set when linking path/to/libSDL2-2.0.so.0.*
and is explicitly set in the SDL2_LIBRARIES in sdl2-config.cmake
(from some autotools variable), so I removed that hack and the format
remains sth like "path/to/libSDL2main.a;path/to/libSDL2-2.0.so.0.14.1".

It's still in the revision history in case it turns out that some
platform really needs the "-L/path/to/bla/lib -lSDL2main -lSDL2" format
2021-07-08 14:55:33 -07:00
Daniel Gibson c342696172 Enhanced SDL2Config.cmake to also work on non-Windows
tested Linux; I assume most other Unices are similar; I don't have a Mac
2021-07-08 14:55:33 -07:00
Daniel Gibson 3ea11f9acb Make SDL2Config.cmake export SDL2_LIBRARIES etc (on Windows)
still WIP and other platforms than windows still TODO and open
questions etc

see https://github.com/libsdl-org/SDL/issues/4004
2021-07-08 14:55:33 -07:00
Sam Lantinga 496337b3cf Fixed bug 3651 - CMake build does not install CMake package configuration
tschwinger@elitemail.org

Most ironically, although autoconf/automake-based builds install (pretty half-assed) CMake package configuration files, they're missing in installations resulting from CMake-based builds entirely.

A proper configuration file typically also loads target exports (implemented in patch 3572, also fixing this issue - see my comment on that issue for details).

I believe it would be best to let the dinosaurs go extinct and redirect all build efforts to the CMake end for two reasons:

1. It potentially provides the best user experience, but you'd have to give it some love and ship with less quirky buildfiles.

2. It would force distros to build SDL via CMake and thus would ensure target exports are actually available everywhere.

Various CMake patches I submitted today in summary (directly converted from the HG commits and `am`d onto a fork of a git mirror that happened to be on `tip`).

    https://github.com/tschw/SDL/commits/patched

Fixing #2576 #3572, #3613, and this fresh ticket, which is almost entirely advertisement ;).

These already do to make SDL much less of a quirky fella to have in your dependency tree...
2017-08-09 19:03:10 -07:00