File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ endif()
6464
6565#---- Find other packages ----
6666find_package (Threads REQUIRED )
67+ find_package (tinyxml2 CONFIG )
6768
6869
6970set (BEHAVIOR_TREE_LIBRARY ${PROJECT_NAME} )
@@ -141,10 +142,11 @@ list(APPEND BT_SOURCE
141142 src/loggers/bt_file_logger_v2.cpp
142143 src/loggers/bt_minitrace_logger.cpp
143144 src/loggers/bt_observer.cpp
144-
145- 3rdparty/tinyxml2/tinyxml2.cpp
146145 )
147146
147+ if (NOT TARGET tinyxml2::tinyxml2)
148+ list (APPEND BT_SOURCE 3rdparty/tinyxml2/src/tinyxml2.cpp)
149+ endif ()
148150
149151if (BTCPP_GROOT_INTERFACE)
150152 # should be found already, at this stage
@@ -186,6 +188,15 @@ target_link_libraries(${BTCPP_LIBRARY}
186188 ${BTCPP_EXTRA_LIBRARIES}
187189)
188190
191+ if (TARGET tinyxml2::tinyxml2)
192+ target_link_libraries (${BTCPP_LIBRARY} PRIVATE tinyxml2::tinyxml2 )
193+ else ()
194+ target_include_directories (${BTCPP_LIBRARY} PRIVATE
195+ $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /3rdparty /tinyxml2 /include >
196+ )
197+ endif ()
198+
199+
189200target_include_directories (${BTCPP_LIBRARY}
190201 PUBLIC
191202 $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /include >
Original file line number Diff line number Diff line change 3333
3434#include < map>
3535#include " behaviortree_cpp/xml_parsing.h"
36- #include " tinyxml2/tinyxml2 .h"
36+ #include " tinyxml2.h"
3737#include < filesystem>
3838
3939#ifdef USING_ROS2
You can’t perform that action at this time.
0 commit comments