diff --git a/CMakeLists.txt b/CMakeLists.txt index a9416391..3cbada53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ set(GZ_UTILS_VER ${gz-utils2_VERSION_MAJOR}) #-------------------------------------- # Find Tinyxml2 gz_find_package(TINYXML2 PRETTY tinyxml2 + VERSION 6.0 REQUIRED_BY graphics PRIVATE_FOR graphics) diff --git a/graphics/src/CMakeLists.txt b/graphics/src/CMakeLists.txt index 333a8155..0e3b965b 100644 --- a/graphics/src/CMakeLists.txt +++ b/graphics/src/CMakeLists.txt @@ -1,14 +1,5 @@ gz_get_libsources_and_unittests(sources gtest_sources) - -if(NOT USE_EXTERNAL_TINYXML2) - # If we are using our internal copy of tinyxml2, then add its - # source file. - message(STATUS "Adding tinyxml2 source files") - list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2/tinyxml2.cpp) -endif() - - gz_add_component(graphics SOURCES ${sources} GET_TARGET_NAME graphics_target) target_link_libraries(${graphics_target} diff --git a/graphics/src/ColladaExporter.cc b/graphics/src/ColladaExporter.cc index d3ec6bb3..fb210964 100644 --- a/graphics/src/ColladaExporter.cc +++ b/graphics/src/ColladaExporter.cc @@ -25,12 +25,6 @@ #include "tinyxml2.h" -#ifndef TINYXML2_MAJOR_VERSION_GE_6 -#if TINYXML2_MAJOR_VERSION >= 6 - #define TINYXML2_MAJOR_VERSION_GE_6 -#endif -#endif - #ifdef _WIN32 static const char pathSeparator = '\\'; #define snprintf _snprintf @@ -50,24 +44,10 @@ static void LogTinyXml2DocumentError( { warning += std::to_string(_doc.ErrorID()) + "): "; -#ifdef TINYXML2_MAJOR_VERSION_GE_6 const char * error1 = _doc.ErrorStr(); -#else - const char * error1 = _doc.GetErrorStr1(); -#endif if (error1) warning += "str1=" + std::string(error1); - -#ifndef TINYXML2_MAJOR_VERSION_GE_6 - const char * error2 = _doc.GetErrorStr2(); - - if (error1 && error2) - warning += ", "; - - if (error2) - warning += "str2=" + std::string(error2); -#endif } else { diff --git a/graphics/src/SVGLoader.cc b/graphics/src/SVGLoader.cc index 66417f3e..caa84674 100644 --- a/graphics/src/SVGLoader.cc +++ b/graphics/src/SVGLoader.cc @@ -23,12 +23,6 @@ #include "tinyxml2.h" -#ifndef TINYXML2_MAJOR_VERSION_GE_6 -#if TINYXML2_MAJOR_VERSION >= 6 - #define TINYXML2_MAJOR_VERSION_GE_6 -#endif -#endif - #include "gz/common/Console.hh" #include "gz/common/Util.hh" @@ -885,20 +879,12 @@ bool SVGLoader::Parse(const std::string &_filename, tinyxml2::XMLDocument doc; if (doc.LoadFile(_filename.c_str()) != tinyxml2::XML_SUCCESS) { -#ifdef TINYXML2_MAJOR_VERSION_GE_6 const char *str1 = doc.ErrorStr(); - const char *str2 = nullptr; -#else - const char *str1 = doc.GetErrorStr1(); - const char *str2 = doc.GetErrorStr2(); -#endif - std::string err1 = str1 ? str1 : "n/a"; - std::string err2 = str2 ? str2 : "n/a"; + std::string err1 = str1 != nullptr ? str1 : "n/a"; gzerr << "Failed to load file " << _filename << std::endl << "XML error type " << doc.ErrorName() << "\n" - << "XML error info 1 " << err1 << "\n" - << "XML error info 2 " << err2 << "\n"; + << "XML error info 1 " << err1 << "\n"; return false; }