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
Expose SDL2_BIN_DIR on FindSDL2.cmake #347
Conversation
Codecov Report
@@ Coverage Diff @@
## master #347 +/- ##
======================================
Coverage 71.4% 71.4%
======================================
Files 349 349
Lines 17602 17602
======================================
Hits 12568 12568
Misses 5034 5034 Continue to review full report at Codecov.
|
Hi, Why isn't For finding the DLLs -- yes, I acknowledge it's a bit lacking right now, however doing this just for SDL isn't systematic enough I think. Two options come to my mind:
Or a combination of both -- for example the macro first looking for |
The macro is a really good idea, I like the proposed check ( Edit: should we make it a list ( |
About Also, and this is just a personal preference, the command to run cmake looks way cleaner with multiple variables for paths and not just a single |
Yes, that's a very good idea. Or maybe just
Are there any official guidelines / recommendations for how these variables should be named? Because I really saw many inconsistent variants and don't want to add more to that mess :D I know there's |
Lovely CMake... I haven't seen any standard on how to name these things... I guess it's a personal decision. The most common variants I've seen are What do you think? |
Sorry for not getting back to this yet. Possibly related -- CMake master (which will become 3.16, I think?) has a new command, file(GET_RUNTIME_DEPENDENCIES). I imagine this could finally become the right way to get all dependency DLLs? |
woah, that seems really nice. I will have a look at it. It seems to only work when installing the project, but definitely worth doing it like that if it's going to become the standard way |
From personal experience, I previously used it on my end, and if I had a clean build directory, the command just didn't copy the DLLs, which meant I got plenty of "missing library" errors when trying to launch my executable. YMMV, though. |
Sorry for not updating on this, I'm very busy lately. |
The DLL-finding part is merged in dc48491, thank you (and with ef1fbd8 also copied next to binaries if using Magnum as a subproject), besides that I discovered there's Besides that, for the record, I found that since 3.12 there actually seems to be a standard way to supply package prefixes -- <PackageName>_ROOT. Didn't have a chance to look further into this, but seems to be a way to supply a different root for each particular find_package call. |
Hi, this change aims to help windows users that use
Sdl2Application
.First, it makes use of
SDL2_PATH
(if set) as a HINT path for finding the library instead of always relying onCMAKE_PREFIX_PATH
.Then, it also exposes
SDL2_BIN_DIR
if SDL is found.This way, the windows users can decide if they want to copy the SDL DLLs automatically with the following (or similar) snippet:
Without this change, detecting the bin folder while allowing crosscompiling (vs, mingw, clang, etc) isn't trivial.
Thanks!