Commit 470dc9e4 authored by Thomas Feuvrier's avatar Thomas Feuvrier

JPEG2000 : Si paltform Visual 7, JPEG2000 est desactive.

Utilisation de deux variable CMakeLists OTB_USE_JPEG2000 (modif utilisateur) et OTB_COMPILE_JPEG2000 (variable interne pour gérer la compilation)
: Modification de la variable define pour la compialtion de JPEG2000:  remplacement de ADD_DEFINITION(-DOTB_USE_JPEG2000 ) par ADD_DEFINITION(-DOTB_COMPILE_JPEG2000 )
...
parent 4dd0a34a
......@@ -85,10 +85,6 @@ OPTION(OTB_USE_JPEG2000 "Use to support jpeg2000 image file format." ON)
OPTION(OTB_USE_EXTERNAL_ITK "Use an outside build of ITK." OFF)
IF(OTB_USE_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})
......@@ -96,16 +92,36 @@ 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 -DUSE_OPJ_DEPRECATED)
ENDIF(OTB_USE_JPEG2000)
ENDIF(OTB_USE_EXTERNAL_ITK)
# JPEG2000 specification control
IF( OTB_USE_JPEG2000 )
SET(OTB_COMPILE_JPEG2000 1)
IF(OTB_USE_EXTERNAL_ITK)
MESSAGE(STATUS "WARNING: Due to conflicting libraries, jpeg2000 support is disabled when using external ITK.")
SET(OTB_COMPILE_JPEG2000 0)
ENDIF(OTB_USE_EXTERNAL_ITK)
IF(CMAKE_GENERATOR MATCHES "^Visual Studio 7$")
MESSAGE(STATUS "WARNING: In Visual Studio 7, jpeg2000 support is disable.")
SET(OTB_COMPILE_JPEG2000 0)
ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio 7$")
IF(CMAKE_GENERATOR MATCHES "^Visual Studio 7 .NET 2003$")
MESSAGE(STATUS "WARNING: In Visual Studio 7, jpeg2000 support is disable.")
SET(OTB_COMPILE_JPEG2000 0)
ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio 7 .NET 2003$")
ENDIF( OTB_USE_JPEG2000 )
# Check jpeg2000 support
IF(OTB_COMPILE_JPEG2000)
ADD_DEFINITIONS(-DOTB_COMPILE_JPEG2000 -DUSE_OPJ_DEPRECATED)
IF(NOT BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(NOT BUILD_SHARED_LIBS)
ENDIF(OTB_COMPILE_JPEG2000)
ENDIF(OTB_USE_EXTERNAL_ITK)
#-----------------------------------------------------------------------------
# Option for generate Visu tools !!!
......
......@@ -2,12 +2,11 @@
FILE(GLOB OTBIO_SRCS "*.cxx" )
# Case for release 2.2.1
IF(OTB_USE_EXTERNAL_ITK OR NOT OTB_USE_JPEG2000)
IF(NOT OTB_COMPILE_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(OTB_USE_EXTERNAL_ITK OR NOT OTB_USE_JPEG2000)
ENDIF(NOT OTB_COMPILE_JPEG2000)
IF( NOT OTB_USE_CURL )
LIST(REMOVE_ITEM OTBIO_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/otbTileMapImageIOFactory.cxx" )
......@@ -15,9 +14,8 @@ IF( NOT OTB_USE_CURL )
ENDIF( NOT OTB_USE_CURL )
# Case for release 2.2.1
# otbopenjpeg
IF(OTB_USE_JPEG2000)
IF(OTB_COMPILE_JPEG2000)
IF(WIN32)
IF(OTB_BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
......@@ -25,14 +23,14 @@ IF(OTB_USE_JPEG2000)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(OTB_BUILD_SHARED_LIBS)
ENDIF(WIN32)
ENDIF(OTB_USE_JPEG2000)
ENDIF(OTB_COMPILE_JPEG2000)
ADD_LIBRARY(OTBIO ${OTBIO_SRCS})
TARGET_LINK_LIBRARIES (OTBIO gdal OTBCommon ITKIO ITKCommon otbossim dxf )
IF( OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
IF( OTB_COMPILE_JPEG2000 )
TARGET_LINK_LIBRARIES (OTBIO otbopenjpeg)
ENDIF( OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
ENDIF( OTB_COMPILE_JPEG2000 )
IF( OTB_USE_CURL )
TARGET_LINK_LIBRARIES (OTBIO ${CURL_LIBRARY})
......@@ -52,19 +50,10 @@ IF( NOT OTB_USE_CURL )
ENDIF( NOT OTB_USE_CURL )
# Case for release 2.2.1
IF(OTB_USE_EXTERNAL_ITK OR NOT OTB_USE_JPEG2000)
IF(NOT OTB_COMPILE_JPEG2000)
LIST(REMOVE_ITEM __files1 "${CMAKE_CURRENT_SOURCE_DIR}/otbJpeg2000ImageIOFactory.h" )
LIST(REMOVE_ITEM __files1 "${CMAKE_CURRENT_SOURCE_DIR}/otbJpeg2000ImageIO.h" )
ENDIF(OTB_USE_EXTERNAL_ITK OR NOT OTB_USE_JPEG2000)
#IF(OTB_USE_EXTERNAL_ITK)
# IF(OTB_USE_JPEG2000)
# LIST(REMOVE_ITEM __files1 "${CMAKE_CURRENT_SOURCE_DIR}/otbJpeg2000ImageIOFactory.h" )
# LIST(REMOVE_ITEM __files1 "${CMAKE_CURRENT_SOURCE_DIR}/otbJpeg2000ImageIO.h" )
# ENDIF(OTB_USE_JPEG2000)
#ENDIF(OTB_USE_EXTERNAL_ITK)
ENDIF(NOT OTB_COMPILE_JPEG2000)
INSTALL(FILES ${__files1} ${__files2}
DESTINATION ${OTB_INSTALL_INCLUDE_DIR}/IO
......
......@@ -29,8 +29,7 @@
#include "otbLUMImageIOFactory.h"
#include "otbBSQImageIOFactory.h"
// Case for release 2.2.1
#ifdef OTB_USE_JPEG2000
#ifdef OTB_COMPILE_JPEG2000
#include "otbJPEG2000ImageIOFactory.h"
#endif
......@@ -68,8 +67,7 @@ namespace otb
// LUM format for OTB
itk::ObjectFactoryBase::RegisterFactory( LUMImageIOFactory::New() );
#ifdef OTB_USE_JPEG2000
// Case for release 2.2.1
#ifdef OTB_COMPILE_JPEG2000
// JPEG2000 : New format for OTB
itk::ObjectFactoryBase::RegisterFactory( JPEG2000ImageIOFactory::New() );
#endif
......
......@@ -31,10 +31,9 @@ SET(IO_TESTS10 ${CXX_TEST_PATH}/otbIOTests10)
SET(IO_TESTS11 ${CXX_TEST_PATH}/otbIOTests11)
SET(IO_TESTS12 ${CXX_TEST_PATH}/otbIOTests12)
# Case for release 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
IF(OTB_COMPILE_JPEG2000)
SET(IO_TESTS13 ${CXX_TEST_PATH}/otbIOTests13)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
ENDIF(OTB_COMPILE_JPEG2000)
SET(IO_TESTS14 ${CXX_TEST_PATH}/otbIOTests14)
SET(IO_TESTS15 ${CXX_TEST_PATH}/otbIOTests15)
......@@ -1275,8 +1274,7 @@ ADD_TEST(ioTvossimElevManagerTest ${IO_TESTS12}
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbIOTESTS13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Case for release 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
IF(OTB_COMPILE_JPEG2000)
# --- JPEG2000 can read ---
ADD_TEST(ioTuJ2KImageIOCanRead ${IO_TESTS13}
......@@ -1331,7 +1329,7 @@ ADD_TEST(ioTuJPEG2000ImageIOCanWrite ${IO_TESTS13}
${INPUTDATA}/toto.j2k
)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
ENDIF(OTB_COMPILE_JPEG2000)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbIOTESTS14 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -1499,13 +1497,12 @@ otbOssimElevManagerTest.cxx
)
# Case for release 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
IF(OTB_COMPILE_JPEG2000)
SET(BasicIO_SRCS13
otbJPEG2000ImageIOTestCanRead.cxx
otbJPEG2000ImageIOTestCanWrite.cxx
)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
ENDIF(OTB_COMPILE_JPEG2000)
SET(BasicIO_SRCS14
......@@ -1567,14 +1564,14 @@ ADD_EXECUTABLE(otbIOTests12 otbIOTests12.cxx ${BasicIO_SRCS12})
TARGET_LINK_LIBRARIES(otbIOTests12 OTBIO OTBCommon gdal ITKIO ITKCommon dxf)
# Case for releae 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
IF(OTB_COMPILE_JPEG2000)
IF(NOT BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(NOT BUILD_SHARED_LIBS)
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)
ENDIF(OTB_COMPILE_JPEG2000)
ADD_EXECUTABLE(otbIOTests14 otbIOTests14.cxx ${BasicIO_SRCS14})
TARGET_LINK_LIBRARIES(otbIOTests14 OTBIO OTBCommon gdal ITKIO ITKCommon dxf)
......
......@@ -325,13 +325,13 @@ ADD_TEST(utOssimRadarSatSupport ${UTILITIES_TESTS}
# ------- lib OpenJpeg ------------------------------
# Case for release 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
IF(OTB_COMPILE_JPEG2000)
ADD_TEST(utOpenJpegEncoder ${UTILITIES_TESTS}
openJpegEncoder)
ADD_TEST(utOpenJpegDecoder ${UTILITIES_TESTS}
openJpegDecoder)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
ENDIF(OTB_COMPILE_JPEG2000)
# ------- SIFT -------------------------------------
......@@ -418,10 +418,9 @@ ossimRadarSatSupport.cxx
itkScaleInvariantFeatureImageFilterTest.cxx
)
# Case for release 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
IF(OTB_COMPILE_JPEG2000)
SET(UtilitiesTests_SRCS ${UtilitiesTests_SRCS} openJpegEncoder.cxx openJpegDecoder.cxx)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
ENDIF(OTB_COMPILE_JPEG2000)
INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}")
......@@ -435,10 +434,9 @@ ENDIF(NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE(otbUtilitiesTests otbUtilitiesTests.cxx ${UtilitiesTests_SRCS})
TARGET_LINK_LIBRARIES(otbUtilitiesTests OTBIO OTBCommon gdal ITKIO ITKAlgorithms ITKStatistics ITKCommon otbossim otbsvm otb6S tinyXML )
# Case for release 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
IF(OTB_COMPILE_JPEG2000)
TARGET_LINK_LIBRARIES(otbUtilitiesTests otbopenjpeg)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
ENDIF(OTB_COMPILE_JPEG2000)
IF(UNIX)
TARGET_LINK_LIBRARIES (otbUtilitiesTests m)
......
......@@ -40,11 +40,9 @@ REGISTER_TEST(otbSVMComposedKernelFunctorTest);
REGISTER_TEST(ossimRadarSatSupport);
REGISTER_TEST(itk2DScaleInvariantFeatureImageFilterTest);
// register openJpeg tests if necessary
#ifdef OTB_USE_JPEG2000
#ifndef OTB_USE_EXTERNAL_ITK
#ifdef OTB_COMPILE_JPEG2000
REGISTER_TEST(openJpegEncoder);
REGISTER_TEST(openJpegDecoder);
#endif
#endif
}
......@@ -3,12 +3,12 @@
IF(NOT OTB_USE_EXTERNAL_ITK)
SUBDIRS(ITK)
# Case for release 2.2.1
IF(OTB_USE_JPEG2000)
SUBDIRS( otbopenjpeg)
ENDIF(OTB_USE_JPEG2000)
ENDIF(NOT OTB_USE_EXTERNAL_ITK)
IF(OTB_COMPILE_JPEG2000)
SUBDIRS( otbopenjpeg)
ENDIF(OTB_COMPILE_JPEG2000)
IF(OTB_USE_VISU_GUI)
IF(NOT OTB_USE_EXTERNAL_FLTK)
SUBDIRS( FLTK )
......
......@@ -25,10 +25,10 @@ SET(OPJ_PREFIX "itk")
# In static, pb of linking between itkopenjpeg and otbopenjeg (method definided twice)
# Case for release 2.2.1
#-----------------------------
IF(NOT OTB_USE_JPEG2000)
IF(NOT OTB_COMPILE_JPEG2000)
ITK_THIRD_PARTY_SUBDIR(OpenJPEG openjpeg)
ITK_THIRD_PARTY_SUBDIR(GDCM gdcm)
ENDIF(NOT OTB_USE_JPEG2000)
ENDIF(NOT OTB_COMPILE_JPEG2000)
#------------------------------------------------------------------------------
......
......@@ -88,10 +88,11 @@ SUBDIRS(libopenjpeg)
#-----------------------------------------------------------------------------
# For the documentation
OPTION(BUILD_DOCUMENTATION "Build the doxygen documentation" OFF)
IF(BUILD_DOCUMENTATION)
SUBDIRS(doc)
ENDIF(BUILD_DOCUMENTATION)
# Comment for 2.4.0
#OPTION(BUILD_DOCUMENTATION "Build the doxygen documentation" OFF)
#IF(BUILD_DOCUMENTATION)
# SUBDIRS(doc)
#ENDIF(BUILD_DOCUMENTATION)
#-----------------------------------------------------------------------------
# For openjpeg team if they ever want Dart+CMake
......
......@@ -42,12 +42,11 @@ SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
# ${OTB_SOURCE_DIR}/Utilities/otbkml/third_party/zlib-1.2.3
# ${OTB_SOURCE_DIR}/Utilities/otbkml/third_party/zlib-1.2.3/contrib
)
# Case for release 2.2.1
IF(OTB_USE_JPEG2000)
IF(OTB_COMPILE_JPEG2000)
SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${OTB_SOURCE_DIR}/Utilities/otbopenjpeg
${OTB_SOURCE_DIR}/Utilities/otbopenjpeg/libopenjpeg)
ENDIF(OTB_USE_JPEG2000)
ENDIF(OTB_COMPILE_JPEG2000)
#-----------------------------------------------------------------------------
# Include directories from the ossim build tree
......@@ -197,12 +196,11 @@ SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
# ${OTB_INSTALL_INCLUDE_DIR}/Utilities/otbkml/third_party/zlib-1.2.3/contrib
)
# Case for release 2.2.1
IF(OTB_USE_JPEG2000)
IF(OTB_COMPILE_JPEG2000)
SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
${OTB_INSTALL_INCLUDE_DIR}/Utilities/otbopenjpeg
${OTB_INSTALL_INCLUDE_DIR}/Utilities/otbopenjpeg/libopenjpeg)
ENDIF(OTB_USE_JPEG2000)
ENDIF(OTB_COMPILE_JPEG2000)
#For GDAL header file
SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
......
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