Uses FindTinyXML to find package

pull/1/head
Roman Proskuryakov 9 years ago
parent 4d0544e61a
commit 28c63aea72

@ -155,17 +155,10 @@ add_definitions(-D__STDC_CONSTANT_MACROS)
# 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 (USE_SYSTEM_TINYXML)
find_package(TinyXML REQUIRED)
add_definitions (-DTIXML_USE_STL)
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()
include_directories(SYSTEM ${TinyXML_INCLUDE_DIRS})
endif()
# Platform specific
@ -676,8 +669,6 @@ if (WIN32)
endforeach(d)
set_target_properties(components PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}")
# oics uses tinyxml, which has an initialized but unused variable
set_target_properties(oics PROPERTIES COMPILE_FLAGS "${WARNINGS} /wd4189 ${MT_BUILD}")
set_target_properties(osg-ffmpeg-videoplayer PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}")
if (BUILD_BSATOOL)

@ -165,7 +165,7 @@ if (ANDROID)
endif (ANDROID)
if (USE_SYSTEM_TINYXML)
target_link_libraries(openmw ${TINYXML_LIBRARIES})
target_link_libraries(openmw ${TinyXML_LIBRARIES})
endif()
if (NOT UNIX)

@ -1,32 +1,21 @@
set(OICS_LIBRARY "oics")
# Sources
set(OICS_SOURCE_FILES
ICSChannel.cpp
ICSControl.cpp
ICSInputControlSystem.cpp
ICSInputControlSystem_keyboard.cpp
ICSInputControlSystem_mouse.cpp
ICSInputControlSystem_joystick.cpp
ICSPrerequisites.h
)
set(TINYXML_SOURCE_FILES
tinyxml.cpp
tinyxmlparser.cpp
tinyxmlerror.cpp
tinystr.cpp
add_library(oics STATIC
ICSChannel.cpp
ICSControl.cpp
ICSInputControlSystem.cpp
ICSInputControlSystem_keyboard.cpp
ICSInputControlSystem_mouse.cpp
ICSInputControlSystem_joystick.cpp
ICSPrerequisites.h
)
if(USE_SYSTEM_TINYXML)
add_library(${OICS_LIBRARY} STATIC ${OICS_SOURCE_FILES})
target_link_libraries(${OICS_LIBRARY} ${TINYXML_LIBRARIES})
target_link_libraries(oics ${TinyXML_LIBRARIES})
else()
add_library(${OICS_LIBRARY} STATIC
${OICS_SOURCE_FILES}
${TINYXML_SOURCE_FILES})
add_library(local_tinyxml STATIC
tinyxml.cpp
tinyxmlparser.cpp
tinyxmlerror.cpp
tinystr.cpp
)
target_link_libraries(oics local_tinyxml)
endif()
# Does this do anything?
link_directories(${CMAKE_CURRENT_BINARY_DIR})

Loading…
Cancel
Save