-
Notifications
You must be signed in to change notification settings - Fork 993
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
Macro conan_package_library_targets
reverted to single config
#11859
Macro conan_package_library_targets
reverted to single config
#11859
Conversation
…:lasote/conan into bugfix/cmakedeps_linked_libs_multiconfig
set(_out_libraries_target "") | ||
set(_CONAN_ACTUAL_TARGETS "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was not needed, not related with the bug
foreach(_CONAN_ACTUAL_TARGET ${_CONAN_ACTUAL_TARGETS}) | ||
get_target_property(linked_libs ${_CONAN_ACTUAL_TARGET} INTERFACE_LINK_LIBRARIES) | ||
message(VERBOSE "Target Properties: ${_CONAN_ACTUAL_TARGET} INTERFACE_LINK_LIBRARIES ='${linked_libs}'") | ||
foreach(_T ${_out_libraries_target}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pure refactor to not use _CONAN_ACTUAL_TARGETS
but _out_libraries_target
@@ -96,7 +96,7 @@ def template(self): | |||
set_property(TARGET {{root_target_name}} | |||
PROPERTY INTERFACE_LINK_LIBRARIES | |||
$<$<CONFIG:{{configuration}}>:{{ '${'+pkg_name+'_OBJECTS'+config_suffix+'}' }}> | |||
${{'{'}}{{pkg_name}}_LIBRARIES_TARGETS} | |||
$<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_LIBRARIES_TARGETS}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So now we have to "protect" these library targets with the configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this is exactly what I meant! Doing this by locally modifying generated cmake files is exactly how I worked around the issue ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!!
Changelog: Bugfix: The CMakeDeps generator was not managing correctly the IMPORTED LOCATION of the libraries for different
build_type
.Docs: omit
Close #11852
After investigating (thanks @jcar87) looks like the
IMPORTED_LOCATION_<build_type>
doesn't make the targets of the library files multi-config, CMake only uses it as a priority based on other things like the config mappings. More (cryptic) info can be found here: https://gitlab.kitware.com/cmake/cmake/-/issues/16280So I decided to revert that part of the macro keeping the improvements introduced in the last release, that so far have worked ok.