-
Notifications
You must be signed in to change notification settings - Fork 985
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
[bug] CMakeDeps: issues when import library (.lib) and DLL (.dll) have a different filename #16926
Comments
Now we start to have a way to start specifying these things, since CPS initial support was merged:
This is still not used at all by CMakeDeps, but we have a way to pass information, it would be necessary to start leveraging it in CMakeDeps. |
Hello, i have encountered the same situation. When building curl 7.85.0 in Windows as a shared library, i get
where libcurl_imp is actually an import library, and in particular, the generated cmake-files specify
which should be able to be set by the package_info method. Is there a work-around? |
Hi @chfuerst We have added a new @franramirez688 is working also on better auto-detection of these libraries in the Python code, please @franramirez688 make sure to add this case to the test suite |
Thank you very much @memsharded - i have tried to read from the documentation how to explicitly overwrite the names.
which is assigned from the result of
but unfortunately i do not see how different names of IMPORTED_LOCATION and IMPORTED_IMPLIB are handled. Could you please give an example as in curl above? Thx, Christoph |
Hi @chfuerst This has been implemented in #17296, for next Conan 2.10. It will be used in the new |
Describe the bug
CMakeDeps uses the library name passed to
cpp_info.libs
to locate both the import library (.lib) and the DLL (.dll):conan/conan/tools/cmake/cmakedeps/templates/macros.py
Lines 60 to 67 in 157aa67
While it is common, it is not a hard requirement for both files to have the same leaf name but a different extension. We can link against a
foo.lib
that will introduce a dependency onbar.dll
(instead offoo.dll
), and it is perfectly valid - the name of the corresponding dll is encoded in the import library. According to a comment here: https://stackoverflow.com/questions/52821978/get-a-dll-name-from-import-library, a single .lib may require multiple DLLs (although we need to find a more authoritative source for this)However, the
cpp_info.libs
model does not have a facility to express cases where the filenames are different. Conan will display a warning, as in most cases, CMake does "nothing" with the DLL and only the .lib file is required to link. However, some consumer projects may perform target introspection to derive the name of the DLL.Details here conan-io/conan-center-index#25076 (comment)
Related to: #12654
How to reproduce it
No response
The text was updated successfully, but these errors were encountered: