Commit 71d6b93f authored by Thomas Feuvrier's avatar Thomas Feuvrier

ENH: Add external libraries configurations (Expat, Boost, OpenThread, GDAL) in...

ENH: Add external libraries configurations (Expat, Boost, OpenThread, GDAL) in UseOTB.cmake file for applications users.
parent bc50f802
......@@ -1037,6 +1037,7 @@ IF(NOT OTB_INSTALL_NO_DEVELOPMENT)
${OTB_BINARY_DIR}/OTBBuildSettings.cmake
${OTB_BINARY_DIR}/OTBLibraryDepends.cmake
${OTB_BINARY_DIR}/UseOTB.cmake
${OTB_SOURCE_DIR}/FindOpenThreads.cmake
DESTINATION ${OTB_INSTALL_PACKAGE_DIR_CM24}
COMPONENT Development
)
......
......@@ -133,6 +133,17 @@ SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "@OTB_IO_UTILITIES_DEPENDENT_LIBRARIES@
# Option use external BOOST.
SET(OTB_USE_EXTERNAL_BOOST "@OTB_USE_EXTERNAL_BOOST@")
# Option use external EXPAT.
SET(OTB_USE_EXTERNAL_EXPAT "@OTB_USE_EXTERNAL_EXPAT@")
# Option use external OpenThread.
SET(OTB_USE_EXTERNAL_OPENTHREADS "@OTB_USE_EXTERNAL_OPENTHREADS@")
# Option use external GDAL.
SET(OTB_USE_EXTERNAL_GDAL "@OTB_USE_EXTERNAL_GDAL@")
# Internationalization
SET(OTB_I18N "@OTB_I18N@")
SET(OTB_LANG "@OTB_LANG@")
......
......@@ -82,3 +82,47 @@ IF(OTB_USE_EXTERNAL_ITK)
INCLUDE(${OTB_ITK_DIR}/ITKConfig.cmake)
INCLUDE(${ITK_USE_FILE})
ENDIF(OTB_USE_EXTERNAL_ITK)
#WHERE TO FIND EXPAT
IF(OTB_USE_EXTERNAL_EXPAT)
FIND_PACKAGE(EXPAT)
IF(EXPAT_FOUND)
# Control expat compatibility
INCLUDE_DIRECTORIES(BEFORE ${EXPAT_INCLUDE_DIR})
LINK_DIRECTORIES( ${EXPAT_LIBRARY} )
ELSE(EXPAT_FOUND)
MESSAGE(FATAL_ERROR
"Cannot use OTB project without lib EXPAT. Please set EXPAT_DIR or rebuild OTB and set OTB_USE_EXTERNAL_EXPAT OFF to use INTERNAL EXPAT set on OTB/Utilities repository.")
ENDIF(EXPAT_FOUND)
ENDIF(OTB_USE_EXTERNAL_EXPAT)
#WHERE TO FIND OPENTHREAD
IF(OTB_USE_EXTERNAL_OPENTHREADS)
IF(EXISTS "${CMAKE_ROOT}/Modules/FindOpenThreads.cmake")
FIND_PACKAGE(OpenThreads)
ELSEIF(EXISTS "${CMAKE_ROOT}/Modules/FindOpenThreads.cmake")
INCLUDE(${OTB_LIBRARY_DIRS}/FindOpenThreads.cmake)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/FindOpenThreads.cmake")
INCLUDE_DIRECTORIES(${OPENTHREADS_INCLUDE_DIR})
LINK_DIRECTORIES( ${OPENTHREADS_LIBRARY} )
ENDIF(OTB_USE_EXTERNAL_OPENTHREADS)
#WHERE TO FIND BOOST
IF(OTB_USE_EXTERNAL_BOOST)
FIND_PACKAGE(Boost)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
ENDIF(OTB_USE_EXTERNAL_BOOST)
#WHERE TO FIND GDAL
IF(OTB_USE_EXTERNAL_GDAL)
FIND_PACKAGE(GDAL)
IF (NOT GDAL_FOUND)
FIND_PATH(GDAL_INCLUDE_DIR gdal.h $ENV{GDAL_INCLUDE_DIR} /usr/include/gdal)
FIND_LIBRARY(GDAL_LIBRARY NAMES gdal gdal1.5.0 gdal1.4.0 gdal1.3.2 PATHS /usr/lib/gdal)
ENDIF(NOT GDAL_FOUND)
ENDIF(OTB_USE_EXTERNAL_GDAL)
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