From a1cac3bbe48c9f3f74da61128a8f5b27bae247e4 Mon Sep 17 00:00:00 2001 From: Markus Rickert Date: Sat, 22 May 2021 14:51:26 +0200 Subject: [PATCH] Add CMake alias targets for embedded projects --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a437717b..e8bf2429 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -414,6 +414,7 @@ if(LIBXML2_WITH_TRIO) endif() add_library(LibXml2 ${LIBXML2_HDRS} ${LIBXML2_SRCS}) +add_library(LibXml2::LibXml2 ALIAS LibXml2) if(NOT BUILD_SHARED_LIBS) target_compile_definitions(LibXml2 INTERFACE LIBXML_STATIC) @@ -537,6 +538,7 @@ if(LIBXML2_WITH_PROGRAMS) ) foreach(PROGRAM ${PROGRAMS}) add_executable(${PROGRAM} ${PROGRAM}.c) + add_executable(LibXml2::${PROGRAM} ALIAS ${PROGRAM}) target_link_libraries(${PROGRAM} LibXml2) if(HAVE_LIBHISTORY) target_link_libraries(${PROGRAM} history)