diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f95f2d4e..2ec306e5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,6 +161,19 @@ if (NOT FFMPEG_FOUND) message(WARNING "--------------------") endif (NOT FFMPEG_FOUND) +# TinyXML +option(USE_SYSTEM_TINYXML "Use system TinyXML library instead of internal." OFF) +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}") + if(TINYXML_LIBRARIES AND TINYXML_INCLUDE_DIR) + include_directories(${TINYXML_INCLUDE_DIR}) + message(STATUS "Using system TinyXML library.") + else() + message(FATAL_ERROR "Detection of system TinyXML incomplete.") + endif() +endif() # Platform specific if (WIN32) diff --git a/apps/opencs/view/doc/adjusterwidget.cpp b/apps/opencs/view/doc/adjusterwidget.cpp index 24e37b0f5..910819700 100644 --- a/apps/opencs/view/doc/adjusterwidget.cpp +++ b/apps/opencs/view/doc/adjusterwidget.cpp @@ -2,6 +2,7 @@ #include "adjusterwidget.hpp" #include +#include #include diff --git a/extern/oics/CMakeLists.txt b/extern/oics/CMakeLists.txt index 7c14387a4..5c1edbf62 100644 --- a/extern/oics/CMakeLists.txt +++ b/extern/oics/CMakeLists.txt @@ -9,12 +9,23 @@ set(OICS_SOURCE_FILES ICSInputControlSystem_keyboard.cpp ICSInputControlSystem_mouse.cpp ICSInputControlSystem_joystick.cpp +) + +set(TINYXML_SOURCE_FILES tinyxml.cpp tinyxmlparser.cpp tinyxmlerror.cpp - tinystr.cpp + tinystr.cpp ) -add_library(${OICS_LIBRARY} STATIC ${OICS_SOURCE_FILES}) +if(USE_SYSTEM_TINYXML) + add_library(${OICS_LIBRARY} STATIC ${OICS_SOURCE_FILES}) + target_link_libraries(${OICS_LIBRARY} ${TINYXML_LIBRARIES}) +else() + add_library(${OICS_LIBRARY} STATIC + ${OICS_SOURCE_FILES} + ${TINYXML_SOURCE_FILES}) +endif() +# Does this do anything? link_directories(${CMAKE_CURRENT_BINARY_DIR})