Skip to content
Permalink
Browse files
Merge pull request #6652 from leoetlino/shared-pugixml
CMake: Use system-wide pugixml if available
  • Loading branch information
lioncash committed Apr 17, 2018
2 parents c78b3f6 + f4ec261 commit 41f07a8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
@@ -0,0 +1,14 @@
find_path(pugixml_INCLUDE_DIRS pugixml.hpp)
find_library(pugixml_LIBRARIES NAMES pugixml)
mark_as_advanced(pugixml_INCLUDE_DIRS pugixml_LIBRARIES)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(pugixml REQUIRED_VARS pugixml_LIBRARIES pugixml_INCLUDE_DIRS)

if(Pugixml_FOUND AND NOT TARGET pugixml)
add_library(pugixml UNKNOWN IMPORTED)
set_target_properties(pugixml PROPERTIES
IMPORTED_LOCATION "${pugixml_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${pugixml_INCLUDE_DIRS}"
)
endif()
@@ -533,7 +533,12 @@ endif()
add_subdirectory(Externals/Bochs_disasm)
add_subdirectory(Externals/cpp-optparse)
add_subdirectory(Externals/glslang)
add_subdirectory(Externals/pugixml)

find_package(Pugixml)
if(NOT Pugixml_FOUND)
message(STATUS "Using static pugixml from Externals")
add_subdirectory(Externals/pugixml)
endif()

if(USE_SHARED_ENET)
check_lib(ENET libenet enet enet/enet.h QUIET)

0 comments on commit 41f07a8

Please sign in to comment.