Commit b9bf1d5a authored by OTB Bot's avatar OTB Bot

Corrections sur OpenJPEG (compilation sous Visual de otbUtilitiesTests est OK....

Corrections sur OpenJPEG (compilation sous Visual de otbUtilitiesTests est OK. PB toujours sur le test otbIOTest13 qui teste JPEG2000
parent c3b4b6dc
......@@ -18,28 +18,21 @@ ENDIF( NOT OTB_USE_CURL )
# Case for release 2.2.1
# otbopenjpeg
IF(OTB_USE_JPEG2000)
IF(OTB_BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ELSE(OTB_BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(OTB_BUILD_SHARED_LIBS)
IF(WIN32)
IF(OTB_BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ELSE(OTB_BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(OTB_BUILD_SHARED_LIBS)
ENDIF(WIN32)
ENDIF(OTB_USE_JPEG2000)
ADD_LIBRARY(OTBIO ${OTBIO_SRCS})
#PROVISOIRE
IF(OTB_USE_EXTERNAL_ITK)
TARGET_LINK_LIBRARIES (OTBIO gdal OTBCommon ITKIO ITKCommon otbossim dxf )
ELSE(OTB_USE_EXTERNAL_ITK)
# Case for release 2.2.1
## TARGET_LINK_LIBRARIES (OTBIO gdal OTBCommon ITKIO ITKCommon otbossim dxf otbopenjpeg)
#TARGET_LINK_LIBRARIES (OTBIO gdal OTBCommon ITKIO ITKCommon otbossim dxf)
IF(OTB_USE_JPEG2000)
TARGET_LINK_LIBRARIES (OTBIO gdal OTBCommon ITKIO ITKCommon otbossim dxf otbopenjpeg)
ELSE(OTB_USE_JPEG2000)
TARGET_LINK_LIBRARIES (OTBIO gdal OTBCommon ITKIO ITKCommon otbossim dxf)
ENDIF(OTB_USE_JPEG2000)
ENDIF(OTB_USE_EXTERNAL_ITK)
TARGET_LINK_LIBRARIES (OTBIO gdal OTBCommon ITKIO ITKCommon otbossim dxf )
IF( OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
TARGET_LINK_LIBRARIES (OTBIO otbopenjpeg)
ENDIF( OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
IF( OTB_USE_CURL )
TARGET_LINK_LIBRARIES (OTBIO ${CURL_LIBRARY})
......
......@@ -24,9 +24,9 @@
#define USE_OPJ_DEPRECATED
#endif
extern "C" {
//extern "C" {
#include "openjpeg.h"
}
//}
namespace otb
{
......
......@@ -1568,6 +1568,10 @@ 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(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)
......
......@@ -25,6 +25,7 @@
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbStreamingImageFileWriter.h"
......
......@@ -420,13 +420,18 @@ itkScaleInvariantFeatureImageFilterTest.cxx
# Case for release 2.2.1
IF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
SET(UtilitiesTests_SRCS ${UtilitiesTests_SRCS} openJpegEncoder.cxx openJpegDecoder.cxx)
SET(UtilitiesTests_SRCS ${UtilitiesTests_SRCS} openJpegEncoder.cxx openJpegDecoder.cxx)
ENDIF(OTB_USE_JPEG2000 AND NOT OTB_USE_EXTERNAL_ITK)
INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}")
IF(NOT BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
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 )
......
This diff is collapsed.
This diff is collapsed.
......@@ -118,6 +118,22 @@ IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(_MSC_VER)
STRING_APPEND( CMAKE_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:\"libcmtd.lib\"")
STRING_APPEND( CMAKE_EXE_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:\"libcmt.lib\"")
STRING_APPEND( CMAKE_SHARED_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:\"libcmtd.lib\"")
STRING_APPEND( CMAKE_SHARED_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:\"libcmt.lib\"")
# make changes persistent
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG}
CACHE STRING "Debug builds linker flags" FORCE )
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE}
CACHE STRING "Release builds linker flags" FORCE )
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG}
CACHE STRING "flags for linking a DLL in Debug build" FORCE)
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}
CACHE STRING "flags for linking a DLL in Debug build" FORCE)
ENDIF(_MSC_VER)
#========================================
# OTB added
IF(CYGWIN OR MINGW)
......
INCLUDE_REGULAR_EXPRESSION("^.*$")
# Defines the source code for the library
SET(OPENJPEG_SRCS
tcd.c
bio.c
cio.c
dwt.c
event.c
image.c
j2k.c
j2k_lib.c
jp2.c
jpt.c
mct.c
mqc.c
openjpeg.c
pi.c
raw.c
t1.c
tgt.c
profile.c
invert.c
function_list.c
t2.c
)
# disable gcc warnings
IF(CMAKE_COMPILER_IS_GNUCC)
FOREACH(f ${OPENJPEG_SRCS})
SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES COMPILE_FLAGS -w )
ENDFOREACH(f)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
# Pass proper definition to preprocessor to generate shared lib
IF (WIN32)
IF (BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ELSE (BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF (BUILD_SHARED_LIBS)
ENDIF (WIN32)
IF(ENABLE_PROFILING)
ADD_DEFINITIONS(-D_PROFILE)
ENDIF(ENABLE_PROFILING)
ADD_DEFINITIONS(-DUSE_OPJ_DEPRECATED)
# Create the library
ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME} PROPERTIES
${OPENJPEG_LIBRARY_PROPERTIES})
# Install library
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}
RUNTIME DESTINATION ${OTB_INSTALL_BIN_DIR} COMPONENT RuntimeLibraries
LIBRARY DESTINATION ${OTB_INSTALL_LIB_DIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${OTB_INSTALL_LIB_DIR} COMPONENT Development)
# Install includes files
INSTALL(FILES openjpeg.h
DESTINATION ${OTB_INSTALL_INCLUDE_DIR}/Utilities/otbopenjpeg/libopenjpeg
COMPONENT Development)
INCLUDE_REGULAR_EXPRESSION("^.*$")
# Defines the source code for the library
SET(OPENJPEG_SRCS
tcd.c
bio.c
cio.c
dwt.c
event.c
image.c
j2k.c
j2k_lib.c
jp2.c
jpt.c
mct.c
mqc.c
openjpeg.c
pi.c
raw.c
t1.c
tgt.c
profile.c
invert.c
function_list.c
t2.c
)
# disable gcc warnings
IF(CMAKE_COMPILER_IS_GNUCC)
FOREACH(f ${OPENJPEG_SRCS})
SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES COMPILE_FLAGS -w )
ENDFOREACH(f)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
# Pass proper definition to preprocessor to generate shared lib
IF (WIN32)
IF (BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ELSE (BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF (BUILD_SHARED_LIBS)
ENDIF (WIN32)
IF(ENABLE_PROFILING)
ADD_DEFINITIONS(-D_PROFILE)
ENDIF(ENABLE_PROFILING)
ADD_DEFINITIONS(-DUSE_OPJ_DEPRECATED)
# Create the library
ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME} PROPERTIES
${OPENJPEG_LIBRARY_PROPERTIES})
# Install library
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}
RUNTIME DESTINATION ${OTB_INSTALL_BIN_DIR} COMPONENT RuntimeLibraries
LIBRARY DESTINATION ${OTB_INSTALL_LIB_DIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${OTB_INSTALL_LIB_DIR} COMPONENT Development)
# Install includes files
INSTALL(FILES openjpeg.h
DESTINATION ${OTB_INSTALL_INCLUDE_DIR}/Utilities/otbopenjpeg/libopenjpeg
COMPONENT Development)
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