File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -389,13 +389,14 @@ if(LIBLCF_WITH_XML)
389389 find_package (expat CONFIG)
390390 if (expat_FOUND)
391391 target_link_libraries (lcf expat::expat)
392+ set (LCF_SUPPORT_XML 1)
392393 else ()
393394 # Fallback to old expat detection
394395 find_package (EXPAT REQUIRED)
395396 target_link_libraries (lcf EXPAT::EXPAT)
397+ set (LCF_SUPPORT_XML 2)
396398 endif ()
397399 list (APPEND LIBLCF_DEPS "expat" )
398- set (LCF_SUPPORT_XML 1)
399400endif ()
400401
401402# mime types
Original file line number Diff line number Diff line change @@ -13,8 +13,16 @@ if(@LCF_SUPPORT_ICU@ EQUAL 1)
1313 find_dependency(ICU COMPONENTS i18n uc data REQUIRED)
1414endif ()
1515
16- if (@LCF_SUPPORT_XML@)
16+ if (@LCF_SUPPORT_XML@ EQUAL 1 )
1717 find_dependency(expat CONFIG REQUIRED)
18+ elseif (@LCF_SUPPORT_XML@ EQUAL 2)
19+ # Fallback to old expat detection
20+ find_dependency(EXPAT REQUIRED)
21+
22+ # Ensure correct target name when the expat config file is used
23+ if (TARGET expat::expat AND NOT TARGET EXPAT::EXPAT)
24+ add_library (EXPAT::EXPAT ALIAS expat::expat)
25+ endif ()
1826endif ()
1927
2028include (${CMAKE_CURRENT_LIST_DIR} /liblcf-targets.cmake)
You can’t perform that action at this time.
0 commit comments