b32c080
diff --git a/Project/CMake/cmake/modules/FindTinyXML.cmake b/Project/CMake/cmake/modules/FindTinyXML.cmake
b32c080
new file mode 100644
b32c080
index 0000000..220a6c2
b32c080
--- /dev/null
b32c080
+++ b/Project/CMake/cmake/modules/FindTinyXML.cmake
b32c080
@@ -0,0 +1,37 @@
b32c080
+# Try to find the TinyXML library
b32c080
+# TinyXML_FOUND - system has TinyXML
b32c080
+# TinyXML_INCLUDE_DIRS - TinyXML include directory
b32c080
+# TinyXML_LIBRARY_DIRS - TinyXML library directory
b32c080
+# TinyXML_LIBRARIES - TinyXML libraries
b32c080
+# Copyright (C) 2012 iCub Facility, Istituto Italiano di Tecnologia
b32c080
+# Author: Daniele E. Domenichelli <daniele.domenichelli@iit.it>
b32c080
+#
b32c080
+# CopyPolicy: Released under the terms of the LGPLv2.1 or later
d16b5d7
+
b32c080
+if(NOT WIN32)
b32c080
+  find_package(PkgConfig)
b32c080
+  if(PKG_CONFIG_FOUND)
b32c080
+    if(TinyXML_FIND_VERSION)
b32c080
+      if(TinyXML_FIND_VERSION_EXACT)
b32c080
+        pkg_check_modules(PC_TINYXML QUIET tinyxml2=${TinyXML_FIND_VERSION})
b32c080
+      else(TinyXML_FIND_VERSION_EXACT)
b32c080
+        pkg_check_modules(PC_TINYXML QUIET tinyxml2>=${TinyXML_FIND_VERSION})
b32c080
+      endif(TinyXML_FIND_VERSION_EXACT)
b32c080
+    else(TinyXML_FIND_VERSION)
b32c080
+      pkg_check_modules(PC_TINYXML QUIET tinyxml2)
b32c080
+    endif(TinyXML_FIND_VERSION)
b32c080
+  endif(PKG_CONFIG_FOUND)
b32c080
+endif(NOT WIN32)
d16b5d7
+
b32c080
+set(TinyXML_INCLUDE_DIRS ${PC_TINYXML_INCLUDE_DIRS} CACHE PATH "TinyXML include directory" FORCE)
b32c080
+set(TinyXML_LIBRARY_DIRS ${PC_TINYXML_LIBRARY_DIRS} CACHE PATH "TinyXML library directory" FORCE)
b32c080
+set(TinyXML_LIBRARIES ${PC_TINYXML_LIBRARIES} CACHE STRING "TinyXML libraries" FORCE)
b32c080
+include(FindPackageHandleStandardArgs)
d16b5d7
+
b32c080
+find_package_handle_standard_args(TinyXML
b32c080
+  DEFAULT_MSG
b32c080
+  TinyXML_LIBRARIES
b32c080
+  )
b32c080
+
b32c080
+set(TinyXML_FOUND ${TINYXML_FOUND})
b32c080
+mark_as_advanced(TinyXML_INCLUDE_DIRS TinyXML_LIBRARY_DIRS TinyXML_LIBRARIES)