From fa0a91785dffb9b59fa503f979a8b4aeb78eb658 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 5 Jan 2025 15:09:15 +0100 Subject: [PATCH] Add in-build alias matching exported targts Allows users to use namespaced CMake targets, regardless of using a subdirectory or the CMake config package. --- src/bin/CMakeLists.txt | 1 + src/platform/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index e69cf51ac5..f9fffce610 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -11,6 +11,7 @@ endif() if(BUILD_SHARED_LIBS) add_library(msquic SHARED ${SOURCES}) + add_library(msquic::msquic ALIAS msquic) target_include_directories(msquic PUBLIC $) target_link_libraries(msquic PRIVATE core msquic_platform inc warnings logging base_link main_binary_link_args) set_target_properties(msquic PROPERTIES OUTPUT_NAME ${QUIC_LIBRARY_NAME}) diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt index 276692a6c2..61c898a8af 100644 --- a/src/platform/CMakeLists.txt +++ b/src/platform/CMakeLists.txt @@ -60,6 +60,7 @@ else() endif() add_library(msquic_platform STATIC ${SOURCES}) +add_library(msquic::platform ALIAS msquic_platform) set_target_properties(msquic_platform PROPERTIES EXPORT_NAME platform) if("${CX_PLATFORM}" STREQUAL "windows")