Try to fix linking of expat

This commit is contained in:
tamasmeszaros 2022-05-16 14:58:17 +02:00
parent 3a7cdeeae4
commit 1554d6a2c7
3 changed files with 8 additions and 4 deletions

View File

@ -463,8 +463,12 @@ include_directories(BEFORE SYSTEM ${EIGEN3_INCLUDE_DIR})
find_package(EXPAT REQUIRED) find_package(EXPAT REQUIRED)
if (NOT TARGET EXPAT::EXPAT AND TARGET expat::expat) add_library(libexpat INTERFACE)
add_library(EXPAT::EXPAT ALIAS expat::expat)
if (TARGET EXPAT::EXPAT )
target_link_libraries(libexpat INTERFACE EXPAT::EXPAT)
elseif(TARGET expat::expat)
target_link_libraries(libexpat INTERFACE expat::expat)
endif () endif ()
find_package(PNG REQUIRED) find_package(PNG REQUIRED)

View File

@ -92,7 +92,7 @@ if (SLIC3R_GUI)
string(REGEX MATCH "wxexpat" WX_EXPAT_BUILTIN ${wxWidgets_LIBRARIES}) string(REGEX MATCH "wxexpat" WX_EXPAT_BUILTIN ${wxWidgets_LIBRARIES})
if (EXPAT_FOUND AND NOT WX_EXPAT_BUILTIN) if (EXPAT_FOUND AND NOT WX_EXPAT_BUILTIN)
list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX expat) list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX expat)
list(APPEND wxWidgets_LIBRARIES EXPAT::EXPAT) list(APPEND wxWidgets_LIBRARIES libexpat)
endif () endif ()
# This is an issue in the new wxWidgets cmake build, doesn't deal with librt # This is an issue in the new wxWidgets cmake build, doesn't deal with librt

View File

@ -372,7 +372,7 @@ target_link_libraries(libslic3r
boost_libs boost_libs
clipper clipper
nowide nowide
EXPAT::EXPAT libexpat
glu-libtess glu-libtess
qhull qhull
semver semver