Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ endif()

#---- Find other packages ----
find_package(Threads REQUIRED)
find_package(tinyxml2 CONFIG)


set(BEHAVIOR_TREE_LIBRARY ${PROJECT_NAME})
Expand Down Expand Up @@ -141,10 +142,11 @@ list(APPEND BT_SOURCE
src/loggers/bt_file_logger_v2.cpp
src/loggers/bt_minitrace_logger.cpp
src/loggers/bt_observer.cpp

3rdparty/tinyxml2/tinyxml2.cpp
)

if(NOT TARGET tinyxml2::tinyxml2)
list(APPEND BT_SOURCE 3rdparty/tinyxml2/src/tinyxml2.cpp)
endif()

if(BTCPP_GROOT_INTERFACE)
# should be found already, at this stage
Expand Down Expand Up @@ -186,6 +188,15 @@ target_link_libraries(${BTCPP_LIBRARY}
${BTCPP_EXTRA_LIBRARIES}
)

if(TARGET tinyxml2::tinyxml2)
target_link_libraries(${BTCPP_LIBRARY} PRIVATE tinyxml2::tinyxml2)
else()
target_include_directories(${BTCPP_LIBRARY} PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/tinyxml2/include>
)
endif()


target_include_directories(${BTCPP_LIBRARY}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
Expand Down
2 changes: 1 addition & 1 deletion src/xml_parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include <map>
#include "behaviortree_cpp/xml_parsing.h"
#include "tinyxml2/tinyxml2.h"
#include "tinyxml2.h"
#include <filesystem>

#ifdef USING_ROS2
Expand Down
Loading