-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FindSDL2: Added module to locate SDL2 #149
Conversation
Thanks for working on this. However, as discussed here: http://www.cmake.org/Bug/view.php?id=14826#c35508 since SDL2 builds with CMake they should provide package configuration files as documented in the http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html CMake upstream should not have to maintain builtin knowledge about every library of every package out there, especially not those that are already CMake-aware. The place to contribute support for using SDL2 from CMake-based applications is to SDL2. |
I see. It sounds reasonable. Thanks. |
But how deal with platforms where you can't install helper files to |
The |
It would be really helpful if a Find SDL2 existed upstream, there's a huge proliferation of different versions of it in GitHub so it's a thing people have been looking forward to. |
Since SDL 2.0.6, the recommended way to link to a system copy of SDL2 from a CMake project is to behave like debian/tests/cmake-example - use find_package(SDL2) without a FindSDL2 macro. However, not all upstream projects that build using CMake have caught up with this yet. This specific implementation was taken from openjk, but it's regularly copied around, and can be found in hedgewars, spring and many other packages: https://codesearch.debian.net/search?q=Other+versions+link+to+-lSDL2main&literal=1 Inclusion of a vaguely similar file in CMake was rejected in <Kitware/CMake#149>. Reproduces: https://bugs.debian.org/951087 Signed-off-by: Simon McVittie <smcv@debian.org>
I tested it with both MinGW and MVSC.