Commit 1c73b1a6 authored by Julien Malik's avatar Julien Malik

ENH: support external tinyXML

parent e6a53cb3
# - Find TinyXML
# Find the native TinyXML includes and library
#
# TINYXML_FOUND - True if TinyXML found.
# TINYXML_INCLUDE_DIR - where to find tinyxml.h, etc.
# TINYXML_LIBRARIES - List of libraries when using TinyXML.
#
IF( TINYXML_INCLUDE_DIR )
# Already in cache, be silent
SET( TinyXML_FIND_QUIETLY TRUE )
ENDIF( TINYXML_INCLUDE_DIR )
FIND_PATH( TINYXML_INCLUDE_DIR tinyxml.h
PATH_SUFFIXES tinyxml )
FIND_LIBRARY( TINYXML_LIBRARIES
NAMES tinyxml
PATH_SUFFIXES tinyxml )
# handle the QUIETLY and REQUIRED arguments and set TINYXML_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( TinyXML DEFAULT_MSG TINYXML_INCLUDE_DIR TINYXML_LIBRARIES )
MARK_AS_ADVANCED( TINYXML_INCLUDE_DIR TINYXML_LIBRARIES )
MESSAGE(STATUS "Importing TinyXML...")
FIND_PACKAGE(TinyXML)
IF(TINYXML_FOUND)
OPTION(OTB_USE_EXTERNAL_TINYXML "Use external TinyXML library." ON)
ELSE(TINYXML_FOUND)
OPTION(OTB_USE_EXTERNAL_TINYXML "Use external TinyXML library." OFF)
SET(TINYXML_LIBRARIES otbtinyXML)
ENDIF(TINYXML_FOUND)
MARK_AS_ADVANCED(OTB_USE_EXTERNAL_TINYXML)
......@@ -64,7 +64,6 @@ SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${OTB_SOURCE_DIR}/Utilities/otbossimplugins/ossim
${OTB_SOURCE_DIR}/Utilities/InsightJournal
${OTB_SOURCE_DIR}/Utilities/otb6S
${OTB_SOURCE_DIR}/Utilities/tinyXMLlib
# ${OTB_SOURCE_DIR}/Utilities/otbgalib
${OTB_SOURCE_DIR}/Utilities/otbkml/src
${OTB_SOURCE_DIR}/Utilities/otbkml/third_party
......@@ -110,6 +109,14 @@ IF(OTB_USE_SIFTFAST)
${OTB_SOURCE_DIR}/Utilities/otbsiftfast)
ENDIF(OTB_USE_SIFTFAST)
IF(OTB_USE_EXTERNAL_TINYXML)
SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${TINYXML_INCLUDE_DIRS})
ELSEIF(OTB_USE_EXTERNAL_TINYXML)
SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${OTB_SOURCE_DIR}/Utilities/tinyXMLlib)
ENDIF(OTB_USE_EXTERNAL_TINYXML)
#-----------------------------------------------------------------------------
# Include directories from the ossim build tree
SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
......@@ -320,7 +327,6 @@ SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS}
Utilities/otbsvm
Utilities/InsightJournal
Utilities/otb6S
Utilities/tinyXMLlib
# Utilities/otbgalib
Utilities/otbkml
Utilities/otbkml/src
......@@ -384,6 +390,15 @@ ELSE(OTB_USE_EXTERNAL_FLTK)
Utilities/FLTK)
ENDIF(OTB_USE_EXTERNAL_FLTK)
#For TinyXML header file
IF(OTB_USE_EXTERNAL_TINYXML)
SET(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}
${TINYXML_INCLUDE_DIRS})
ELSE(OTB_USE_EXTERNAL_TINYXML)
SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS}
Utilities/tinyXMLlib)
ENDIF(OTB_USE_EXTERNAL_TINYXML)
#For GLU header file
SET(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}
${OTB_GLU_INCLUDE_PATH} )
......
......@@ -230,6 +230,7 @@ INCLUDE(ImportOssim)
INCLUDE(ImportQt4)
INCLUDE(ImportGetText)
INCLUDE(ImportSiftFast)
INCLUDE(ImportTinyXML)
INCLUDE_DIRECTORIES (
......
......@@ -3,7 +3,7 @@
FILE(GLOB OTBFuzzy_SRCS "*.cxx" )
ADD_LIBRARY(OTBFuzzy ${OTBFuzzy_SRCS})
TARGET_LINK_LIBRARIES (OTBFuzzy OTBCommon tinyXML)
TARGET_LINK_LIBRARIES (OTBFuzzy OTBCommon ${TINYXML_LIBRARIES})
IF(OTB_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(OTBFuzzy PROPERTIES ${OTB_LIBRARY_PROPERTIES})
ENDIF(OTB_LIBRARY_PROPERTIES)
......
......@@ -39,7 +39,7 @@ ADD_LIBRARY(OTBIO ${OTBIO_SRCS})
# LINK_INTERFACE_LIBRARIES ""
# )
TARGET_LINK_LIBRARIES (OTBIO ${TIFF_LIBRARY} ${GEOTIFF_LIBRARY} ${GDAL_LIBRARY} ${OGR_LIBRARY} ${JPEG_LIBRARY} ${OPENTHREADS_LIBRARY} OTBCommon OTBBasicFilters OTBCurlAdapters)
TARGET_LINK_LIBRARIES (OTBIO ITKIO ITKCommon otbkml tinyXML)
TARGET_LINK_LIBRARIES (OTBIO ITKIO ITKCommon otbkml ${TINYXML_LIBRARIES})
IF (OTB_USE_LIBLAS)
IF(OTB_USE_EXTERNAL_LIBLAS)
......
......@@ -2,7 +2,7 @@
FILE(GLOB OTBObjectDetection_SRCS "*.cxx" )
ADD_LIBRARY(OTBObjectDetection ${OTBObjectDetection_SRCS})
TARGET_LINK_LIBRARIES (OTBObjectDetection OTBCommon)
TARGET_LINK_LIBRARIES (OTBObjectDetection OTBCommon ${TINYXML_LIBRARIES})
IF(OTB_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(OTBObjectDetection PROPERTIES ${OTB_LIBRARY_PROPERTIES})
......
......@@ -399,7 +399,7 @@ IF(NOT BUILD_SHARED_LIBS)
ENDIF(NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE(otbUtilitiesTests otbUtilitiesTests.cxx ${UtilitiesTests_SRCS})
TARGET_LINK_LIBRARIES(otbUtilitiesTests OTBIO OTBCommon OTBTesting otbsvm otb6S tinyXML otbkml)
TARGET_LINK_LIBRARIES(otbUtilitiesTests OTBIO OTBCommon OTBTesting otbsvm otb6S ${TINYXML_LIBRARIES} otbkml)
IF(OTB_USE_SIFTFAST)
TARGET_LINK_LIBRARIES(otbUtilitiesTests otbsiftfast)
......
......@@ -68,8 +68,12 @@ MESSAGE(STATUS "Configuring otbossimplugins...")
ADD_SUBDIRECTORY(otbossimplugins)
MESSAGE(STATUS "Configuring otb6S...")
ADD_SUBDIRECTORY(otb6S)
MESSAGE(STATUS "Configuring tinyXMLlib...")
ADD_SUBDIRECTORY(tinyXMLlib)
IF(NOT OTB_USE_EXTERNAL_TINYXML)
MESSAGE(STATUS "Configuring tinyXMLlib...")
ADD_SUBDIRECTORY(tinyXMLlib)
ENDIF(NOT OTB_USE_EXTERNAL_TINYXML)
MESSAGE(STATUS "Configuring otbkml...")
ADD_SUBDIRECTORY(otbkml)
MESSAGE(STATUS "Configuring otbedison...")
......
......@@ -2,14 +2,13 @@ PROJECT(tinyXMLlib)
FILE(GLOB tinyXMLlib_SRCS "*.cpp")
FILE(GLOB tinyXMLlib_HDRS "*.h")
ADD_LIBRARY(tinyXML ${tinyXMLlib_SRCS})
TARGET_LINK_LIBRARIES(tinyXML)
ADD_LIBRARY(otbtinyXML ${tinyXMLlib_SRCS})
IF(OTB_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(tinyXML PROPERTIES ${OTB_LIBRARY_PROPERTIES})
SET_TARGET_PROPERTIES(otbtinyXML PROPERTIES ${OTB_LIBRARY_PROPERTIES})
ENDIF(OTB_LIBRARY_PROPERTIES)
IF(NOT OTB_INSTALL_NO_LIBRARIES)
INSTALL(TARGETS tinyXML
INSTALL(TARGETS otbtinyXML
RUNTIME DESTINATION ${OTB_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries
LIBRARY DESTINATION ${OTB_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${OTB_INSTALL_LIB_DIR_CM24} COMPONENT Development)
......@@ -17,6 +16,9 @@ ENDIF(NOT OTB_INSTALL_NO_LIBRARIES)
IF(NOT OTB_INSTALL_NO_DEVELOPMENT)
INSTALL(FILES ${tinyXMLlib_HDRS}
DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/tinyXMLlib
COMPONENT Development)
DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/tinyXMLlib
COMPONENT Development)
ENDIF(NOT OTB_INSTALL_NO_DEVELOPMENT)
SET(TINYXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
SET(TINYXML_LIBRARIES otbtinyXML)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment