Uses FindTinyXML to find package

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

@ -155,17 +155,10 @@ add_definitions(-D__STDC_CONSTANT_MACROS)
# TinyXML # TinyXML
option(USE_SYSTEM_TINYXML "Use system TinyXML library instead of internal." OFF) option(USE_SYSTEM_TINYXML "Use system TinyXML library instead of internal." OFF)
if(USE_SYSTEM_TINYXML) if (USE_SYSTEM_TINYXML)
find_library(TINYXML_LIBRARIES tinyxml) find_package(TinyXML REQUIRED)
find_path(TINYXML_INCLUDE_DIR tinyxml.h)
message(STATUS "Found TinyXML: ${TINYXML_LIBRARIES} ${TINYXML_INCLUDE_DIR}")
add_definitions (-DTIXML_USE_STL) add_definitions (-DTIXML_USE_STL)
if(TINYXML_LIBRARIES AND TINYXML_INCLUDE_DIR) include_directories(SYSTEM ${TinyXML_INCLUDE_DIRS})
include_directories(${TINYXML_INCLUDE_DIR})
message(STATUS "Using system TinyXML library.")
else()
message(FATAL_ERROR "Detection of system TinyXML incomplete.")
endif()
endif() endif()
# Platform specific # Platform specific
@ -676,8 +669,6 @@ if (WIN32)
endforeach(d) endforeach(d)
set_target_properties(components PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}") 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}") set_target_properties(osg-ffmpeg-videoplayer PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}")
if (BUILD_BSATOOL) if (BUILD_BSATOOL)

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

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

Loading…
Cancel
Save