-
Notifications
You must be signed in to change notification settings - Fork 986
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add tools.create_cmake_module_alias_targets
Signed-off-by: SSE4 <[email protected]>
- Loading branch information
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from conans.client.tools.files import save | ||
|
||
|
||
def create_cmake_module_alias_targets(_, module, targets): | ||
content = "" | ||
for alias, aliased in targets.items(): | ||
content += "if(TARGET {aliased} AND NOT TARGET {alias})\n" \ | ||
" add_library({alias} INTERFACE IMPORTED)\n" \ | ||
" set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased})\n" \ | ||
"endif()\n".format(alias=alias, aliased=aliased) | ||
save(module, content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters