File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -394,13 +394,14 @@ if(LIBLCF_WITH_XML)
394394 find_package (expat CONFIG)
395395 if (expat_FOUND)
396396 target_link_libraries (lcf expat::expat)
397+ set (LCF_SUPPORT_XML 1)
397398 else ()
398399 # Fallback to old expat detection
399400 find_package (EXPAT REQUIRED)
400401 target_link_libraries (lcf EXPAT::EXPAT)
402+ set (LCF_SUPPORT_XML 2)
401403 endif ()
402404 list (APPEND LIBLCF_DEPS "expat" )
403- set (LCF_SUPPORT_XML 1)
404405endif ()
405406
406407# 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