mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-05 18:10:48 +08:00
Merge branch 'tm_fix_cmake_expat'
This commit is contained in:
commit
d389b69f3b
@ -465,10 +465,12 @@ find_package(EXPAT REQUIRED)
|
||||
|
||||
add_library(libexpat INTERFACE)
|
||||
|
||||
if (TARGET EXPAT::EXPAT )
|
||||
if (TARGET EXPAT::EXPAT ) # found by a newer Find script
|
||||
target_link_libraries(libexpat INTERFACE EXPAT::EXPAT)
|
||||
elseif(TARGET expat::expat)
|
||||
elseif(TARGET expat::expat) # found by a config script
|
||||
target_link_libraries(libexpat INTERFACE expat::expat)
|
||||
else() # found by an older Find script
|
||||
target_link_libraries(libexpat INTERFACE ${EXPAT_LIBRARIES})
|
||||
endif ()
|
||||
|
||||
find_package(PNG REQUIRED)
|
||||
|
@ -1,36 +0,0 @@
|
||||
set(_q "")
|
||||
if(EXPAT_FIND_QUIETLY)
|
||||
set(_q QUIET)
|
||||
endif()
|
||||
find_package(EXPAT ${EXPAT_FIND_VERSION} CONFIG ${_q})
|
||||
|
||||
if(NOT EXPAT_FIND_QUIETLY)
|
||||
if (NOT EXPAT_FOUND)
|
||||
message(STATUS "Falling back to MODULE search for EXPAT...")
|
||||
else()
|
||||
message(STATUS "EXPAT found in ${EXPAT_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT EXPAT_FOUND)
|
||||
set(_modpath ${CMAKE_MODULE_PATH})
|
||||
set(CMAKE_MODULE_PATH "")
|
||||
include(FindEXPAT)
|
||||
set(CMAKE_MODULE_PATH ${_modpath})
|
||||
|
||||
if (NOT TARGET EXPAT::EXPAT)
|
||||
add_library(EXPAT::EXPAT INTERFACE)
|
||||
target_link_libraries(EXPAT::EXPAT INTERFACE ${EXPAT_LIBRARIES})
|
||||
target_include_directories(EXPAT::EXPAT INTERFACE ${EXPAT_INCLUDE_DIRS})
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
if (EXPAT_FOUND AND NOT TARGET EXPAT::EXPAT)
|
||||
add_library(libexpat INTERFACE)
|
||||
add_library(EXPAT::EXPAT ALIAS libexpat)
|
||||
target_link_libraries(libexpat INTERFACE expat::expat)
|
||||
if (NOT EXPAT_LIBRARIES)
|
||||
set(EXPAT_LIBRARIES expat::expat CACHE STRING "")
|
||||
endif ()
|
||||
endif ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user