Support building against system pugixml (#7119)
Add a SYSTEM_PUGIXML CMake option that can be used to build the package against system-provided version of pugixml instead of the vendored one. Multiple Linux distributions have a policy against bundling libraries, and in this particular case there doesn't seem to be any justification to using the bundled library version. Fixes #7118
This commit is contained in:
parent
9b387ad1b4
commit
35d7d2754d
1 changed files with 10 additions and 2 deletions
|
|
@ -28,8 +28,13 @@ elseif (UNIX)
|
|||
file(GLOB arch_sources "unix/*.cpp")
|
||||
endif()
|
||||
|
||||
include_directories("../../../ext/pugixml/src")
|
||||
list(APPEND arch_sources "../../../ext/pugixml/src/pugixml.cpp")
|
||||
option(SYSTEM_PUGIXML "Use system pugixml instead of vendored one" OFF)
|
||||
if (SYSTEM_PUGIXML)
|
||||
find_package(pugixml REQUIRED)
|
||||
else()
|
||||
include_directories("../../../ext/pugixml/src")
|
||||
list(APPEND arch_sources "../../../ext/pugixml/src/pugixml.cpp")
|
||||
endif()
|
||||
|
||||
list(APPEND sources ${arch_sources})
|
||||
list(APPEND headers ${arch_headers})
|
||||
|
|
@ -53,3 +58,6 @@ if (UNIX)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (SYSTEM_PUGIXML)
|
||||
target_link_libraries(synlib pugixml)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in a new issue