Skip to content

Support discovery of TinyXML2 by pkgconfig #5697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions cmake/modules/FindTinyXML2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ endif()

if(NOT (TINYXML2_FROM_SOURCE OR TINYXML2_FROM_THIRDPARTY))
find_package(TinyXML2 CONFIG QUIET)
if(NOT TinyXML2_FOUND)
find_package(PkgConfig REQUIRED)
pkg_check_modules(TinyXML2 REQUIRED IMPORTED_TARGET tinyxml2)
if(TARGET PkgConfig::TinyXML2)
add_library(tinyxml2::tinyxml2 ALIAS PkgConfig::TinyXML2)
endif()
endif()
endif()

if(TinyXML2_FOUND AND NOT TINYXML2_FROM_THIRDPARTY)
Expand Down
7 changes: 7 additions & 0 deletions cmake/packaging/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ set_and_check(@PROJECT_NAME@_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")
find_package(fastcdr REQUIRED)
find_package(foonathan_memory REQUIRED)
find_package(TinyXML2 QUIET)
if(NOT TinyXML2_FOUND)
find_package(PkgConfig REQUIRED)
pkg_check_modules(TinyXML2 IMPORTED_TARGET tinyxml2)
if(TARGET PkgConfig::TinyXML2)
add_library(tinyxml2::tinyxml2 ALIAS PkgConfig::TinyXML2)
endif()
endif()
@FASTDDS_INSTALLER_DEPS_ANCILLARY@
@FASTDDS_PACKAGE_UNIX_OPT_DEPS@

Expand Down