-
Notifications
You must be signed in to change notification settings - Fork 998
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: <name>_LIBRARIES
variable is not suitable for macros like check_symbol_exists
#12180
Comments
similar issue as #12012 |
The CMake documentation specifies that targets are actually a valid input for anything that relies on The problem here is that the targets generated by A possible solution is to simply tell CMake to forward the current configuration to the
Alternatively, this fix in upstream CMake https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8016 might help - I believe it made it to CMake 3.26. I still need to test if it solves this particular issue, as the underlying cause has to do with the targets generated by CMakeDeps having gen-ex conditionals that depend on the build type. |
I can test with dcmtk. |
It doesn't seem to work. I've tested in dcmtk recipe:
But still get this error during CMake configuration (macOS x86_64/Release/all shared/apple-clang 15/CMake 3.27.7/conan 2.0.13/Ninja generator):
|
Adding I'll be adding this workaround just in case for any recipes that make use of compilation tests with |
We are releasing in Conan 2.9 a completely new
Current known pending functionality (to be added soon):
The new Your feedback is very importantAs this is a major change, we will only remove the conf gate when we get confirmation from users that it works and solve the issues. Please try the new generator for your project, and let us know if it works. If it doesn't, please re-open this ticket and let us know what failed. Thanks very much! |
Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
CMakeLists.txt
test succeeds with
cmake_find_package
:test fails with
CMakeDeps
:CMAKE_REQUIRED_INCLUDES
works fine here, but notCMAKE_REQUIRED_LIBRARIES
, becausezstd_LIBRARIES
is set to zstd imported target instead of full paths of all libraries.According to CMake documentation,
check_c_source_compiles
allows imported targets inCMAKE_REQUIRED_LIBRARIES
, but they don't say anything forcheck_symbol_exists
.It's quite annoying for conan v2 migration of several CCI recipes.
Logs (Executed commands with output) (Include/Attach if Applicable)
CMakeError.log
ofCMakeDeps
test:The text was updated successfully, but these errors were encountered: