Skip to content

Commit

Permalink
Silence warning about existing alias if QUIET is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
BobIsOnFire committed Sep 1, 2023
1 parent ea6b41b commit 22f9683
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions conan/tools/cmake/cmakedeps/templates/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def template(self):
add_library({{alias}} INTERFACE IMPORTED)
set_property(TARGET {{ alias }} PROPERTY INTERFACE_LINK_LIBRARIES {{target}})
else()
message(WARNING "Target name '{{alias}}' already exists.")
if(NOT {{ file_name }}_FIND_QUIETLY)
message(WARNING "Target name '{{alias}}' already exists.")
endif()
endif()
{%- endfor %}
Expand All @@ -94,7 +96,9 @@ def template(self):
add_library({{alias}} INTERFACE IMPORTED)
set_property(TARGET {{ alias }} PROPERTY INTERFACE_LINK_LIBRARIES {{target}})
else()
message(WARNING "Target name '{{alias}}' already exists.")
if(NOT {{ file_name }}_FIND_QUIETLY)
message(WARNING "Target name '{{alias}}' already exists.")
endif()
endif()
{%- endfor %}
Expand Down

0 comments on commit 22f9683

Please sign in to comment.