1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-25 17:53:47 +00:00
Aquaria/cmake/Modules/FindTinyXML2.cmake

43 lines
1.2 KiB
CMake
Raw Normal View History

2017-01-13 12:06:31 +00:00
# Copyright (c) 2015-2016, Graphics Lab, Georgia Tech Research Corporation
# Copyright (c) 2015-2016, Humanoid Lab, Georgia Tech Research Corporation
# Copyright (c) 2016, Personal Robotics Lab, Carnegie Mellon University
# This file is provided under the "BSD-style" License
2017-01-13 12:06:31 +00:00
# Find TINYXML2
#
# This sets the following variables:
# TINYXML2_FOUND
# TINYXML2_INCLUDE_DIRS
# TINYXML2_LIBRARIES
# TINYXML2_VERSION
2017-01-13 12:06:31 +00:00
find_package(PkgConfig QUIET)
2017-01-13 12:06:31 +00:00
# Check if the pkgconfig file is installed
pkg_check_modules(PC_TINYXML2 tinyxml2 QUIET)
# Include directories
find_path(TINYXML2_INCLUDE_DIRS
NAMES tinyxml2.h
HINTS ${PC_TINYXML2_INCLUDEDIR}
PATHS "${CMAKE_INSTALL_PREFIX}/include")
# Libraries
if(MSVC)
set(TINYXML2_LIBRARIES optimized tinyxml2 debug tinyxml2d)
else()
find_library(TINYXML2_LIBRARIES
NAMES tinyxml2
HINTS ${PC_TINYXML2_LIBDIR})
endif()
2017-01-13 12:06:31 +00:00
# Version
set(TINYXML2_VERSION ${PC_TINYXML2_VERSION})
# Set (NAME)_FOUND if all the variables and the version are satisfied.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TINYXML2
FAIL_MESSAGE DEFAULT_MSG
REQUIRED_VARS TINYXML2_INCLUDE_DIRS TINYXML2_LIBRARIES
VERSION_VAR TINYXML2_VERSION)