From fdae4a9817b01aacd70ab033dfac711af2acb61e Mon Sep 17 00:00:00 2001
From: Malte kleine Piening <mkl.piening@gmail.com>
Date: Tue, 18 Apr 2023 22:29:04 +0200
Subject: [PATCH] fixed double definition of target libexpat described in #9581

--- a/cmake/modules/FindEXPAT.cmake
+++ b/cmake/modules/FindEXPAT.cmake
@@ -25,7 +25,7 @@ if (NOT EXPAT_FOUND)
     endif ()
 endif()
 
-if (EXPAT_FOUND AND NOT TARGET EXPAT::EXPAT)
+if (EXPAT_FOUND AND NOT (TARGET EXPAT::EXPAT OR TARGET expat::expat))
     add_library(libexpat INTERFACE)
     add_library(EXPAT::EXPAT ALIAS libexpat)
     target_link_libraries(libexpat INTERFACE expat::expat)
