Skip to content
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

Ensure that find_package(TINYXML2) defines TINYXML2::TINYXML2 even on case insensitive filesystems #22

Open
wants to merge 3 commits into
base: rolling
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions cmake/Modules/FindTinyXML2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,13 @@ endif()
if(NOT TinyXML2_LIBRARIES)
set(TinyXML2_LIBRARIES ${TINYXML2_LIBRARY})
endif()

# On case-insensitive filesystem, it is possible that FindTinyXML2.cmake is used if the caller
# invoked find_package(TINYXML2), that is the signature used by gz-cmake, see
# https://github.com/gazebosim/gz-cmake/blob/gz-cmake4_4.1.0/cmake/FindTINYXML2.cmake
# If that is the case (and we detect it by checking the value of CMAKE_FIND_PACKAGE_NAME)
# we also define a TINYXML2::TINYXML2 target for gz-cmake compatibility
if(TARGET tinyxml2::tinyxml2 AND CMAKE_FIND_PACKAGE_NAME STREQUAL "TINYXML2" AND NOT TARGET TINYXML2::TINYXML2)
add_library(TINYXML2::TINYXML2 INTERFACE IMPORTED)
set_property(TARGET tinyxml2::tinyxml2 PROPERTY INTERFACE_LINK_LIBRARIES tinyxml2::tinyxml2)
endif()