Open uilianries opened 2 years ago
Thanks for the report. cf https://github.com/conan-io/conan-center-index/pull/13228 for an example of actual failure caused by this issue
Hi there! Thanks for reporting this.
I am trying to replicate this on my end, but I see the "unsuffixed" variables being generated.
With the following conanfile.txt
:
[requires]
zlib/1.2.12
opencv/4.5.5
[generators]
CMakeDeps
CMakeToolchain
After running conan install
on 1.53.0
, I get:
ZLIBConfig.cmake
:
set(ZLIB_VERSION_STRING "1.2.12")
set(ZLIB_INCLUDE_DIRS ${zlib_INCLUDE_DIRS_RELEASE} )
set(ZLIB_INCLUDE_DIR ${zlib_INCLUDE_DIRS_RELEASE} )
set(ZLIB_LIBRARIES ${zlib_LIBRARIES_RELEASE} )
set(ZLIB_DEFINITIONS ${zlib_DEFINITIONS_RELEASE} )
OpenCVConfig.cmake
:
set(OpenCV_VERSION_STRING "4.5.5")
set(OpenCV_INCLUDE_DIRS ${opencv_INCLUDE_DIRS_RELEASE} )
set(OpenCV_INCLUDE_DIR ${opencv_INCLUDE_DIRS_RELEASE} )
set(OpenCV_LIBRARIES ${opencv_LIBRARIES_RELEASE} )
set(OpenCV_DEFINITIONS ${opencv_DEFINITIONS_RELEASE} )
`OpenSSLConfig.cmake:
set(OpenSSL_VERSION_STRING "1.1.1q")
set(OpenSSL_INCLUDE_DIRS ${openssl_INCLUDE_DIRS_RELEASE} )
set(OpenSSL_INCLUDE_DIR ${openssl_INCLUDE_DIRS_RELEASE} )
set(OpenSSL_LIBRARIES ${openssl_LIBRARIES_RELEASE} )
set(OpenSSL_DEFINITIONS ${openssl_DEFINITIONS_RELEASE} )
I can see these variables pretty much in all generated xxConfig.cmake
files. Is there anything I'm missing?
The variables related each component do not have a suffix-less alternative, eg OpenSSL_Crypto_LIBS
, OpenSSL_Crypto_DEPENDENCIES
, OpenSSL_Crypto_FRAMEWORKS
and OpenSSL_Crypto_SYSTEM_LIBS
The variables related each component do not have a suffix-less alternative
Specifically, which variables would need to be defined that currently aren't?
Sorry, I edited my message at the same time you sent your question. we got a race condition here 😉
missing variables are OpenSSL_Crypto_LIBS
, OpenSSL_Crypto_DEPENDENCIES
, OpenSSL_Crypto_FRAMEWORKS
and OpenSSL_Crypto_SYSTEM_LIBS
Sorry, I edited my message at the same time you sent your question. we got a race condition here 😉 missing variables are
OpenSSL_Crypto_LIBS
,OpenSSL_Crypto_DEPENDENCIES
,OpenSSL_Crypto_FRAMEWORKS
andOpenSSL_Crypto_SYSTEM_LIBS
Hehe, it happens.
Perfect, I think we have enough information to look closer into this one. thanks!! :)
friendly ping @jcar87 What is the status of this issue ?
re-ping @jcar87 do you need more information ?
When consuming targets and CMake variables generated by CMakeDeps, it generates all variables with a suffix based on its configuration:
https://github.com/conan-io/conan/blob/47353ab2e38b7cf5638dfce26d1fd2640eb2775e/conan/tools/cmake/cmakedeps/templates/__init__.py#L78
As result, it regenerates variables like
FOO_LIBS_RELEASE
andfoo_COMPILE_DEFINITIONS_RELEASE
.The question is, how to generate only
FOO_LIBS
(without build type suffix)?We could try a workaround, forcing the
CMakeDeps
configuration, but fails:Some projects use
LIBS
instead ofLIBRARIES
and have been working so far, and forcing to patch only because Conan uses target multi feature sounds a bit aggressive./cc @ericLemanissier