Commit f1896dd5 authored by Emmanuel Christophe's avatar Emmanuel Christophe

ENH: add option to disable the use of liblas (open solaris linking problems)

parent 9a2888e7
......@@ -102,6 +102,9 @@ OPTION(OTB_USE_JPEG2000 "Use to support jpeg2000 image file format." ON)
#-----------------------------------------------------------------------------
# Use the liblas library (do not link on solaris)
OPTION(OTB_USE_LIBLAS "Use liblas library to support Lidar data format." ON)
MARK_AS_ADVANCED(OTB_USE_LIBLAS)
# FIND EXTERNAL LIBRAIRIES USE
......@@ -714,32 +717,32 @@ ENDIF(OTB_USE_VISU_GUI)
# Use OTB_ALGO_UTILITIES_DEPENDENT_LIBRARIES to LINK Utilities Algo libraries into your executable
# Use OTB_ALLS_UTILITIES_DEPENDENT_LIBRARIES to LINK Utilities Algo libraries into your executable
# => Create OTB_IO_UTILITIES_DEPENDENT_LIBRARIES
SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "${GDAL_LIBRARY};dxf;tinyXML;otbliblas;otbossim;otbossimplugins" )
IF(NOT OTB_USE_EXTERNAL_OPENTHREADS)
SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES};${OPENTHREADS_LIBRARY}")
ENDIF(NOT OTB_USE_EXTERNAL_OPENTHREADS)
# Add EXPAT library
IF( OTB_USE_EXTERNAL_EXPAT )
SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES};expat")
ELSE( OTB_USE_EXTERNAL_EXPAT )
SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES};otbexpat")
ENDIF( OTB_USE_EXTERNAL_EXPAT )
# Add Open Jpeg library
IF( OTB_COMPILE_JPEG2000 )
SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES};otbopenjpeg")
ENDIF( OTB_COMPILE_JPEG2000 )
# => Create OTB_ALGO_UTILITIES_DEPENDENT_LIBRARIES
SET(OTB_ALGO_UTILITIES_DEPENDENT_LIBRARIES "otb6S;otbgalib;InsightJournal;otbsvm")
# => Create OTB_ALLS_UTILITIES_DEPENDENT_LIBRARIES
SET(OTB_ALLS_UTILITIES_DEPENDENT_LIBRARIES "${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES} ${OTB_ALGO_UTILITIES_DEPENDENT_LIBRARIES}")
# # #
# # # SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "${GDAL_LIBRARY};dxf;tinyXML;otbliblas;otbossim;otbossimplugins" )
# # #
# # # IF(NOT OTB_USE_EXTERNAL_OPENTHREADS)
# # # SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES};${OPENTHREADS_LIBRARY}")
# # # ENDIF(NOT OTB_USE_EXTERNAL_OPENTHREADS)
# # #
# # # # Add EXPAT library
# # # IF( OTB_USE_EXTERNAL_EXPAT )
# # # SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES};expat")
# # # ELSE( OTB_USE_EXTERNAL_EXPAT )
# # # SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES};otbexpat")
# # # ENDIF( OTB_USE_EXTERNAL_EXPAT )
# # #
# # # # Add Open Jpeg library
# # # IF( OTB_COMPILE_JPEG2000 )
# # # SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES};otbopenjpeg")
# # # ENDIF( OTB_COMPILE_JPEG2000 )
# # #
# # # # => Create OTB_ALGO_UTILITIES_DEPENDENT_LIBRARIES
# # # SET(OTB_ALGO_UTILITIES_DEPENDENT_LIBRARIES "otb6S;otbgalib;InsightJournal;otbsvm")
# # #
# # #
# # # # => Create OTB_ALLS_UTILITIES_DEPENDENT_LIBRARIES
# # # SET(OTB_ALLS_UTILITIES_DEPENDENT_LIBRARIES "${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES} ${OTB_ALGO_UTILITIES_DEPENDENT_LIBRARIES}")
# # #
#-----------------------------------------------------------------------------
OPTION(BUILD_EXAMPLES "Build the Examples directory." OFF)
......
......@@ -27,7 +27,10 @@ ENDIF(OTB_COMPILE_JPEG2000)
ADD_LIBRARY(OTBIO ${OTBIO_SRCS})
TARGET_LINK_LIBRARIES (OTBIO OTBCommon ${GDAL_LIBRARY} ${OGR_LIBRARY} otbossim otbossimplugins ITKIO ITKCommon dxf otbkml otbliblas)
TARGET_LINK_LIBRARIES (OTBIO OTBCommon ${GDAL_LIBRARY} ${OGR_LIBRARY} otbossim otbossimplugins ITKIO ITKCommon dxf otbkml)
IF (OTB_USE_LIBLAS)
TARGET_LINK_LIBRARIES(OTBIO otbliblas)
ENDIF(OTB_USE_LIBLAS)
IF( OTB_COMPILE_JPEG2000 )
TARGET_LINK_LIBRARIES (OTBIO otbopenjpeg)
ENDIF( OTB_COMPILE_JPEG2000 )
......
......@@ -2,43 +2,43 @@ PROJECT(ImageExamples)
INCLUDE_REGULAR_EXPRESSION("^.*$")
ADD_EXECUTABLE(Image1 Image1.cxx )
TARGET_LINK_LIBRARIES(Image1 OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(Image1 OTBCommon OTBIO )
ADD_EXECUTABLE(Image2 Image2.cxx )
TARGET_LINK_LIBRARIES(Image2 OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(Image2 OTBCommon OTBIO )
ADD_EXECUTABLE(Image3 Image3.cxx )
TARGET_LINK_LIBRARIES(Image3 OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(Image3 OTBCommon OTBIO )
ADD_EXECUTABLE(Image4 Image4.cxx )
TARGET_LINK_LIBRARIES(Image4 OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(Image4 OTBCommon OTBIO )
ADD_EXECUTABLE(Image5 Image5.cxx )
TARGET_LINK_LIBRARIES(Image5 OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(Image5 OTBCommon OTBIO )
ADD_EXECUTABLE(Image6 Image6.cxx )
TARGET_LINK_LIBRARIES(Image6 OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(Image6 OTBCommon OTBIO )
ADD_EXECUTABLE(RGBImage RGBImage.cxx )
TARGET_LINK_LIBRARIES(RGBImage OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(RGBImage OTBCommon OTBIO )
ADD_EXECUTABLE(VectorImage VectorImage.cxx )
TARGET_LINK_LIBRARIES(VectorImage OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(VectorImage OTBCommon OTBIO )
ADD_EXECUTABLE(ImageAdaptor1 ImageAdaptor1.cxx )
TARGET_LINK_LIBRARIES(ImageAdaptor1 OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(ImageAdaptor1 OTBCommon OTBIO )
ADD_EXECUTABLE(ImageAdaptor2 ImageAdaptor2.cxx )
TARGET_LINK_LIBRARIES(ImageAdaptor2 OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(ImageAdaptor2 OTBCommon OTBIO )
ADD_EXECUTABLE(ImageAdaptor3 ImageAdaptor3.cxx )
TARGET_LINK_LIBRARIES(ImageAdaptor3 OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(ImageAdaptor3 OTBCommon OTBIO )
ADD_EXECUTABLE(ImageAdaptor4 ImageAdaptor4.cxx )
TARGET_LINK_LIBRARIES(ImageAdaptor4 OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(ImageAdaptor4 OTBCommon OTBIO )
ADD_EXECUTABLE(ImageListExample ImageListExample.cxx )
TARGET_LINK_LIBRARIES(ImageListExample OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(ImageListExample OTBCommon OTBIO )
IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
......@@ -99,6 +99,6 @@ ADD_TEST(Image6Test ${EXE_TESTS}
ADD_EXECUTABLE(otbImageExamplesTests otbImageExamplesTests.cxx)
TARGET_LINK_LIBRARIES(otbImageExamplesTests ITKAlgorithms ITKStatistics OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction OTBLearning OTBMultiScale ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(otbImageExamplesTests ITKAlgorithms ITKStatistics OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction OTBLearning OTBMultiScale )
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
......@@ -50,7 +50,7 @@ ADD_EXECUTABLE(MetadataExample MetadataExample.cxx )
TARGET_LINK_LIBRARIES(MetadataExample OTBCommon OTBIO)
ADD_EXECUTABLE(DXFReaderExample DXFReaderExample.cxx )
TARGET_LINK_LIBRARIES(DXFReaderExample OTBCommon OTBIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(DXFReaderExample OTBCommon OTBIO)
ADD_EXECUTABLE(VectorDataIOExample VectorDataIOExample.cxx )
TARGET_LINK_LIBRARIES(VectorDataIOExample OTBCommon OTBIO)
......@@ -61,13 +61,15 @@ TARGET_LINK_LIBRARIES(DEMToImageGenerator OTBProjections OTBIO OTBCommon )
ADD_EXECUTABLE(DEMToOrthoImageGenerator DEMToOrthoImageGenerator.cxx )
TARGET_LINK_LIBRARIES(DEMToOrthoImageGenerator OTBProjections OTBIO OTBCommon )
ADD_EXECUTABLE(LidarReaderExample LidarReaderExample.cxx )
TARGET_LINK_LIBRARIES(LidarReaderExample OTBIO OTBCommon )
IF(OTB_USE_LIBLAS)
ADD_EXECUTABLE(LidarReaderExample LidarReaderExample.cxx )
TARGET_LINK_LIBRARIES(LidarReaderExample OTBIO OTBCommon )
IF(ITK_USE_REVIEW)
ADD_EXECUTABLE(LidarToImageExample LidarToImageExample.cxx )
TARGET_LINK_LIBRARIES(LidarToImageExample OTBIO OTBCommon )
ENDIF(ITK_USE_REVIEW)
IF(ITK_USE_REVIEW)
ADD_EXECUTABLE(LidarToImageExample LidarToImageExample.cxx )
TARGET_LINK_LIBRARIES(LidarToImageExample OTBIO OTBCommon )
ENDIF(ITK_USE_REVIEW)
ENDIF(OTB_USE_LIBLAS)
IF( OTB_USE_CURL )
ADD_EXECUTABLE(TileMapImageIOExample TileMapImageIOExample.cxx)
......@@ -161,6 +163,7 @@ ADD_TEST(DEMToImageGeneratorTest ${EXE_TESTS1}
${INPUTDATA}/DEM_srtm
)
IF(OTB_USE_LIBLAS)
IF(ITK_USE_REVIEW)
ADD_TEST(LidarToImageExampleTest ${EXE_TESTS1}
--compare-image ${TOL} ${BASELINE}/lidar-image-4.hdr
......@@ -185,6 +188,7 @@ ADD_TEST(LidarToImageExample2Test ${EXE_TESTS1}
8
)
ENDIF(ITK_USE_REVIEW)
ENDIFIF(OTB_USE_LIBLAS)
IF( OTB_USE_CURL )
ADD_TEST(TileMapImageIOExampleTest ${EXE_TESTS2}
......
......@@ -24,7 +24,7 @@ ADD_EXECUTABLE(NeighborhoodIterators3 NeighborhoodIterators3.cxx)
TARGET_LINK_LIBRARIES(NeighborhoodIterators3 OTBIO OTBCommon )
ADD_EXECUTABLE(NeighborhoodIterators6 NeighborhoodIterators6.cxx)
TARGET_LINK_LIBRARIES(NeighborhoodIterators6 ITKAlgorithms ITKBasicFilters OTBIO OTBCommon ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(NeighborhoodIterators6 ITKAlgorithms ITKBasicFilters OTBIO OTBCommon )
ADD_EXECUTABLE(ImageRegionIteratorWithIndex ImageRegionIteratorWithIndex.cxx)
TARGET_LINK_LIBRARIES(ImageRegionIteratorWithIndex OTBIO OTBCommon )
......@@ -194,6 +194,6 @@ ADD_TEST(ShapedNeighborhoodIterators2Test ${EXE_TESTS}
ADD_EXECUTABLE(otbIteratorsExamplesTests otbIteratorsExamplesTests.cxx)
TARGET_LINK_LIBRARIES(otbIteratorsExamplesTests ITKAlgorithms ITKStatistics OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction OTBLearning OTBMultiScale ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
TARGET_LINK_LIBRARIES(otbIteratorsExamplesTests ITKAlgorithms ITKStatistics OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction OTBLearning OTBMultiScale )
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
......@@ -41,7 +41,10 @@ ENDIF(OTB_COMPILE_JPEG2000)
SET(IO_TESTS14 ${CXX_TEST_PATH}/otbIOTests14)
SET(IO_TESTS15 ${CXX_TEST_PATH}/otbIOTests15)
SET(IO_TESTS16 ${CXX_TEST_PATH}/otbIOTests16)
SET(IO_TESTS17 ${CXX_TEST_PATH}/otbIOTests17)
IF(OTB_USE_LIBLAS)
SET(IO_TESTS17 ${CXX_TEST_PATH}/otbIOTests17)
ENDIF(OTB_USE_LIBLAS)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ COMMON_TESTS3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -1679,29 +1682,31 @@ ADD_TEST(ioTvImageFileReaderTIF2RADCI4 ${IO_TESTS16}
# ${INPUTDATA}/rcc8_mire1.png
# ${TEMP}/ioImageFileReaderPNG2RADPHA.rad )
ADD_TEST(ioTvImageSeriesFileReader ${IO_TESTS16}
--compare-n-images ${TOL} 2
${BASELINE}/ioTvImageSeries-0.png
${TEMP}/ioTvImageSeries-0.png
${BASELINE}/ioTvImageSeries-1.png
${TEMP}/ioTvImageSeries-1.png
otbImageSeriesFileReader
-in ${EXAMPLEDATA}/GomaAvantApres
-out ${TEMP}/ioTvImageSeries.png
)
ADD_TEST(ioTuPointSetFileReaderNew ${IO_TESTS16}
IF(OTB_USE_LIBLAS)
ADD_TEST(ioTuPointSetFileReaderNew ${IO_TESTS17}
otbPointSetFileReaderNew )
ADD_TEST(ioTvPointSetFileReader ${IO_TESTS16}
ADD_TEST(ioTvPointSetFileReader ${IO_TESTS17}
--compare-ascii ${TOL} ${BASELINE_FILES}/ioPointSetFileReader.txt
${TEMP}/ioPointSetFileReader.txt
otbPointSetFileReader
${INPUTDATA}/srs.las
${TEMP}/ioPointSetFileReader.txt)
ENDIF(OTB_USE_LIBLAS)
ADD_TEST(ioTvImageSeriesFileReader ${IO_TESTS17}
--compare-n-images ${TOL} 2
${BASELINE}/ioTvImageSeries-0.png
${TEMP}/ioTvImageSeries-0.png
${BASELINE}/ioTvImageSeries-1.png
${TEMP}/ioTvImageSeries-1.png
otbImageSeriesFileReader
-in ${EXAMPLEDATA}/GomaAvantApres
-out ${TEMP}/ioTvImageSeries.png
)
#----------------------------------------------------------------------------------
SET(BasicIO_SRCS1
......@@ -1835,12 +1840,12 @@ otbImageFileReaderRADComplexInt.cxx
otbImageFileReaderRADComplexFloat.cxx
otbImageFileReaderRADComplexFloatExtract.cxx
otbImageFileReaderRADComplexDouble.cxx
otbPointSetFileReaderNew.cxx
otbPointSetFileReader.cxx
otbImageSeriesFileReader.cxx
)
SET(BasicIO_SRCS17
otbImageSeriesFileReader.cxx
otbPointSetFileReaderNew.cxx
otbPointSetFileReader.cxx
)
INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}")
......@@ -1901,8 +1906,10 @@ TARGET_LINK_LIBRARIES(otbIOTests15 OTBIO )
ADD_EXECUTABLE(otbIOTests16 otbIOTests16.cxx ${BasicIO_SRCS16})
TARGET_LINK_LIBRARIES(otbIOTests16 OTBIO )
IF(OTB_USE_LIBLAS)
ADD_EXECUTABLE(otbIOTests17 otbIOTests17.cxx ${BasicIO_SRCS17})
TARGET_LINK_LIBRARIES(otbIOTests17 OTBIO )
ENDIF(OTB_USE_LIBLAS)
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
......@@ -36,6 +36,5 @@ void RegisterTests()
REGISTER_TEST(otbImageFileReaderRADComplexFloat);
REGISTER_TEST(otbImageFileReaderRADComplexFloatExtract);
REGISTER_TEST(otbImageFileReaderRADComplexInt);
REGISTER_TEST(otbPointSetFileReaderNew);
REGISTER_TEST(otbPointSetFileReader);
REGISTER_TEST(otbImageSeriesFileReader);
}
......@@ -28,5 +28,6 @@
void RegisterTests()
{
REGISTER_TEST(otbImageSeriesFileReader);
REGISTER_TEST(otbPointSetFileReaderNew);
REGISTER_TEST(otbPointSetFileReader);
}
......@@ -16,6 +16,10 @@ IF(NOT OTB_USE_EXTERNAL_OPENTHREADS)
ENDIF(NOT OTB_USE_EXTERNAL_OPENTHREADS)
IF(OTB_USE_LIBLAS)
SUBDIRS( otbliblas )
ENDIF(OTB_USE_LIBLAS)
IF(OTB_COMPILE_JPEG2000)
SUBDIRS( otbopenjpeg )
ENDIF(OTB_COMPILE_JPEG2000)
......@@ -29,8 +33,7 @@ IF(NOT OTB_USE_EXTERNAL_BOOST)
SUBDIRS(BGL)
ENDIF(NOT OTB_USE_EXTERNAL_BOOST)
SUBDIRS(otbsvm dxflib InsightJournal otbossim otbossimplugins otb6S tinyXMLlib otbkml otbliblas otbedison otbsiftfast)
SUBDIRS(otbsvm dxflib InsightJournal otbossim otbossimplugins otb6S tinyXMLlib otbkml otbedison otbsiftfast)
IF(BUILD_TESTING)
SUBDIRS( Dart )
......
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