ros2 / tinyxml_vendor

Vendor package for providing tinyxml within a cmake package
Apache License 2.0
2 stars 14 forks source link

export tinyxml cmake target #27

Open briansoe66 opened 2 years ago

briansoe66 commented 2 years ago

Rewrite tinyxml_cmakelists.txt to export cmake target. FindTinyXML.cmake and enforce-use-stl.patch are no longer needed.

Original method to use tinyxml:

list(APPEND CMAKE_MODULE_PATH path-to-FindTinyXML.cmake)
find_package(TinyXML REQUIRED)
target_include_directories(my-target PUBLIC ${TinyXML_INCLUDE_DIRS})
target_link_libraries(my-target PUBLIC ${TinyXML_LIBRARIES})
add_definitions(TIXML_USE_STL)

New method to use tinyxml:

find_package(tinyxml REQUIRED)
target_link_libaries(my-target PUBLIC tinyxml::tinyxml)

NOTE: TinyXML_INCLUDE_DIRS and TinyXML_LIBRARIES are no longer defined. They probably should be defined, for backward compatibility, but I don't know how to do this.

gbiggs commented 2 years ago

CI:

gbiggs commented 2 years ago

@briansoe66 Can you please take a look at the CI output and correct the error that's occurring? I get the same error when I build it locally.