From b6dde74155ccc43e7dbad037b5ff65a0126193fe Mon Sep 17 00:00:00 2001 From: kimkulling Date: Thu, 1 Oct 2020 16:35:34 +0200 Subject: [PATCH] adaptions to support hunter --- CMakeLists.txt | 2 +- code/CMakeLists.txt | 10 ++++++++-- contrib/CMakeLists.txt | 3 --- contrib/{pugixml-1.9 => pugixml}/CMakeLists.txt | 0 contrib/{pugixml-1.9 => pugixml}/contrib/foreach.hpp | 0 contrib/{pugixml-1.9 => pugixml}/readme.txt | 0 contrib/{pugixml-1.9 => pugixml}/src/pugiconfig.hpp | 0 contrib/{pugixml-1.9 => pugixml}/src/pugixml.cpp | 0 contrib/{pugixml-1.9 => pugixml}/src/pugixml.hpp | 0 test/CMakeLists.txt | 6 ++++-- tools/assimp_cmd/CMakeLists.txt | 2 +- 11 files changed, 14 insertions(+), 9 deletions(-) rename contrib/{pugixml-1.9 => pugixml}/CMakeLists.txt (100%) rename contrib/{pugixml-1.9 => pugixml}/contrib/foreach.hpp (100%) rename contrib/{pugixml-1.9 => pugixml}/readme.txt (100%) rename contrib/{pugixml-1.9 => pugixml}/src/pugiconfig.hpp (100%) rename contrib/{pugixml-1.9 => pugixml}/src/pugixml.cpp (100%) rename contrib/{pugixml-1.9 => pugixml}/src/pugixml.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 779424903..a68fca1f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,7 +229,7 @@ INCLUDE_DIRECTORIES( BEFORE include ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include - contrib/pugixml-1.9/src + 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 526547e7e..87af316bb 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -866,7 +866,12 @@ IF(ASSIMP_HUNTER_ENABLED) hunter_add_package(pugixml) find_package(pugixml CONFIG REQUIRED) ELSE() - add_subdirectory(../contrib/pugixml-1.9 ) + SET( Pugixml_SRCS + ../contrib/pugixml/src/pugiconfig.hpp + ../contrib/pugixml/src/pugixml.hpp + ../contrib/pugixml/src/pugixml.cpp + ) + SOURCE_GROUP( Contrib\\Pugixml FILES ${Pugixml_SRCS}) ENDIF() # utf8 @@ -1088,6 +1093,7 @@ SET( assimp_src ${openddl_parser_SRCS} ${open3dgc_SRCS} ${ziplib_SRCS} + ${Pugixml_SRCS} # Necessary to show the headers in the project when using the VC++ generator: ${PUBLIC_HEADERS} @@ -1139,7 +1145,7 @@ IF(ASSIMP_HUNTER_ENABLED) zip::zip ) ELSE() - TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} pugixml ) + TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ) ENDIF() if(ASSIMP_ANDROID_JNIIOSYSTEM) diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index e53832884..8b1378917 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -1,4 +1 @@ -IF(NOT ASSIMP_HUNTER_ENABLED) - add_subdirectory( pugixml-1.9 ) -ENDIF() diff --git a/contrib/pugixml-1.9/CMakeLists.txt b/contrib/pugixml/CMakeLists.txt similarity index 100% rename from contrib/pugixml-1.9/CMakeLists.txt rename to contrib/pugixml/CMakeLists.txt diff --git a/contrib/pugixml-1.9/contrib/foreach.hpp b/contrib/pugixml/contrib/foreach.hpp similarity index 100% rename from contrib/pugixml-1.9/contrib/foreach.hpp rename to contrib/pugixml/contrib/foreach.hpp diff --git a/contrib/pugixml-1.9/readme.txt b/contrib/pugixml/readme.txt similarity index 100% rename from contrib/pugixml-1.9/readme.txt rename to contrib/pugixml/readme.txt diff --git a/contrib/pugixml-1.9/src/pugiconfig.hpp b/contrib/pugixml/src/pugiconfig.hpp similarity index 100% rename from contrib/pugixml-1.9/src/pugiconfig.hpp rename to contrib/pugixml/src/pugiconfig.hpp diff --git a/contrib/pugixml-1.9/src/pugixml.cpp b/contrib/pugixml/src/pugixml.cpp similarity index 100% rename from contrib/pugixml-1.9/src/pugixml.cpp rename to contrib/pugixml/src/pugixml.cpp diff --git a/contrib/pugixml-1.9/src/pugixml.hpp b/contrib/pugixml/src/pugixml.hpp similarity index 100% rename from contrib/pugixml-1.9/src/pugixml.hpp rename to contrib/pugixml/src/pugixml.hpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d245ff522..c1111e5cb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -211,13 +211,15 @@ add_executable( unit ${IMPORTERS} ${MATERIAL} ${MATH} - ${POST_PROCESSES} + ${POST_PROCESSES} ) if(ASSIMP_HUNTER_ENABLED) hunter_add_package(GTest) find_package(GTest CONFIG REQUIRED) - target_link_libraries(unit GTest::gtest_main GTest::gmock) + hunter_add_package(pugixml) + find_package(pugixml CONFIG REQUIRED) + target_link_libraries(unit GTest::gtest_main GTest::gmock pugixml::pugixml) else() target_sources(unit PUBLIC ../contrib/gtest/src/gtest-all.cc) endif() diff --git a/tools/assimp_cmd/CMakeLists.txt b/tools/assimp_cmd/CMakeLists.txt index 50ac2ee19..a0eb98a89 100644 --- a/tools/assimp_cmd/CMakeLists.txt +++ b/tools/assimp_cmd/CMakeLists.txt @@ -63,7 +63,7 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp_cmd) SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) -TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES} pugixml ) +TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES} ) SET_TARGET_PROPERTIES( assimp_cmd PROPERTIES OUTPUT_NAME assimp )