File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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,22 @@ 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+ endif ()
22+
23+ ## Create aliases for common expat target names
24+ # The config file creates expat::expat
25+ if (TARGET expat::expat AND NOT TARGET EXPAT::EXPAT)
26+ add_library (EXPAT::EXPAT ALIAS expat::expat )
27+ endif ()
28+
29+ # The find module creates EXPAT::EXPAT
30+ if (TARGET EXPAT::EXPAT AND NOT TARGET expat::expat)
31+ add_library (expat::expat ALIAS EXPAT::EXPAT )
1832endif ()
1933
2034include (${CMAKE_CURRENT_LIST_DIR} /liblcf-targets.cmake )
You can’t perform that action at this time.
0 commit comments