Skip to content
Snippets Groups Projects
Commit ee04f5b9 authored by Julien Malik's avatar Julien Malik
Browse files

ENH: support external libkml

parent a5a884aa
No related branches found
No related tags found
No related merge requests found
# - Find LibKML
# Find the native LibKML includes and library
#
# LIBKML_FOUND - True if LibKML found.
# LIBKML_INCLUDE_DIR - where to find tinyxml.h, etc.
# LIBKML_LIBRARIES - List of libraries when using LibKML.
#
IF( LIBKML_INCLUDE_DIR )
# Already in cache, be silent
SET( LibKML_FIND_QUIETLY TRUE )
ENDIF( LIBKML_INCLUDE_DIR )
FIND_PATH( LIBKML_INCLUDE_DIR kml/dom.h )
FIND_LIBRARY( LIBKML_BASE_LIBRARY
NAMES kmlbase )
FIND_LIBRARY( LIBKML_CONVENIENCE_LIBRARY
NAMES kmlconvenience )
FIND_LIBRARY( LIBKML_DOM_LIBRARY
NAMES kmldom )
FIND_LIBRARY( LIBKML_ENGINE_LIBRARY
NAMES kmlengine )
FIND_LIBRARY( LIBKML_REGIONATOR_LIBRARY
NAMES kmlregionator )
FIND_LIBRARY( LIBKML_XSD_LIBRARY
NAMES kmlxsd )
FIND_LIBRARY( LIBKML_MINIZIP_LIBRARY
NAMES minizip )
MARK_AS_ADVANCED( LIBKML_INCLUDE_DIR
LIBKML_BASE_LIBRARY
LIBKML_CONVENIENCE_LIBRARY
LIBKML_DOM_LIBRARY
LIBKML_ENGINE_LIBRARY
LIBKML_REGIONATOR_LIBRARY
LIBKML_XSD_LIBRARY
LIBKML_MINIZIP_LIBRARY )
# handle the QUIETLY and REQUIRED arguments and set LIBKML_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( LibKML DEFAULT_MSG
LIBKML_INCLUDE_DIR
LIBKML_BASE_LIBRARY
LIBKML_CONVENIENCE_LIBRARY
LIBKML_DOM_LIBRARY
LIBKML_ENGINE_LIBRARY
LIBKML_REGIONATOR_LIBRARY
LIBKML_XSD_LIBRARY
LIBKML_MINIZIP_LIBRARY )
IF(LibKML_FOUND)
SET(LIBKML_INCLUDE_DIRS ${LIBKML_INCLUDE_DIR})
SET(LIBKML_LIBRARIES ${LIBKML_BASE_LIBRARY}
${LIBKML_CONVENIENCE_LIBRARY}
${LIBKML_DOM_LIBRARY}
${LIBKML_ENGINE_LIBRARY}
${LIBKML_REGIONATOR_LIBRARY}
${LIBKML_XSD_LIBRARY}
${LIBKML_MINIZIP_LIBRARY})
ENDIF(LibKML_FOUND)
MESSAGE(STATUS "Importing LibKML...")
FIND_PACKAGE(LibKML)
IF(LIBKML_FOUND)
OPTION(OTB_USE_EXTERNAL_LIBKML "Use external LibKML library." ON)
ELSE(LIBKML_FOUND)
OPTION(OTB_USE_EXTERNAL_LIBKML "Use external LibKML library." OFF)
SET(LIBKML_LIBRARIES otbkml)
ENDIF(LIBKML_FOUND)
MARK_AS_ADVANCED(OTB_USE_EXTERNAL_LIBKML)
......@@ -43,7 +43,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/otbkml/src
${OTB_SOURCE_DIR}/Utilities/otbliblas/include
${OTB_SOURCE_DIR}/Utilities/otbedison/segm
${OTB_SOURCE_DIR}/Utilities/otbedison/prompt
......@@ -108,6 +107,14 @@ ELSEIF(OTB_USE_EXTERNAL_MUPARSER)
${OTB_SOURCE_DIR}/Utilities/otbmuparser)
ENDIF(OTB_USE_EXTERNAL_MUPARSER)
IF(OTB_USE_EXTERNAL_LIBKML)
SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${LIBKML_INCLUDE_DIRS})
ELSEIF(OTB_USE_EXTERNAL_LIBKML)
SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${OTB_SOURCE_DIR}/Utilities/otbkml/src)
ENDIF(OTB_USE_EXTERNAL_LIBKML)
IF(OTB_USE_CURL)
SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${CURL_INCLUDE_DIR} )
......@@ -281,8 +288,6 @@ SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS}
Utilities/otbsvm
Utilities/InsightJournal
Utilities/otb6S
Utilities/otbkml
Utilities/otbkml/src
Utilities/otbliblas/include
Utilities/otbedison
Utilities/otbconfigfile
......@@ -369,6 +374,15 @@ ELSE(OTB_USE_EXTERNAL_MUPARSER)
Utilities/otbmuparser)
ENDIF(OTB_USE_EXTERNAL_MUPARSER)
#For LibKML header file
IF(OTB_USE_EXTERNAL_LIBKML)
SET(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}
${LIBKML_INCLUDE_DIRS})
ELSE(OTB_USE_EXTERNAL_LIBKML)
SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS}
Utilities/otbkml)
ENDIF(OTB_USE_EXTERNAL_LIBKML)
#For GLU header file
SET(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}
${OTB_GLU_INCLUDE_PATH} )
......
......@@ -232,6 +232,7 @@ INCLUDE(ImportGetText)
INCLUDE(ImportSiftFast)
INCLUDE(ImportTinyXML)
INCLUDE(ImportMuParser)
INCLUDE(ImportLibKML)
INCLUDE_DIRECTORIES (
......
......@@ -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_LIBRARIES})
TARGET_LINK_LIBRARIES (OTBIO ITKIO ITKCommon ${LIBKML_LIBRARIES} ${TINYXML_LIBRARIES})
IF (OTB_USE_LIBLAS)
IF(OTB_USE_EXTERNAL_LIBLAS)
......
......@@ -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_LIBRARIES} otbkml)
TARGET_LINK_LIBRARIES(otbUtilitiesTests OTBIO OTBCommon OTBTesting otbsvm otb6S ${TINYXML_LIBRARIES} ${LIBKML_LIBRARIES})
IF(OTB_USE_SIFTFAST)
TARGET_LINK_LIBRARIES(otbUtilitiesTests otbsiftfast)
......
......@@ -79,8 +79,10 @@ IF(NOT OTB_USE_EXTERNAL_MUPARSER)
ADD_SUBDIRECTORY(otbmuparser)
ENDIF(NOT OTB_USE_EXTERNAL_MUPARSER)
MESSAGE(STATUS "Configuring otbkml...")
ADD_SUBDIRECTORY(otbkml)
IF(NOT OTB_USE_EXTERNAL_LIBKML)
MESSAGE(STATUS "Configuring otbkml...")
ADD_SUBDIRECTORY(otbkml)
ENDIF(NOT OTB_USE_EXTERNAL_LIBKML)
MESSAGE(STATUS "Configuring otbedison...")
ADD_SUBDIRECTORY(otbedison)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment