# Avoid multiple calls to find_package to append duplicated properties to the targets include_guard()########### VARIABLES ####################################################################### ############################################################################################# set(fmt_FRAMEWORKS_FOUND_NONE "") # Will be filled later conan_find_apple_frameworks(fmt_FRAMEWORKS_FOUND_NONE "${fmt_FRAMEWORKS_NONE}" "${fmt_FRAMEWORK_DIRS_NONE}") set(fmt_LIBRARIES_TARGETS "") # Will be filled later ######## Create an interface target to contain all the dependencies (frameworks, system and conan deps) if(NOT TARGET fmt_DEPS_TARGET) add_library(fmt_DEPS_TARGET INTERFACE IMPORTED) endif() set_property(TARGET fmt_DEPS_TARGET APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$:${fmt_FRAMEWORKS_FOUND_NONE}> $<$:${fmt_SYSTEM_LIBS_NONE}> $<$:>) ####### Find the libraries declared in cpp_info.libs, create an IMPORTED target for each one and link the ####### fmt_DEPS_TARGET to all of them conan_package_library_targets("${fmt_LIBS_NONE}" # libraries "${fmt_LIB_DIRS_NONE}" # package_libdir "${fmt_BIN_DIRS_NONE}" # package_bindir "${fmt_LIBRARY_TYPE_NONE}" "${fmt_IS_HOST_WINDOWS_NONE}" fmt_DEPS_TARGET fmt_LIBRARIES_TARGETS # out_libraries_targets "_NONE" "fmt" # package_name "${fmt_NO_SONAME_MODE_NONE}") # soname # FIXME: What is the result of this for multi-config? All configs adding themselves to path? set(CMAKE_MODULE_PATH ${fmt_BUILD_DIRS_NONE} ${CMAKE_MODULE_PATH}) ########## COMPONENTS TARGET PROPERTIES None ######################################## ########## COMPONENT fmt::fmt ############# set(fmt_fmt_fmt_FRAMEWORKS_FOUND_NONE "") conan_find_apple_frameworks(fmt_fmt_fmt_FRAMEWORKS_FOUND_NONE "${fmt_fmt_fmt_FRAMEWORKS_NONE}" "${fmt_fmt_fmt_FRAMEWORK_DIRS_NONE}") set(fmt_fmt_fmt_LIBRARIES_TARGETS "") ######## Create an interface target to contain all the dependencies (frameworks, system and conan deps) if(NOT TARGET fmt_fmt_fmt_DEPS_TARGET) add_library(fmt_fmt_fmt_DEPS_TARGET INTERFACE IMPORTED) endif() set_property(TARGET fmt_fmt_fmt_DEPS_TARGET APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$:${fmt_fmt_fmt_FRAMEWORKS_FOUND_NONE}> $<$:${fmt_fmt_fmt_SYSTEM_LIBS_NONE}> $<$:${fmt_fmt_fmt_DEPENDENCIES_NONE}> ) ####### Find the libraries declared in cpp_info.component["xxx"].libs, ####### create an IMPORTED target for each one and link the 'fmt_fmt_fmt_DEPS_TARGET' to all of them conan_package_library_targets("${fmt_fmt_fmt_LIBS_NONE}" "${fmt_fmt_fmt_LIB_DIRS_NONE}" "${fmt_fmt_fmt_BIN_DIRS_NONE}" # package_bindir "${fmt_fmt_fmt_LIBRARY_TYPE_NONE}" "${fmt_fmt_fmt_IS_HOST_WINDOWS_NONE}" fmt_fmt_fmt_DEPS_TARGET fmt_fmt_fmt_LIBRARIES_TARGETS "_NONE" "fmt_fmt_fmt" "${fmt_fmt_fmt_NO_SONAME_MODE_NONE}") ########## TARGET PROPERTIES ##################################### set_property(TARGET fmt::fmt APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$:${fmt_fmt_fmt_OBJECTS_NONE}> $<$:${fmt_fmt_fmt_LIBRARIES_TARGETS}> ) if("${fmt_fmt_fmt_LIBS_NONE}" STREQUAL "") # If the component is not declaring any "cpp_info.components['foo'].libs" the system, frameworks etc are not # linked to the imported targets and we need to do it to the global target set_property(TARGET fmt::fmt APPEND PROPERTY INTERFACE_LINK_LIBRARIES fmt_fmt_fmt_DEPS_TARGET) endif() set_property(TARGET fmt::fmt APPEND PROPERTY INTERFACE_LINK_OPTIONS $<$:${fmt_fmt_fmt_LINKER_FLAGS_NONE}>) set_property(TARGET fmt::fmt APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<$:${fmt_fmt_fmt_INCLUDE_DIRS_NONE}>) set_property(TARGET fmt::fmt APPEND PROPERTY INTERFACE_LINK_DIRECTORIES $<$:${fmt_fmt_fmt_LIB_DIRS_NONE}>) set_property(TARGET fmt::fmt APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$:${fmt_fmt_fmt_COMPILE_DEFINITIONS_NONE}>) set_property(TARGET fmt::fmt APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $<$:${fmt_fmt_fmt_COMPILE_OPTIONS_NONE}>) ########## AGGREGATED GLOBAL TARGET WITH THE COMPONENTS ##################### set_property(TARGET fmt::fmt APPEND PROPERTY INTERFACE_LINK_LIBRARIES fmt::fmt) ########## For the modules (FindXXX) set(fmt_LIBRARIES_NONE fmt::fmt)