vcpkg/ports/vtk/pegtl.patch

86 lines
2.9 KiB
Diff

diff --git a/CMake/FindPEGTL.cmake b/CMake/FindPEGTL.cmake
index fbc3e15a..de132db0 100644
--- a/CMake/FindPEGTL.cmake
+++ b/CMake/FindPEGTL.cmake
@@ -20,6 +20,19 @@
#
# PEGTL::PEGTL
+message(STATUS "Searching for PEGTL")
+find_package(PEGTL CONFIG REQUIRED)
+if(TARGET taocpp::pegtl)
+ message(STATUS "Searching for PEGTL - found target taocpp::pegtl")
+ get_target_property(TARGET_IMPORTED_GLOBAL taocpp::pegtl IMPORTED_GLOBAL)
+ if(NOT TARGET_IMPORTED_GLOBAL)
+ set_target_properties(taocpp::pegtl PROPERTIES IMPORTED_GLOBAL TRUE)
+ endif()
+ if(NOT TARGET PEGTL::PEGTL)
+ add_library(PEGTL::PEGTL IMPORTED INTERFACE)
+ target_link_libraries(PEGTL::PEGTL INTERFACE taocpp::pegtl)
+ endif()
+else()
find_path(PEGTL_INCLUDE_DIR
NAMES pegtl/version.hpp
PATH_SUFFIXES tao
@@ -48,3 +61,4 @@ if (PEGTL_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${PEGTL_INCLUDE_DIR}")
endif ()
endif ()
+endif ()
diff --git a/IO/MotionFX/vtkMotionFXCFGGrammar.h b/IO/MotionFX/vtkMotionFXCFGGrammar.h
index e58eeb80..67bc5d88 100644
--- a/IO/MotionFX/vtkMotionFXCFGGrammar.h
+++ b/IO/MotionFX/vtkMotionFXCFGGrammar.h
@@ -11,7 +11,7 @@
// for debugging
// clang-format off
-#include VTK_PEGTL(pegtl/contrib/tracer.hpp)
+#include VTK_PEGTL(pegtl/contrib/trace.hpp)
// clang-format on
namespace MotionFX
diff --git a/IO/MotionFX/vtkMotionFXCFGReader.cxx b/IO/MotionFX/vtkMotionFXCFGReader.cxx
index cb16ea62..7b5ee7b6 100644
--- a/IO/MotionFX/vtkMotionFXCFGReader.cxx
+++ b/IO/MotionFX/vtkMotionFXCFGReader.cxx
@@ -1210,7 +1210,7 @@ bool PositionFileMotion::read_position_file(const std::string& rootDir) const
}
return true;
}
- catch (const tao::pegtl::input_error& e)
+ catch (const tao::pegtl::parse_error& e)
{
vtkGenericWarningMacro("PositionFileMotion::read_position_file failed: " << e.what());
}
@@ -1229,7 +1229,7 @@ bool UniversalTransformMotion::read_universaltransform_file(const std::string& r
in, numbers, this->transforms);
return true;
}
- catch (const tao::pegtl::input_error& e)
+ catch (const tao::pegtl::parse_error& e)
{
vtkGenericWarningMacro(
"UniversalTransformMotion::read_universaltransform_file failed: " << e.what());
@@ -1266,7 +1266,7 @@ public:
if (getenv("MOTIONFX_DEBUG_GRAMMAR") != nullptr)
{
tao::pegtl::read_input<> in2(filename);
- tao::pegtl::parse<MotionFX::CFG::Grammar, tao::pegtl::nothing, tao::pegtl::tracer>(in2);
+ tao::pegtl::complete_trace<MotionFX::CFG::Grammar>(in2);
}
return false;
}
diff --git a/ThirdParty/pegtl/CMakeLists.txt b/ThirdParty/pegtl/CMakeLists.txt
index 27c89427..d2fd1267 100644
--- a/ThirdParty/pegtl/CMakeLists.txt
+++ b/ThirdParty/pegtl/CMakeLists.txt
@@ -13,7 +13,6 @@ vtk_module_third_party(
"2.8.3"
EXTERNAL
PACKAGE PEGTL
- VERSION 2.0.0
TARGETS PEGTL::PEGTL
STANDARD_INCLUDE_DIRS)