1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
From f62eb94a049482c6dc6f5d830087a91b6bbae886 Mon Sep 17 00:00:00 2001
From: mimanchiok <mimanchiok@qq.com>
Date: Thu, 7 Aug 2025 19:33:51 +0800
Subject: [PATCH] fix tao/pegtl/contrib/tracer.hpp: No such file or directory
---
CMake/FindPEGTL.cmake | 62 +++++++++++++++++-----------
IO/MotionFX/vtkMotionFXCFGGrammar.h | 2 +-
IO/MotionFX/vtkMotionFXCFGReader.cxx | 6 +--
ThirdParty/pegtl/CMakeLists.txt | 1 -
4 files changed, 41 insertions(+), 30 deletions(-)
diff --git a/CMake/FindPEGTL.cmake b/CMake/FindPEGTL.cmake
index 4c9e108b..87ab49d6 100644
--- a/CMake/FindPEGTL.cmake
+++ b/CMake/FindPEGTL.cmake
@@ -20,31 +20,43 @@
#
# PEGTL::PEGTL
-find_path(PEGTL_INCLUDE_DIR
- NAMES pegtl/version.hpp
- PATH_SUFFIXES tao
- DOC "Path to PEGTL headers")
-mark_as_advanced(PEGTL_INCLUDE_DIR)
+message(STATUS "Searching for PEGTL")
+find_package(PEGTL CONFIG REQUIRED)
+if(TARGET taocpp::pegtl)
+ message(STATUS "Searching for PEGTL - found target taocpp::pegtl")
+ set_target_properties(taocpp::pegtl PROPERTIES IMPORTED_GLOBAL TRUE)
+ 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
+ DOC "Path to PEGTL headers")
+ mark_as_advanced(PEGTL_INCLUDE_DIR)
-if (PEGTL_INCLUDE_DIR)
- file(STRINGS "${PEGTL_INCLUDE_DIR}/pegtl/version.hpp" _pegtl_version_header
- REGEX "TAO_PEGTL_VERSION")
- string(REGEX MATCH "define[ \t]+TAO_PEGTL_VERSION[ \t]+\"([0-9.]+)\"" _pegtl_version_match "${_pegtl_version_header}")
- set(PEGTL_VERSION "${CMAKE_MATCH_1}")
- unset(_pegtl_version_header)
- unset(_pegtl_version_match)
-endif ()
+ if (PEGTL_INCLUDE_DIR)
+ file(STRINGS "${PEGTL_INCLUDE_DIR}/pegtl/version.hpp" _pegtl_version_header
+ REGEX "TAO_PEGTL_VERSION")
+ string(REGEX MATCH "define[ \t]+TAO_PEGTL_VERSION[ \t]+\"([0-9.]+)\"" _pegtl_version_match "${_pegtl_version_header}")
+ set(PEGTL_VERSION "${CMAKE_MATCH_1}")
+ unset(_pegtl_version_header)
+ unset(_pegtl_version_match)
+ endif ()
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(PEGTL
- REQUIRED_VARS PEGTL_INCLUDE_DIR
- VERSION_VAR PEGTL_VERSION)
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(PEGTL
+ REQUIRED_VARS PEGTL_INCLUDE_DIR
+ VERSION_VAR PEGTL_VERSION)
-if (PEGTL_FOUND)
- set(PEGTL_INCLUDE_DIRS "${PEGTL_INCLUDE_DIR}")
- if (NOT TARGET PEGTL::PEGTL)
- add_library(PEGTL::PEGTL INTERFACE IMPORTED)
- set_target_properties(PEGTL::PEGTL PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${PEGTL_INCLUDE_DIR}")
- endif ()
-endif ()
+ if (PEGTL_FOUND)
+ set(PEGTL_INCLUDE_DIRS "${PEGTL_INCLUDE_DIR}")
+ if (NOT TARGET PEGTL::PEGTL)
+ add_library(PEGTL::PEGTL INTERFACE IMPORTED)
+ set_target_properties(PEGTL::PEGTL PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${PEGTL_INCLUDE_DIR}")
+ endif ()
+ message(STATUS "Searching for PEGTL - found")
+ endif ()
+endif ()
\ No newline at end of file
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 9cbf553c..7417a418 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)
--
2.27.0
|