Skip to content

Commit

Permalink
Add IMPORTED_CONFIGURATIONS property for CMake targets
Browse files Browse the repository at this point in the history
Some frameworks use the property in order to find libraries, e.g. like
https://github.com/ros/catkin/blob/noetic-devel/cmake/catkin_libraries.cmake#L150

In order to support these kind of usages, this commit adds the property
to all targets.

This should solve #14606 and #16688.
  • Loading branch information
Martin Lambertsen committed Jul 21, 2024
1 parent 47d4e74 commit 4084b6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conan/tools/cmake/cmakedeps/templates/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def template(self):
message(DEBUG "Created target ${_LIB_NAME} ${library_type} IMPORTED")
set_target_properties(${_LIB_NAME} PROPERTIES IMPORTED_LOCATION${config_suffix} ${CONAN_FOUND_LIBRARY} IMPORTED_NO_SONAME ${no_soname_mode})
endif()
string(REGEX REPLACE "^_" "" _LOWER_CASE_CONFIG ${config_suffix})
string(TOUPPER ${_LOWER_CASE_CONFIG} _CONFIG)
set_target_properties(${_LIB_NAME} PROPERTIES IMPORTED_CONFIGURATIONS ${_CONFIG})
list(APPEND _out_libraries_target ${_LIB_NAME})
message(VERBOSE "Conan: Found: ${CONAN_FOUND_LIBRARY}")
else()
Expand Down

0 comments on commit 4084b6d

Please sign in to comment.