-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds alternative CMake targets by creating an extra module and adding it to the cpp_info.build_modules property exposed by recent Conan versions.
- Loading branch information
1 parent
cc4875a
commit b2e5f3c
Showing
4 changed files
with
28 additions
and
2 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,19 @@ | ||
# This is included from the find modules generated by Conan. It creates | ||
# different targets. | ||
function(create_target_from_conan_name cmake_name conan_name) | ||
add_library(${cmake_name} INTERFACE IMPORTED) | ||
|
||
if(${conan_name}_INCLUDE_DIRS) | ||
set_target_properties(${cmake_name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES | ||
"${${conan_name}_INCLUDE_DIRS}") | ||
endif() | ||
set_property(TARGET ${cmake_name} PROPERTY INTERFACE_LINK_LIBRARIES | ||
"${${conan_name}_LIBRARIES_TARGETS};${${conan_name}_LINKER_FLAGS_LIST}") | ||
set_property(TARGET ${cmake_name} PROPERTY INTERFACE_COMPILE_DEFINITIONS | ||
${${conan_name}_COMPILE_DEFINITIONS}) | ||
set_property(TARGET ${cmake_name} PROPERTY INTERFACE_COMPILE_OPTIONS | ||
"${${conan_name}_COMPILE_OPTIONS_LIST}") | ||
endfunction() | ||
|
||
|
||
create_target_from_conan_name(lp3::main lp3-main) |
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