From 9637e1641be22db6b77fb5aff0f8068b51106de6 Mon Sep 17 00:00:00 2001
From: Marc Zinnschlag <marc@zpages.de>
Date: Sat, 14 Sep 2013 13:33:49 +0200
Subject: [PATCH] fix for building with system tinyxml

---
 CMakeLists.txt             | 1 +
 apps/openmw/CMakeLists.txt | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2ec306e5a5..625239aa06 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,6 +167,7 @@ if(USE_SYSTEM_TINYXML)
     find_library(TINYXML_LIBRARIES tinyxml)
     find_path(TINYXML_INCLUDE_DIR tinyxml.h)
     message(STATUS "Found TinyXML: ${TINYXML_LIBRARIES} ${TINYXML_INCLUDE_DIR}")
+    add_definitions (-DTIXML_USE_STL)
     if(TINYXML_LIBRARIES AND TINYXML_INCLUDE_DIR)
         include_directories(${TINYXML_INCLUDE_DIR})
         message(STATUS "Using system TinyXML library.")
diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt
index a44fd4b343..b367e2a1e7 100644
--- a/apps/openmw/CMakeLists.txt
+++ b/apps/openmw/CMakeLists.txt
@@ -119,6 +119,10 @@ target_link_libraries(openmw
     components
 )
 
+if (USE_SYSTEM_TINYXML)
+    target_link_libraries(openmw ${TINYXML_LIBRARIES})
+endif()
+
 if (NOT UNIX)
 target_link_libraries(openmw ${SDL2MAIN_LIBRARY})
 endif()