-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add support for select_library_configurations #7
Add support for select_library_configurations #7
Conversation
Can you describe what this does? I haven't seen that before. |
Sure, but I'mnnit sure what more I could add to the CMake docs whereiit's explained quite well https://cmake.org/cmake/help/latest/module/SelectLibraryConfigurations.html Let me know what kind of info you're missing |
In essence, you want the FindLibRaw module to search for debug variants as well, named I'm missing some motivation for this change. The CMake scripts don't build |
I'd argue the statement "CMake scripts don't build rawd or raw_rd" is not quite accurate, because this particular behaviour does not depend on the declared CMake configuration, but on CMake execution. I'll try to explain. On Windows, optimized and debug builds are 'incompatible' enough and, for optimal workflow, users of a library need both builds. It is common to deploy both, optimized and debug, builds of a library into common Please, consider the complete build workflow below which is quite common to Windows + MSVC environment. Here, I'm using Visual Studio 2019 and CMake 3.14, executing all commands in the
This technique is used by package managers which deploy both types of builds, for example, Vcpkg (see libraw/portfile.cmake). |
Thanks, that helped. To make this PR complete, why not additionally set |
Regarding your reference to vcpkg, I was under the impression that vcpkg installs debug libraries in a separate folder tree anyway, which then is correctly selected when using the vcpkg CMake toolchain file. Is that incorrect? If not, how can there be naming conflicts? |
Good point. Brad's comment make sense. I will update this PR.
This is correct. I was pointing at Vcpkg as example where it is used, but not necessarily for all the reasons I presented. AFAIS, Vcpkg still seem to follow the
|
What about this part? Lines 582 to 591 in d4e130a
LibRaw-cmake/cmake/data/libraw.pc.cmake Line 11 in c8a8028
If you have |
I was concerned about that and I'd be more comfortable with least intrusive change like this:
I just could not find any OS-specific recommendations regarding use of Shall I enable |
OK, let's do it for Windows only to avoid any potential issues. I think WIN32 is fine. |
The CMAKE_<CONFIG>_POSTFIX variable is not meant for direct reference by project code (e.g. explicitly set any properties, library names). The variable initializes the <CONFIG>_POSTFIX target property.
I updated the PR setting the postfix for WIN32 only. |
Thanks again for this and for your patience! Future PRs always welcome :) |
I'm happy to help. Thanks for merging. |
Ports a very useful patch from Vcpkg: https://github.com/microsoft/vcpkg/blob/b286cd50ddefb3d9457e261bf6518b1a46f4a830/ports/libraw/findlibraw_debug_fix.patch
Sets CMAKE_DEBUG_POSTFIX with "d" as default for WIN32.
References
On uses of
CMAKE_DEBUG_POSTFIX
: