File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ # FindTinyXML2
2+ # -----------
3+ # Finds the TinyXML2 library
4+ #
5+ # This will define the following variables:
6+ #
7+ # TINYXML2_FOUND - system has TinyXML2
8+ #
9+ # and the following imported targets:
10+ #
11+ # tinyxml2::tinyxml2 - The UDEV library
12+
13+ find_package (TinyXML2 CONFIG )
14+
15+ if (TinyXML2_FOUND)
16+ set (TINYXML2_FOUND TinyXML2_FOUND)
17+ elseif (NOT TinyXML2_FOUND)
18+ find_package (PkgConfig )
19+ if (PKG_CONFIG_FOUND)
20+ pkg_check_modules (PC_TINYXML2 tinyxml2 QUIET )
21+ endif ()
22+
23+ find_path (TINYXML2_INCLUDE_DIR tinyxml2.h
24+ PATHS ${PC_TINYXML2_INCLUDEDIR} )
25+ find_library (TINYXML2_LIBRARY NAMES tinyxml2
26+ PATHS ${PC_TINYXML2_LIBDIR} )
27+ set (TINYXML2_VERSION ${PC_TINYXML2_VERSION} )
28+
29+ include (FindPackageHandleStandardArgs )
30+ find_package_handle_standard_args (TinyXML2
31+ REQUIRED_VARS TINYXML2_LIBRARY TINYXML2_INCLUDE_DIR
32+ VERSION_VAR TINYXML2_VERSION)
33+
34+ if (TINYXML2_FOUND)
35+ add_library (tinyxml2::tinyxml2 UNKNOWN IMPORTED )
36+ set_target_properties (tinyxml2::tinyxml2 PROPERTIES
37+ IMPORTED_LOCATION "${TINYXML2_LIBRARY} "
38+ INTERFACE_INCLUDE_DIRECTORIES "${TINYXML2_INCLUDE_DIR} " )
39+ endif ()
40+
41+ mark_as_advanced (TINYXML2_INCLUDE_DIR TINYXML2_LIBRARY )
42+ endif ()
You can’t perform that action at this time.
0 commit comments