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)