Set Corrade::rc as GLOBAL when cross-compiling#101
Conversation
Codecov Report
@@ Coverage Diff @@
## master #101 +/- ##
=======================================
Coverage 97.56% 97.56%
=======================================
Files 98 98
Lines 7185 7185
=======================================
Hits 7010 7010
Misses 175 175 Continue to review full report at Codecov.
|
|
This happens when crosscompiling and having Corrade as a CMake subproject, right? I'm not quite sure why would that be needed (no other target needs this |
|
Uh oh, how has it been fifteen days already 😅 So, I investigated with a subproject setup targeting Emscripten and realized that if I do this: add_subdirectory(corrade)
find_package(Corrade REQUIRED Utility)
corrade_add_resource(BLAH resources.conf)
add_library(main ${BLAH})which is the documented way, it works. While if I do this: add_subdirectory(corrade)
find_package(Corrade REQUIRED) # or no find_package at all
corrade_add_resource(BLAH resources.conf)
add_library(main ${BLAH})it doesn't. I gave this a bit of thought, and among all alternatives, setting the |
|
Hmm, I just realized that when |
https://stackoverflow.com/a/6891527/3021058, |
|
That won't help if you have the submodule in I'd say just use |
|
To circumvent thoses kind of issues when a dependency is shared amongst multiples subprojects, I always use some kind of a guard with something scopeless like : In this exemple, if IMO something here is missing in CMake to help detect multiple |
I don't think the users should need to care about this. I commonly call
In my workflow at least, that's not a problem either, because I just unconditionally call |
corrade_add_resourceseems unable to findcorrade-rcunless I set the imported target asGLOBAL.This change is quite harmless IMO, but maybe we should add a comment to justify it ?
Cheers !