From 1554d6a2c7bc03cb47c4147286eb9c64439716b7 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 16 May 2022 14:58:17 +0200 Subject: [PATCH] Try to fix linking of expat --- CMakeLists.txt | 8 ++++++-- src/CMakeLists.txt | 2 +- src/libslic3r/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d5f96acd9..002cd3456 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -463,8 +463,12 @@ include_directories(BEFORE SYSTEM ${EIGEN3_INCLUDE_DIR}) find_package(EXPAT REQUIRED) -if (NOT TARGET EXPAT::EXPAT AND TARGET expat::expat) - add_library(EXPAT::EXPAT ALIAS expat::expat) +add_library(libexpat INTERFACE) + +if (TARGET EXPAT::EXPAT ) + target_link_libraries(libexpat INTERFACE EXPAT::EXPAT) +elseif(TARGET expat::expat) + target_link_libraries(libexpat INTERFACE expat::expat) endif () find_package(PNG REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f8430e968..801760b8c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -92,7 +92,7 @@ if (SLIC3R_GUI) string(REGEX MATCH "wxexpat" WX_EXPAT_BUILTIN ${wxWidgets_LIBRARIES}) if (EXPAT_FOUND AND NOT WX_EXPAT_BUILTIN) list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX expat) - list(APPEND wxWidgets_LIBRARIES EXPAT::EXPAT) + list(APPEND wxWidgets_LIBRARIES libexpat) endif () # This is an issue in the new wxWidgets cmake build, doesn't deal with librt diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index c9d8aa4fa..396eb0764 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -372,7 +372,7 @@ target_link_libraries(libslic3r boost_libs clipper nowide - EXPAT::EXPAT + libexpat glu-libtess qhull semver