diff --git a/CMakeLists.txt b/CMakeLists.txt index 003ad77c4..7072537f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,7 +229,6 @@ INCLUDE_DIRECTORIES( BEFORE include ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include - contrib/pugixml/src ) LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules" ) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 8accf5690..5a4e2dafd 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -862,11 +862,16 @@ SET( Extra_SRCS SOURCE_GROUP( Extra FILES ${Extra_SRCS}) # pugixml -SET( Pugixml_SRCS - ../contrib/pugixml/src/pugiconfig.hpp - ../contrib/pugixml/src/pugixml.hpp -) -SOURCE_GROUP( Contrib\\Pugixml FILES ${Pugixml_SRCS}) +IF(ASSIMP_HUNTER_ENABLED) + hunter_add_package(pugixml) + find_package(pugixml CONFIG REQUIRED) +ELSE() + SET( Pugixml_SRCS + ../contrib/pugixml/src/pugiconfig.hpp + ../contrib/pugixml/src/pugixml.hpp + ) + SOURCE_GROUP( Contrib\\Pugixml FILES ${Pugixml_SRCS}) +ENDIF() # utf8 IF(ASSIMP_HUNTER_ENABLED) @@ -1026,6 +1031,7 @@ IF(ASSIMP_HUNTER_ENABLED) ELSE() INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" ) INCLUDE_DIRECTORIES( "../contrib" ) + INCLUDE_DIRECTORIES( "../contrib/pugixml/src" ) ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1 ) ADD_DEFINITIONS( -DRAPIDJSON_NOMEMBERITERATORCLASS ) ENDIF() @@ -1136,6 +1142,7 @@ IF(ASSIMP_HUNTER_ENABLED) RapidJSON::rapidjson utf8cpp zip::zip + pugixml ) ELSE() TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6f46b5ce9..7f6d2ac86 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -48,6 +48,7 @@ if(NOT ASSIMP_HUNTER_ENABLED) INCLUDE_DIRECTORIES( ${Assimp_SOURCE_DIR}/contrib/gtest/include ${Assimp_SOURCE_DIR}/contrib/gtest/ + ${Assimp_SOURCE_DIR}/contrib/pugixml/src ) endif()