Commit f4ae4546 authored by Thomas Feuvrier's avatar Thomas Feuvrier

Correction sur la gestion des options du JPEG2000 : Si ITK en externe,...

Correction sur la gestion des options du JPEG2000 : Si ITK en externe, JPEG2000 est désactivé. Modf des CMakeLists.txt des IO, Testing/IO, Testing/Utilities
parent 1842f9a4
......@@ -72,11 +72,7 @@ OPTION(BUILD_TESTING "Build testing." OFF)
# Case for release 2.2.1
# Use the openjpeg library.
OPTION(OTB_USE_JPEG2000 "Use to support jpeg2000 image file format." OFF)
MARK_AS_ADVANCED(OTB_USE_JPEG2000)
# Add compiler option
IF(OTB_USE_JPEG2000)
ADD_DEFINITIONS(-DOTB_USE_JPEG2000)
ENDIF(OTB_USE_JPEG2000)
#MARK_AS_ADVANCED(OTB_USE_JPEG2000)
#-----------------------------------------------------------------------------
......@@ -89,8 +85,10 @@ ENDIF(OTB_USE_JPEG2000)
OPTION(OTB_USE_EXTERNAL_ITK "Use an outside build of ITK." OFF)
IF(OTB_USE_EXTERNAL_ITK)
# Commented for release 2.2.0
# MESSAGE(STATUS "WARNING: Due to conflicting libraries, jpeg2000 support is disabled when using external ITK.")
# Case for release 2.2.1
IF(OTB_USE_JPEG2000)
MESSAGE(STATUS "WARNING: Due to conflicting libraries, jpeg2000 support is disabled when using external ITK.")
ENDIF(OTB_USE_JPEG2000)
FIND_PACKAGE(ITK)
IF(ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
......@@ -98,6 +96,11 @@ IF(OTB_USE_EXTERNAL_ITK)
MESSAGE(FATAL_ERROR
"Cannot build OTB project without ITK. Please set ITK_DIR or set OTB_USE_EXTERNAL_ITK OFF to use INTERNAL ITK set on OTB/Utilities repository.")
ENDIF(ITK_FOUND)
ELSE(OTB_USE_EXTERNAL_ITK)
# Add compiler option
IF(OTB_USE_JPEG2000)
ADD_DEFINITIONS(-DOTB_USE_JPEG2000)
ENDIF(OTB_USE_JPEG2000)
ENDIF(OTB_USE_EXTERNAL_ITK)
#-----------------------------------------------------------------------------
......
......@@ -3,13 +3,11 @@
FILE(GLOB OTBIO_SRCS "*.cxx" )
# Case for release 2.2.1
IF(OTB_USE_EXTERNAL_ITK)
IF(NOT OTB_USE_JPEG2000)
IF(OTB_USE_EXTERNAL_ITK OR NOT OTB_USE_JPEG2000)
LIST(REMOVE_ITEM OTBIO_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/otbJPEG2000ImageIO.cxx" )
LIST(REMOVE_ITEM OTBIO_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/otbJPEG2000ImageIOFactory.cxx" )
ADD_DEFINITIONS(-DOTB_JPEG2000_DISABLED)
ENDIF(NOT OTB_USE_JPEG2000)
ENDIF(OTB_USE_EXTERNAL_ITK)
ENDIF(OTB_USE_EXTERNAL_ITK OR NOT OTB_USE_JPEG2000)
IF( NOT OTB_USE_CURL )
LIST(REMOVE_ITEM OTBIO_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/otbTileMapImageIOFactory.cxx" )
......
......@@ -28,10 +28,12 @@
#include "otbGDALImageIOFactory.h"
#include "otbLUMImageIOFactory.h"
#include "otbBSQImageIOFactory.h"
// Commented for release 2.2.0
//#ifndef OTB_JPEG2000_DISABLED
//#include "otbJPEG2000ImageIOFactory.h"
//#endif
// Case for release 2.2.1
#ifdef OTB_USE_JPEG2000
#include "otbJPEG2000ImageIOFactory.h"
#endif
#ifdef OTB_USE_CURL
#include "otbTileMapImageIOFactory.h"
#endif
......@@ -66,11 +68,11 @@ namespace otb
// LUM format for OTB
itk::ObjectFactoryBase::RegisterFactory( LUMImageIOFactory::New() );
// Commented for release 2.2.0
// #ifndef OTB_JPEG2000_DISABLED
#ifdef OTB_USE_JPEG2000
// Case for release 2.2.1
// JPEG2000 : New format for OTB
// itk::ObjectFactoryBase::RegisterFactory( JPEG2000ImageIOFactory::New() );
// #endif
itk::ObjectFactoryBase::RegisterFactory( JPEG2000ImageIOFactory::New() );
#endif
// GDAL : New format for OTB
itk::ObjectFactoryBase::RegisterFactory( GDALImageIOFactory::New() );
......
......@@ -30,7 +30,12 @@ SET(IO_TESTS9 ${CXX_TEST_PATH}/otbIOTests9)
SET(IO_TESTS10 ${CXX_TEST_PATH}/otbIOTests10)
SET(IO_TESTS11 ${CXX_TEST_PATH}/otbIOTests11)
SET(IO_TESTS12 ${CXX_TEST_PATH}/otbIOTests12)
SET(IO_TESTS13 ${CXX_TEST_PATH}/otbIOTests13)
# Case for release 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
SET(IO_TESTS13 ${CXX_TEST_PATH}/otbIOTests13)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
SET(IO_TESTS14 ${CXX_TEST_PATH}/otbIOTests14)
SET(IO_TESTS15 ${CXX_TEST_PATH}/otbIOTests15)
......@@ -1271,8 +1276,7 @@ ADD_TEST(ioTvossimElevManagerTest ${IO_TESTS12}
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Case for release 2.2.1
IF(OTB_USE_JPEG2000)
IF(NOT OTB_USE_EXTERNAL_ITK)
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
# --- JPEG2000 can read ---
ADD_TEST(ioTuJ2KImageIOCanRead ${IO_TESTS13}
......@@ -1326,8 +1330,8 @@ ADD_TEST(ioTuJPEG2000ImageIOCanWrite ${IO_TESTS13}
otbJPEG2000ImageIOTestCanWrite
${INPUTDATA}/toto.j2k
)
ENDIF(NOT OTB_USE_EXTERNAL_ITK)
ENDIF(OTB_USE_JPEG2000)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbIOTESTS14 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -1495,20 +1499,14 @@ otbOssimElevManagerTest.cxx
)
IF(OTB_USE_JPEG2000)
# Case for release 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
SET(BasicIO_SRCS13
otbJPEG2000ImageIOTestCanRead.cxx
otbJPEG2000ImageIOTestCanWrite.cxx
)
ENDIF(OTB_USE_JPEG2000)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
# Case for release 2.2.1
IF(OTB_USE_JPEG2000)
IF(OTB_USE_EXTERNAL_ITK)
LIST(REMOVE_ITEM BasicIO_SRCS13 "${CMAKE_CURRENT_SOURCE_DIR}/otbJPEG2000ImageIOTestCanRead.cxx" )
LIST(REMOVE_ITEM BasicIO_SRCS13 "${CMAKE_CURRENT_SOURCE_DIR}/otbJPEG2000ImageIOTestCanWrite.cxx" )
ENDIF(OTB_USE_EXTERNAL_ITK)
ENDIF(OTB_USE_JPEG2000)
SET(BasicIO_SRCS14
otbOGRDriverTest.cxx
......@@ -1568,10 +1566,11 @@ TARGET_LINK_LIBRARIES(otbIOTests11 OTBIO OTBCommon gdal ITKIO ITKCommon dxf)
ADD_EXECUTABLE(otbIOTests12 otbIOTests12.cxx ${BasicIO_SRCS12})
TARGET_LINK_LIBRARIES(otbIOTests12 OTBIO OTBCommon gdal ITKIO ITKCommon dxf)
IF(NOT OTB_USE_EXTERNAL_ITK)
ADD_EXECUTABLE(otbIOTests13 otbIOTests13.cxx ${BasicIO_SRCS13})
TARGET_LINK_LIBRARIES(otbIOTests13 OTBIO OTBCommon gdal ITKIO ITKCommon dxf)
ENDIF(NOT OTB_USE_EXTERNAL_ITK)
# Case for releae 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
ADD_EXECUTABLE(otbIOTests13 otbIOTests13.cxx ${BasicIO_SRCS13})
TARGET_LINK_LIBRARIES(otbIOTests13 OTBIO OTBCommon gdal ITKIO ITKCommon dxf otbopenjpeg)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
ADD_EXECUTABLE(otbIOTests14 otbIOTests14.cxx ${BasicIO_SRCS14})
TARGET_LINK_LIBRARIES(otbIOTests14 OTBIO OTBCommon gdal ITKIO ITKCommon dxf)
......
......@@ -28,10 +28,6 @@
void RegisterTests()
{
//# Case for release 2.2.1
if(OTB_USE_JPEG2000)
{
REGISTER_TEST(otbJPEG2000ImageIOTestCanRead);
REGISTER_TEST(otbJPEG2000ImageIOTestCanWrite);
}
REGISTER_TEST(otbJPEG2000ImageIOTestCanRead);
REGISTER_TEST(otbJPEG2000ImageIOTestCanWrite);
}
......@@ -4,9 +4,9 @@
IF(NOT OTB_USE_EXTERNAL_ITK)
SUBDIRS(ITK)
# Case for release 2.2.1
IF(NOT OTB_USE_JPEG2000)
SUBDIRS( ITK otbopenjpeg)
ENDIF(NOT OTB_USE_JPEG2000)
IF(OTB_USE_JPEG2000)
SUBDIRS( otbopenjpeg)
ENDIF(OTB_USE_JPEG2000)
ENDIF(NOT OTB_USE_EXTERNAL_ITK)
IF(OTB_USE_VISU_GUI)
......
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