[trunk] Convert CMake-language commands to lower case

Ancient CMake versions required upper-case commands.  Later command names became case-insensitive.  Now the preferred style is lower-case.
This also changes all the key words to lower case. The primary reason for changing key words is that all documentation for CMakeLists.txt now shows the key words as lower case. Even the printed “Mastering CMake v5” uses lower case.
Thanks to Hans Johnson
This commit is contained in:
Mickael Savinaud 2012-08-30 17:14:39 +00:00
parent f16216e270
commit d5bb3b0039
24 changed files with 715 additions and 715 deletions

View File

@ -8,11 +8,11 @@
# #
#---------------------------------------------------------------------- #----------------------------------------------------------------------
SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000) set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50) set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000) set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000)
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE} ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
# Exclude files from the Testing directories # Exclude files from the Testing directories
@ -22,7 +22,7 @@ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
".*/thirdparty/.*" ".*/thirdparty/.*"
) )
SET(CTEST_CUSTOM_WARNING_EXCEPTION set(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION} ${CTEST_CUSTOM_WARNING_EXCEPTION}
# Suppress warning caused by intentional messages about deprecation # Suppress warning caused by intentional messages about deprecation

View File

@ -7,10 +7,10 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# #
FIND_PROGRAM(CPPCHECK_EXECUTABLE find_program(CPPCHECK_EXECUTABLE
cppcheck cppcheck
) )
MARK_AS_ADVANCED( mark_as_advanced(
CPPCHECK_EXECUTABLE CPPCHECK_EXECUTABLE
) )

View File

@ -1,20 +1,20 @@
# Look for the header file. # Look for the header file.
FIND_PATH(FCGI_INCLUDE_DIR NAMES fastcgi.h) find_path(FCGI_INCLUDE_DIR NAMES fastcgi.h)
# Look for the library. # Look for the library.
FIND_LIBRARY(FCGI_LIBRARY NAMES fcgi) find_library(FCGI_LIBRARY NAMES fcgi)
# Handle the QUIETLY and REQUIRED arguments and set FCGI_FOUND to TRUE if all listed variables are TRUE. # Handle the QUIETLY and REQUIRED arguments and set FCGI_FOUND to TRUE if all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FCGI DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(FCGI DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR)
# Copy the results to the output variables. # Copy the results to the output variables.
IF(FCGI_FOUND) if(FCGI_FOUND)
SET(FCGI_LIBRARIES ${FCGI_LIBRARY}) set(FCGI_LIBRARIES ${FCGI_LIBRARY})
SET(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR}) set(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR})
ELSE(FCGI_FOUND) else(FCGI_FOUND)
SET(FCGI_LIBRARIES) set(FCGI_LIBRARIES)
SET(FCGI_INCLUDE_DIRS) set(FCGI_INCLUDE_DIRS)
ENDIF(FCGI_FOUND) endif(FCGI_FOUND)
MARK_AS_ADVANCED(FCGI_INCLUDE_DIR FCGI_LIBRARY) mark_as_advanced(FCGI_INCLUDE_DIR FCGI_LIBRARY)

View File

@ -10,10 +10,10 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# #
FIND_PROGRAM(KDU_EXPAND_EXECUTABLE find_program(KDU_EXPAND_EXECUTABLE
kdu_expand kdu_expand
) )
MARK_AS_ADVANCED( mark_as_advanced(
KDU_EXPAND_EXECUTABLE KDU_EXPAND_EXECUTABLE
) )

View File

@ -12,20 +12,20 @@
#============================================================================= #=============================================================================
#============================================================================= #=============================================================================
FIND_PATH(LCMS_INCLUDE_DIR lcms.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include) find_path(LCMS_INCLUDE_DIR lcms.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
SET(LCMS_NAMES ${LCMS_NAMES} lcms liblcms liblcms_static) set(LCMS_NAMES ${LCMS_NAMES} lcms liblcms liblcms_static)
FIND_LIBRARY(LCMS_LIBRARY NAMES ${LCMS_NAMES} ) find_library(LCMS_LIBRARY NAMES ${LCMS_NAMES} )
MARK_AS_ADVANCED(LCMS_INCLUDE_DIR LCMS_LIBRARY) mark_as_advanced(LCMS_INCLUDE_DIR LCMS_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set LCMS_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set LCMS_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS DEFAULT_MSG LCMS_LIBRARY LCMS_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS DEFAULT_MSG LCMS_LIBRARY LCMS_INCLUDE_DIR)
IF(LCMS_FOUND) if(LCMS_FOUND)
SET( LCMS_INCLUDE_DIRS ${LCMS_INCLUDE_DIR}) set( LCMS_INCLUDE_DIRS ${LCMS_INCLUDE_DIR})
SET( LCMS_LIBRARIES ${LCMS_LIBRARY} ) set( LCMS_LIBRARIES ${LCMS_LIBRARY} )
ENDIF(LCMS_FOUND) endif(LCMS_FOUND)

View File

@ -12,20 +12,20 @@
#============================================================================= #=============================================================================
#============================================================================= #=============================================================================
FIND_PATH(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include) find_path(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
SET(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static) set(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static)
FIND_LIBRARY(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} ) find_library(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} )
MARK_AS_ADVANCED(LCMS2_INCLUDE_DIR LCMS2_LIBRARY) mark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR)
IF(LCMS2_FOUND) if(LCMS2_FOUND)
SET( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR}) set( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
SET( LCMS2_LIBRARIES ${LCMS2_LIBRARY} ) set( LCMS2_LIBRARIES ${LCMS2_LIBRARY} )
ENDIF(LCMS2_FOUND) endif(LCMS2_FOUND)

View File

@ -28,41 +28,41 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# Make this explicit here, rather than accepting the CPack default value, # Make this explicit here, rather than accepting the CPack default value,
# so we can refer to it: # so we can refer to it:
SET(CPACK_PACKAGE_NAME "${OPENJPEG_LIBRARY_NAME}") set(CPACK_PACKAGE_NAME "${OPENJPEG_LIBRARY_NAME}")
IF(NOT DEFINED CPACK_SYSTEM_NAME) if(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just # make sure package is not Cygwin-unknown, for Cygwin just
# cygwin is good for the system name # cygwin is good for the system name
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
SET(CPACK_SYSTEM_NAME Cygwin) set(CPACK_SYSTEM_NAME Cygwin)
ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME) endif(NOT DEFINED CPACK_SYSTEM_NAME)
IF(${CPACK_SYSTEM_NAME} MATCHES Windows) if(${CPACK_SYSTEM_NAME} MATCHES Windows)
IF(CMAKE_CL_64) if(CMAKE_CL_64)
SET(CPACK_SYSTEM_NAME win64-x64) set(CPACK_SYSTEM_NAME win64-x64)
ELSE(CMAKE_CL_64) else(CMAKE_CL_64)
SET(CPACK_SYSTEM_NAME win32-x86) set(CPACK_SYSTEM_NAME win32-x86)
ENDIF(CMAKE_CL_64) endif(CMAKE_CL_64)
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows) endif(${CPACK_SYSTEM_NAME} MATCHES Windows)
IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
# default to source package - system, on cygwin system is not # default to source package - system, on cygwin system is not
# needed # needed
IF(CYGWIN) if(CYGWIN)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
ELSE(CYGWIN) else(CYGWIN)
SET(CPACK_PACKAGE_FILE_NAME set(CPACK_PACKAGE_FILE_NAME
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}") "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
ENDIF(CYGWIN) endif(CYGWIN)
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist
${CMAKE_CURRENT_BINARY_DIR}/opj.plist) ${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
SET(CPACK_BUNDLE_PLIST set(CPACK_BUNDLE_PLIST
${CMAKE_CURRENT_BINARY_DIR}/opj.plist) ${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
#include(BundleUtilities) #include(BundleUtilities)

View File

@ -6,21 +6,21 @@
# module to load OPENJPEG's settings for an external project. # module to load OPENJPEG's settings for an external project.
@OPENJPEG_CONFIG_INSTALL_ONLY@ @OPENJPEG_CONFIG_INSTALL_ONLY@
# The OPENJPEG version number. # The OPENJPEG version number.
SET(OPENJPEG_MAJOR_VERSION "@OPENJPEG_VERSION_MAJOR@") set(OPENJPEG_MAJOR_VERSION "@OPENJPEG_VERSION_MAJOR@")
SET(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@") set(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@")
SET(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@") set(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@")
# The libraries. # The libraries.
SET(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARY_NAME@") set(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARY_NAME@")
# The CMake macros dir. # The CMake macros dir.
SET(OPENJPEG_CMAKE_DIR "@OPENJPEG_INSTALL_PACKAGE_DIR@") set(OPENJPEG_CMAKE_DIR "@OPENJPEG_INSTALL_PACKAGE_DIR@")
# The configuration options. # The configuration options.
SET(OPENJPEG_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@") set(OPENJPEG_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
# The "use" file. # The "use" file.
SET(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@") set(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@")
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
@ -32,7 +32,7 @@ if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
else(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) else(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake) if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
# This is a build tree # This is a build tree
SET( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@) set( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@)
include(${SELF_DIR}/OpenJPEGExports.cmake) include(${SELF_DIR}/OpenJPEGExports.cmake)
@ -44,5 +44,5 @@ endif(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake) set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake)
# Backward compatible part: # Backward compatible part:
SET(OPENJPEG_FOUND TRUE) set(OPENJPEG_FOUND TRUE)

View File

@ -16,51 +16,51 @@
# by Julien Malik # by Julien Malik
# #
MACRO(OPJ_TEST_LARGE_FILES VARIABLE) macro(OPJ_TEST_LARGE_FILES VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$") if("${VARIABLE}" MATCHES "^${VARIABLE}$")
# On most platforms it is probably overkill to first test the flags for 64-bit off_t, # On most platforms it is probably overkill to first test the flags for 64-bit off_t,
# and then separately fseeko. However, in the future we might have 128-bit filesystems # and then separately fseeko. However, in the future we might have 128-bit filesystems
# (ZFS), so it might be dangerous to indiscriminately set e.g. _FILE_OFFSET_BITS=64. # (ZFS), so it might be dangerous to indiscriminately set e.g. _FILE_OFFSET_BITS=64.
MESSAGE(STATUS "Checking for 64-bit off_t") message(STATUS "Checking for 64-bit off_t")
# First check without any special flags # First check without any special flags
TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}" try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c") "${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c")
if(FILE64_OK) if(FILE64_OK)
MESSAGE(STATUS "Checking for 64-bit off_t - present") message(STATUS "Checking for 64-bit off_t - present")
endif(FILE64_OK) endif(FILE64_OK)
if(NOT FILE64_OK) if(NOT FILE64_OK)
# Test with _FILE_OFFSET_BITS=64 # Test with _FILE_OFFSET_BITS=64
TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}" try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c" "${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c"
COMPILE_DEFINITIONS "-D_FILE_OFFSET_BITS=64" ) COMPILE_DEFINITIONS "-D_FILE_OFFSET_BITS=64" )
if(FILE64_OK) if(FILE64_OK)
MESSAGE(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64") message(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64")
set(_FILE_OFFSET_BITS 64) set(_FILE_OFFSET_BITS 64)
endif(FILE64_OK) endif(FILE64_OK)
endif(NOT FILE64_OK) endif(NOT FILE64_OK)
if(NOT FILE64_OK) if(NOT FILE64_OK)
# Test with _LARGE_FILES # Test with _LARGE_FILES
TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}" try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c" "${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c"
COMPILE_DEFINITIONS "-D_LARGE_FILES" ) COMPILE_DEFINITIONS "-D_LARGE_FILES" )
if(FILE64_OK) if(FILE64_OK)
MESSAGE(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES") message(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES")
set(_LARGE_FILES 1) set(_LARGE_FILES 1)
endif(FILE64_OK) endif(FILE64_OK)
endif(NOT FILE64_OK) endif(NOT FILE64_OK)
if(NOT FILE64_OK) if(NOT FILE64_OK)
# Test with _LARGEFILE_SOURCE # Test with _LARGEFILE_SOURCE
TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}" try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c" "${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c"
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" ) COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" )
if(FILE64_OK) if(FILE64_OK)
MESSAGE(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE") message(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE 1) set(_LARGEFILE_SOURCE 1)
endif(FILE64_OK) endif(FILE64_OK)
endif(NOT FILE64_OK) endif(NOT FILE64_OK)
@ -68,67 +68,67 @@ MACRO(OPJ_TEST_LARGE_FILES VARIABLE)
#if(NOT FILE64_OK) #if(NOT FILE64_OK)
# # now check for Windows stuff # # now check for Windows stuff
# TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}" # try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
# "${PROJECT_SOURCE_DIR}/CMake/TestWindowsFSeek.c") # "${PROJECT_SOURCE_DIR}/CMake/TestWindowsFSeek.c")
# if(FILE64_OK) # if(FILE64_OK)
# MESSAGE(STATUS "Checking for 64-bit off_t - present with _fseeki64") # message(STATUS "Checking for 64-bit off_t - present with _fseeki64")
# set(HAVE__FSEEKI64 1) # set(HAVE__FSEEKI64 1)
# endif(FILE64_OK) # endif(FILE64_OK)
#endif(NOT FILE64_OK) #endif(NOT FILE64_OK)
if(NOT FILE64_OK) if(NOT FILE64_OK)
MESSAGE(STATUS "Checking for 64-bit off_t - not present") message(STATUS "Checking for 64-bit off_t - not present")
endif(NOT FILE64_OK) endif(NOT FILE64_OK)
SET(_FILE_OFFSET_BITS ${_FILE_OFFSET_BITS} CACHE INTERNAL "Result of test for needed _FILE_OFFSET_BITS=64") set(_FILE_OFFSET_BITS ${_FILE_OFFSET_BITS} CACHE INTERNAL "Result of test for needed _FILE_OFFSET_BITS=64")
SET(_LARGE_FILES ${_LARGE_FILES} CACHE INTERNAL "Result of test for needed _LARGE_FILES") set(_LARGE_FILES ${_LARGE_FILES} CACHE INTERNAL "Result of test for needed _LARGE_FILES")
SET(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE") set(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE")
# Set the flags we might have determined to be required above # Set the flags we might have determined to be required above
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/CMake/TestLargeFiles.c.cmake.in" configure_file("${PROJECT_SOURCE_DIR}/CMake/TestLargeFiles.c.cmake.in"
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c") "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")
MESSAGE(STATUS "Checking for fseeko/ftello") message(STATUS "Checking for fseeko/ftello")
# Test if ftello/fseeko are available # Test if ftello/fseeko are available
TRY_COMPILE(FSEEKO_COMPILE_OK try_compile(FSEEKO_COMPILE_OK
"${PROJECT_BINARY_DIR}" "${PROJECT_BINARY_DIR}"
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c") "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")
IF(FSEEKO_COMPILE_OK) if(FSEEKO_COMPILE_OK)
MESSAGE(STATUS "Checking for fseeko/ftello - present") message(STATUS "Checking for fseeko/ftello - present")
ENDIF(FSEEKO_COMPILE_OK) endif(FSEEKO_COMPILE_OK)
IF(NOT FSEEKO_COMPILE_OK) if(NOT FSEEKO_COMPILE_OK)
# glibc 2.2 needs _LARGEFILE_SOURCE for fseeko (but not for 64-bit off_t...) # glibc 2.2 needs _LARGEFILE_SOURCE for fseeko (but not for 64-bit off_t...)
TRY_COMPILE(FSEEKO_COMPILE_OK try_compile(FSEEKO_COMPILE_OK
"${PROJECT_BINARY_DIR}" "${PROJECT_BINARY_DIR}"
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c" "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c"
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" ) COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" )
IF(FSEEKO_COMPILE_OK) if(FSEEKO_COMPILE_OK)
MESSAGE(STATUS "Checking for fseeko/ftello - present with _LARGEFILE_SOURCE") message(STATUS "Checking for fseeko/ftello - present with _LARGEFILE_SOURCE")
SET(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE") set(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE")
ENDIF(FSEEKO_COMPILE_OK) endif(FSEEKO_COMPILE_OK)
ENDIF(NOT FSEEKO_COMPILE_OK) endif(NOT FSEEKO_COMPILE_OK)
if(FSEEKO_COMPILE_OK) if(FSEEKO_COMPILE_OK)
SET(HAVE_FSEEKO ON CACHE INTERNAL "Result of test for fseeko/ftello") set(HAVE_FSEEKO ON CACHE INTERNAL "Result of test for fseeko/ftello")
else(FSEEKO_COMPILE_OK) else(FSEEKO_COMPILE_OK)
MESSAGE(STATUS "Checking for fseeko/ftello - not found") message(STATUS "Checking for fseeko/ftello - not found")
SET(HAVE_FSEEKO OFF CACHE INTERNAL "Result of test for fseeko/ftello") set(HAVE_FSEEKO OFF CACHE INTERNAL "Result of test for fseeko/ftello")
endif(FSEEKO_COMPILE_OK) endif(FSEEKO_COMPILE_OK)
if(FILE64_OK AND FSEEKO_COMPILE_OK) if(FILE64_OK AND FSEEKO_COMPILE_OK)
MESSAGE(STATUS "Large File support - found") message(STATUS "Large File support - found")
SET(${VARIABLE} ON CACHE INTERNAL "Result of test for large file support") set(${VARIABLE} ON CACHE INTERNAL "Result of test for large file support")
else(FILE64_OK AND FSEEKO_COMPILE_OK) else(FILE64_OK AND FSEEKO_COMPILE_OK)
MESSAGE(STATUS "Large File support - not found") message(STATUS "Large File support - not found")
SET(${VARIABLE} OFF CACHE INTERNAL "Result of test for large file support") set(${VARIABLE} OFF CACHE INTERNAL "Result of test for large file support")
endif(FILE64_OK AND FSEEKO_COMPILE_OK) endif(FILE64_OK AND FSEEKO_COMPILE_OK)
ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$") endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
ENDMACRO(OPJ_TEST_LARGE_FILES VARIABLE) endmacro(OPJ_TEST_LARGE_FILES VARIABLE)

View File

@ -6,54 +6,54 @@
# you will eventually like to prefix the library to avoid linking confusion # you will eventually like to prefix the library to avoid linking confusion
# For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like # For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like
# e.g.: # e.g.:
# SET(OPENJPEG_NAMESPACE "GDCMOPENJPEG") # set(OPENJPEG_NAMESPACE "GDCMOPENJPEG")
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
IF(COMMAND CMAKE_POLICY) if(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW) cmake_policy(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY) endif(COMMAND CMAKE_POLICY)
IF(NOT OPENJPEG_NAMESPACE) if(NOT OPENJPEG_NAMESPACE)
SET(OPENJPEG_NAMESPACE "OPENJPEG") set(OPENJPEG_NAMESPACE "OPENJPEG")
SET(OPENJPEG_STANDALONE 1) set(OPENJPEG_STANDALONE 1)
ENDIF(NOT OPENJPEG_NAMESPACE) endif(NOT OPENJPEG_NAMESPACE)
# In all cases: # In all cases:
STRING(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME) string(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME)
PROJECT(${OPENJPEG_NAMESPACE} C) project(${OPENJPEG_NAMESPACE} C)
# Do full dependency headers. # Do full dependency headers.
INCLUDE_REGULAR_EXPRESSION("^.*$") include_regular_expression("^.*$")
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# OPENJPEG version number, useful for packaging and doxygen doc: # OPENJPEG version number, useful for packaging and doxygen doc:
SET(OPENJPEG_VERSION_MAJOR 1) set(OPENJPEG_VERSION_MAJOR 1)
SET(OPENJPEG_VERSION_MINOR 99) set(OPENJPEG_VERSION_MINOR 99)
SET(OPENJPEG_VERSION_BUILD 0) set(OPENJPEG_VERSION_BUILD 0)
SET(OPENJPEG_VERSION set(OPENJPEG_VERSION
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}") "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
SET(PACKAGE_VERSION set(PACKAGE_VERSION
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}") "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
SET(OPENJPEG_LIBRARY_PROPERTIES set(OPENJPEG_LIBRARY_PROPERTIES
VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}" VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}"
SOVERSION "${OPENJPEG_VERSION_MAJOR}" SOVERSION "${OPENJPEG_VERSION_MAJOR}"
) )
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Path to additional CMake modules # Path to additional CMake modules
SET(CMAKE_MODULE_PATH set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMake ${CMAKE_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH}) ${CMAKE_MODULE_PATH})
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security # On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
# warnings # warnings
IF(WIN32) if(WIN32)
IF(NOT BORLAND) if(NOT BORLAND)
IF(NOT CYGWIN) if(NOT CYGWIN)
IF(NOT MINGW) if(NOT MINGW)
IF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS) if(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
ADD_DEFINITIONS( add_definitions(
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE -D_CRT_FAR_MAPPINGS_NO_DEPRECATE
-D_CRT_IS_WCTYPE_NO_DEPRECATE -D_CRT_IS_WCTYPE_NO_DEPRECATE
-D_CRT_MANAGED_FP_NO_DEPRECATE -D_CRT_MANAGED_FP_NO_DEPRECATE
@ -65,62 +65,62 @@ IF(WIN32)
-D_CRT_VCCLRIT_NO_DEPRECATE -D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE
) )
ENDIF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS) endif(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
ENDIF(NOT MINGW) endif(NOT MINGW)
ENDIF(NOT CYGWIN) endif(NOT CYGWIN)
ENDIF(NOT BORLAND) endif(NOT BORLAND)
ENDIF(WIN32) endif(WIN32)
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Install directories # Install directories
STRING(TOLOWER ${PROJECT_NAME} projectname) string(TOLOWER ${PROJECT_NAME} projectname)
SET(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}") set(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}")
IF(NOT OPENJPEG_INSTALL_BIN_DIR) if(NOT OPENJPEG_INSTALL_BIN_DIR)
SET(OPENJPEG_INSTALL_BIN_DIR "bin") set(OPENJPEG_INSTALL_BIN_DIR "bin")
ENDIF(NOT OPENJPEG_INSTALL_BIN_DIR) endif(NOT OPENJPEG_INSTALL_BIN_DIR)
IF(NOT OPENJPEG_INSTALL_LIB_DIR) if(NOT OPENJPEG_INSTALL_LIB_DIR)
SET(OPENJPEG_INSTALL_LIB_DIR "lib") set(OPENJPEG_INSTALL_LIB_DIR "lib")
ENDIF(NOT OPENJPEG_INSTALL_LIB_DIR) endif(NOT OPENJPEG_INSTALL_LIB_DIR)
IF(NOT OPENJPEG_INSTALL_SHARE_DIR) if(NOT OPENJPEG_INSTALL_SHARE_DIR)
SET(OPENJPEG_INSTALL_SHARE_DIR "share") set(OPENJPEG_INSTALL_SHARE_DIR "share")
ENDIF(NOT OPENJPEG_INSTALL_SHARE_DIR) endif(NOT OPENJPEG_INSTALL_SHARE_DIR)
IF(NOT OPENJPEG_INSTALL_DATA_DIR) if(NOT OPENJPEG_INSTALL_DATA_DIR)
SET(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}") set(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
ENDIF(NOT OPENJPEG_INSTALL_DATA_DIR) endif(NOT OPENJPEG_INSTALL_DATA_DIR)
IF(NOT OPENJPEG_INSTALL_INCLUDE_DIR) if(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
SET(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}") set(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}")
ENDIF(NOT OPENJPEG_INSTALL_INCLUDE_DIR) endif(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
IF(NOT OPENJPEG_INSTALL_MAN_DIR) if(NOT OPENJPEG_INSTALL_MAN_DIR)
SET(OPENJPEG_INSTALL_MAN_DIR "share/man/") set(OPENJPEG_INSTALL_MAN_DIR "share/man/")
ENDIF(NOT OPENJPEG_INSTALL_MAN_DIR) endif(NOT OPENJPEG_INSTALL_MAN_DIR)
IF(NOT OPENJPEG_INSTALL_DOC_DIR) if(NOT OPENJPEG_INSTALL_DOC_DIR)
SET(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}") set(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}")
ENDIF(NOT OPENJPEG_INSTALL_DOC_DIR) endif(NOT OPENJPEG_INSTALL_DOC_DIR)
IF(NOT OPENJPEG_INSTALL_PACKAGE_DIR) if(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
# We could install *.cmake files in share/ however those files contains # We could install *.cmake files in share/ however those files contains
# hardcoded path to libraries on a multi-arch system (fedora/debian) those # hardcoded path to libraries on a multi-arch system (fedora/debian) those
# path will be different (lib/i386-linux-gnu vs lib/x86_64-linux-gnu) # path will be different (lib/i386-linux-gnu vs lib/x86_64-linux-gnu)
SET(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}") set(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
ENDIF(NOT OPENJPEG_INSTALL_PACKAGE_DIR) endif(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Big endian test: # Big endian test:
INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN) TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Setup file for setting custom ctest vars # Setup file for setting custom ctest vars
CONFIGURE_FILE( configure_file(
${CMAKE_SOURCE_DIR}/CMake/CTestCustom.cmake.in ${CMAKE_SOURCE_DIR}/CMake/CTestCustom.cmake.in
${CMAKE_BINARY_DIR}/CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake
@ONLY @ONLY
@ -128,46 +128,46 @@ CONFIGURE_FILE(
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# OpenJPEG build configuration options. # OpenJPEG build configuration options.
OPTION(BUILD_SHARED_LIBS "Build OpenJPEG shared library and link executables against it." ON) option(BUILD_SHARED_LIBS "Build OpenJPEG shared library and link executables against it." ON)
SET (EXECUTABLE_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.") set (EXECUTABLE_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
SET (LIBRARY_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.") set (LIBRARY_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH) mark_as_advanced(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# configure name mangling to allow multiple libraries to coexist # configure name mangling to allow multiple libraries to coexist
# peacefully # peacefully
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
SET(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME}) set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in
${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h ${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h
@ONLY) @ONLY)
ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# pkgconfig support # pkgconfig support
IF(UNIX) if(UNIX)
# install in lib and not share (see multi-arch note above) # install in lib and not share (see multi-arch note above)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libopenjpeg1.pc.cmake configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libopenjpeg1.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc @ONLY) ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc @ONLY)
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc DESTINATION install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc DESTINATION
${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig ) ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
INSTALL( CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink install( CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
\"libopenjpeg1.pc\" \"libopenjpeg1.pc\"
\"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_SHARE_DIR}/pkgconfig/libopenjpeg.pc\")") \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_SHARE_DIR}/pkgconfig/libopenjpeg.pc\")")
ENDIF(UNIX) endif(UNIX)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Compiler specific flags: # Compiler specific flags:
IF(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC)
# For all builds, make sure openjpeg is std99 compliant: # For all builds, make sure openjpeg is std99 compliant:
# SET(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build. # set(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
# Do not use ffast-math for all build, it would produce incorrect results, only set for release: # Do not use ffast-math for all build, it would produce incorrect results, only set for release:
SET(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}")
ENDIF(CMAKE_COMPILER_IS_GNUCC) endif(CMAKE_COMPILER_IS_GNUCC)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# opj_config.h generation (1/2) # opj_config.h generation (1/2)
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
@ -179,96 +179,96 @@ CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
# Enable Large file support # Enable Large file support
INCLUDE(TestLargeFiles) include(TestLargeFiles)
OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES) OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Build Library # Build Library
INCLUDE_DIRECTORIES(BEFORE ${OPENJPEG_BINARY_DIR}) include_directories(BEFORE ${OPENJPEG_BINARY_DIR})
ADD_SUBDIRECTORY(libopenjpeg) add_subdirectory(libopenjpeg)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Build Applications # Build Applications
OPTION(BUILD_CODEC "Build the CODEC executables" ON) option(BUILD_CODEC "Build the CODEC executables" ON)
OPTION(BUILD_MJ2 "Build the MJ2 executables." OFF) option(BUILD_MJ2 "Build the MJ2 executables." OFF)
OPTION(BUILD_JPWL "Build the JPWL library and executables" OFF) option(BUILD_JPWL "Build the JPWL library and executables" OFF)
OPTION(BUILD_JPIP "Build the JPIP library and executables." OFF) option(BUILD_JPIP "Build the JPIP library and executables." OFF)
IF(BUILD_JPIP) if(BUILD_JPIP)
OPTION(BUILD_JPIP_SERVER "Build the JPIP server." OFF) option(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
ENDIF(BUILD_JPIP) endif(BUILD_JPIP)
OPTION(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF) option(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF)
OPTION(BUILD_JAVA "Build the openjpeg jar (Java)" OFF) option(BUILD_JAVA "Build the openjpeg jar (Java)" OFF)
MARK_AS_ADVANCED(BUILD_VIEWER) mark_as_advanced(BUILD_VIEWER)
MARK_AS_ADVANCED(BUILD_JAVA) mark_as_advanced(BUILD_JAVA)
IF(BUILD_CODEC OR BUILD_MJ2) if(BUILD_CODEC OR BUILD_MJ2)
# OFF: It will only build 3rd party libs if they are not found on the system # OFF: It will only build 3rd party libs if they are not found on the system
# ON: 3rd party libs will ALWAYS be build, and used # ON: 3rd party libs will ALWAYS be build, and used
OPTION(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF) option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
ADD_SUBDIRECTORY(thirdparty) add_subdirectory(thirdparty)
ADD_SUBDIRECTORY(applications) add_subdirectory(applications)
ENDIF (BUILD_CODEC OR BUILD_MJ2) endif (BUILD_CODEC OR BUILD_MJ2)
include(CheckTypeSize) include(CheckTypeSize)
CHECK_TYPE_SIZE(ssize_t SSIZE_T) CHECK_TYPE_SIZE(ssize_t SSIZE_T)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# opj_config.h generation (2/2) # opj_config.h generation (2/2)
CONFIGURE_FILE("${OPENJPEG_SOURCE_DIR}/opj_config.h.cmake.in" configure_file("${OPENJPEG_SOURCE_DIR}/opj_config.h.cmake.in"
"${OPENJPEG_BINARY_DIR}/opj_config.h" "${OPENJPEG_BINARY_DIR}/opj_config.h"
@ONLY @ONLY
) )
# #
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/opj_config.h install( FILES ${CMAKE_CURRENT_BINARY_DIR}/opj_config.h
DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers) DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found) # Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
OPTION(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF) option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
IF(BUILD_DOC) if(BUILD_DOC)
ADD_SUBDIRECTORY(doc) add_subdirectory(doc)
ENDIF(BUILD_DOC) endif(BUILD_DOC)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Buld Testing # Buld Testing
OPTION(BUILD_TESTING "Build the tests." OFF) option(BUILD_TESTING "Build the tests." OFF)
IF(BUILD_TESTING) if(BUILD_TESTING)
IF(BUILD_CODEC) if(BUILD_CODEC)
ENABLE_TESTING() enable_testing()
INCLUDE(CTest) include(CTest)
# Search openjpeg data needed for the tests # Search openjpeg data needed for the tests
# They could be found via svn on the OpenJPEG google code project # They could be found via svn on the OpenJPEG google code project
# svn checkout http://openjpeg.googlecode.com/svn/data (about 70 Mo) # svn checkout http://openjpeg.googlecode.com/svn/data (about 70 Mo)
FIND_PATH(OPJ_DATA_ROOT README-OPJ-Data find_path(OPJ_DATA_ROOT README-OPJ-Data
PATHS PATHS
$ENV{OPJ_DATA_ROOT} $ENV{OPJ_DATA_ROOT}
${CMAKE_SOURCE_DIR}/../data ${CMAKE_SOURCE_DIR}/../data
) )
# Add repository where to find tests # Add repository where to find tests
ADD_SUBDIRECTORY(tests) add_subdirectory(tests)
ELSE(BUILD_CODEC) else(BUILD_CODEC)
message(FATAL_ERROR "You need build codec to run the tests") message(FATAL_ERROR "You need build codec to run the tests")
ENDIF(BUILD_CODEC) endif(BUILD_CODEC)
ENDIF(BUILD_TESTING) endif(BUILD_TESTING)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# install all targets referenced as OPENJPEGTargets # install all targets referenced as OPENJPEGTargets
INSTALL(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR}) install(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR})
CONFIGURE_FILE( ${OPENJPEG_SOURCE_DIR}/CMake/OpenJPEGConfig.cmake.in configure_file( ${OPENJPEG_SOURCE_DIR}/CMake/OpenJPEGConfig.cmake.in
${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
@ONLY @ONLY
) )
INSTALL( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake install( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR} DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR}
) )
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# install CHANGES and LICENSE # install CHANGES and LICENSE
IF(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES) if(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
INSTALL(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR}) install(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
ENDIF(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES) endif(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
INSTALL(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR}) install(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
INCLUDE (CMake/OpenJPEGCPack.cmake) include (CMake/OpenJPEGCPack.cmake)

View File

@ -1,22 +1,22 @@
# Build the each application if it needed # Build the each application if it needed
IF(BUILD_CODEC) if(BUILD_CODEC)
ADD_SUBDIRECTORY(codec) add_subdirectory(codec)
ENDIF(BUILD_CODEC) endif(BUILD_CODEC)
IF(BUILD_MJ2) if(BUILD_MJ2)
ADD_SUBDIRECTORY(mj2) add_subdirectory(mj2)
ENDIF(BUILD_MJ2) endif(BUILD_MJ2)
# Client & Server: # Client & Server:
IF(BUILD_JPIP) if(BUILD_JPIP)
ADD_SUBDIRECTORY(jpip) add_subdirectory(jpip)
ENDIF(BUILD_JPIP) endif(BUILD_JPIP)
IF(BUILD_VIEWER) if(BUILD_VIEWER)
ADD_SUBDIRECTORY(OPJViewer) add_subdirectory(OPJViewer)
ENDIF(BUILD_VIEWER) endif(BUILD_VIEWER)
IF(BUILD_JAVA) if(BUILD_JAVA)
ADD_SUBDIRECTORY(JavaOpenJPEG) add_subdirectory(JavaOpenJPEG)
ENDIF(BUILD_JAVA) endif(BUILD_JAVA)

View File

@ -1,7 +1,7 @@
#JavaOpenJPEG/CMakeLists.txt #JavaOpenJPEG/CMakeLists.txt
# First thing define the common source: # First thing define the common source:
SET(openjpegjni_SRCS set(openjpegjni_SRCS
JavaOpenJPEGDecoder.c JavaOpenJPEGDecoder.c
JavaOpenJPEG.c JavaOpenJPEG.c
) )
@ -22,7 +22,7 @@ add_library(openjpegjni MODULE
) )
# build jar: # build jar:
FIND_PACKAGE(Java 1.5 REQUIRED) # javac, jar find_package(Java 1.5 REQUIRED) # javac, jar
# build dep list: # build dep list:
file(GLOB java_srcs "java-sources/org/openJpeg/*.java") file(GLOB java_srcs "java-sources/org/openJpeg/*.java")
@ -30,7 +30,7 @@ file(GLOB java_srcs "java-sources/org/openJpeg/*.java")
# make sure target javac dir exists: # make sure target javac dir exists:
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes)
# Build java # Build java
ADD_CUSTOM_COMMAND( add_custom_command(
OUTPUT ${LIBRARY_OUTPUT_PATH}/openjpeg.jar OUTPUT ${LIBRARY_OUTPUT_PATH}/openjpeg.jar
COMMAND ${Java_JAVAC_EXECUTABLE} -sourcepath "${CMAKE_CURRENT_SOURCE_DIR}/java-sources" COMMAND ${Java_JAVAC_EXECUTABLE} -sourcepath "${CMAKE_CURRENT_SOURCE_DIR}/java-sources"
${java_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes ${java_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes
@ -41,7 +41,7 @@ ADD_CUSTOM_COMMAND(
) )
# name the target # name the target
ADD_CUSTOM_TARGET(OpenJPEGJavaJar ALL add_custom_target(OpenJPEGJavaJar ALL
DEPENDS ${LIBRARY_OUTPUT_PATH}/openjpeg.jar DEPENDS ${LIBRARY_OUTPUT_PATH}/openjpeg.jar
COMMENT "building openjpeg.jar" COMMENT "building openjpeg.jar"
) )

View File

@ -1,17 +1,17 @@
PROJECT(viewer CXX) project(viewer CXX)
FIND_PACKAGE(wxWidgets REQUIRED) find_package(wxWidgets REQUIRED)
INCLUDE(${wxWidgets_USE_FILE}) include(${wxWidgets_USE_FILE})
INCLUDE_DIRECTORIES( include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../.. ${CMAKE_CURRENT_SOURCE_DIR}/../..
${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/..
) )
# original flags: # original flags:
# -DUSE_JPWL -DwxUSE_LIBOPENJPEG -DwxUSE_GUI=1 -DOPJ_STATIC -DOPJ_HTMLABOUT -DOPJ_INICONFIG -DUSE_JPSEC -DOPJ_MANYFORMATS # -DUSE_JPWL -DwxUSE_LIBOPENJPEG -DwxUSE_GUI=1 -DOPJ_STATIC -DOPJ_HTMLABOUT -DOPJ_INICONFIG -DUSE_JPSEC -DOPJ_MANYFORMATS
ADD_DEFINITIONS(-DwxUSE_LIBOPENJPEG -DOPENJPEG_VERSION="1.5.0") add_definitions(-DwxUSE_LIBOPENJPEG -DOPENJPEG_VERSION="1.5.0")
SET(OPJV_SRCS set(OPJV_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/source/imagjpeg2000.cpp ${CMAKE_CURRENT_SOURCE_DIR}/source/imagjpeg2000.cpp
${CMAKE_CURRENT_SOURCE_DIR}/source/wxj2kparser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/source/wxj2kparser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/source/OPJViewer.cpp ${CMAKE_CURRENT_SOURCE_DIR}/source/OPJViewer.cpp
@ -21,5 +21,5 @@ SET(OPJV_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/source/OPJAbout.cpp ${CMAKE_CURRENT_SOURCE_DIR}/source/OPJAbout.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../codec/index.c ${CMAKE_CURRENT_SOURCE_DIR}/../codec/index.c
) )
ADD_EXECUTABLE(opjviewer ${OPJV_SRCS}) add_executable(opjviewer ${OPJV_SRCS})
TARGET_LINK_LIBRARIES(opjviewer ${wxWidgets_LIBRARIES} openjpeg) target_link_libraries(opjviewer ${wxWidgets_LIBRARIES} openjpeg)

View File

@ -1,7 +1,7 @@
# Build the demo app, small examples # Build the demo app, small examples
# First thing define the common source: # First thing define the common source:
SET(common_SRCS set(common_SRCS
convert.c convert.c
index.c index.c
${OPENJPEG_SOURCE_DIR}/applications/common/color.c ${OPENJPEG_SOURCE_DIR}/applications/common/color.c
@ -9,7 +9,7 @@ SET(common_SRCS
) )
# Headers file are located here: # Headers file are located here:
INCLUDE_DIRECTORIES( include_directories(
${OPENJPEG_SOURCE_DIR}/libopenjpeg ${OPENJPEG_SOURCE_DIR}/libopenjpeg
${LCMS_INCLUDE_DIRNAME} ${LCMS_INCLUDE_DIRNAME}
${OPENJPEG_SOURCE_DIR}/applications/common ${OPENJPEG_SOURCE_DIR}/applications/common
@ -18,96 +18,96 @@ INCLUDE_DIRECTORIES(
${TIFF_INCLUDE_DIRNAME} ${TIFF_INCLUDE_DIRNAME}
) )
IF(WIN32) if(WIN32)
IF(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS) add_definitions(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS) else(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS) endif(BUILD_SHARED_LIBS)
ENDIF(WIN32) endif(WIN32)
# Loop over all executables: # Loop over all executables:
FOREACH(exe j2k_to_image image_to_j2k j2k_dump) foreach(exe j2k_to_image image_to_j2k j2k_dump)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS}) add_executable(${exe} ${exe}.c ${common_SRCS})
TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG_LIBRARY_NAME} target_link_libraries(${exe} ${OPENJPEG_LIBRARY_NAME}
${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
) )
# To support universal exe: # To support universal exe:
IF(ZLIB_FOUND AND APPLE) if(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(${exe} z) target_link_libraries(${exe} z)
ELSe(ZLIB_FOUND AND APPLE) ELSe(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(${exe} ${Z_LIBNAME}) target_link_libraries(${exe} ${Z_LIBNAME})
ENDIF(ZLIB_FOUND AND APPLE) endif(ZLIB_FOUND AND APPLE)
# On unix you need to link to the math library: # On unix you need to link to the math library:
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(${exe} m) target_link_libraries(${exe} m)
ENDIF(UNIX) endif(UNIX)
# Install exe # Install exe
INSTALL(TARGETS ${exe} install(TARGETS ${exe}
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )
ENDFOREACH(exe) endforeach(exe)
# Install man pages # Install man pages
INSTALL( install(
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/image_to_j2k.1 FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/image_to_j2k.1
${OPENJPEG_SOURCE_DIR}/doc/man/man1/j2k_dump.1 ${OPENJPEG_SOURCE_DIR}/doc/man/man1/j2k_dump.1
${OPENJPEG_SOURCE_DIR}/doc/man/man1/j2k_to_image.1 ${OPENJPEG_SOURCE_DIR}/doc/man/man1/j2k_to_image.1
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1) DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)
# #
IF(BUILD_JPWL) if(BUILD_JPWL)
ADD_EXECUTABLE(JPWL_j2k_to_image add_executable(JPWL_j2k_to_image
j2k_to_image.c j2k_to_image.c
${common_SRCS} ${common_SRCS}
) )
SET_PROPERTY( set_property(
TARGET JPWL_j2k_to_image TARGET JPWL_j2k_to_image
APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
) )
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${OPENJPEG_LIBRARY_NAME}_JPWL target_link_libraries(JPWL_j2k_to_image ${OPENJPEG_LIBRARY_NAME}_JPWL
${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME}) ${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
# To support universal exe: # To support universal exe:
IF(ZLIB_FOUND AND APPLE) if(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image z) target_link_libraries(JPWL_j2k_to_image z)
ELSe(ZLIB_FOUND AND APPLE) ELSe(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${Z_LIBNAME}) target_link_libraries(JPWL_j2k_to_image ${Z_LIBNAME})
ENDIF(ZLIB_FOUND AND APPLE) endif(ZLIB_FOUND AND APPLE)
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image m) target_link_libraries(JPWL_j2k_to_image m)
ENDIF(UNIX) endif(UNIX)
ADD_EXECUTABLE(JPWL_image_to_j2k add_executable(JPWL_image_to_j2k
image_to_j2k.c image_to_j2k.c
${common_SRCS} ${common_SRCS}
) )
SET_PROPERTY( set_property(
TARGET JPWL_image_to_j2k TARGET JPWL_image_to_j2k
APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
) )
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${OPENJPEG_LIBRARY_NAME}_JPWL target_link_libraries(JPWL_image_to_j2k ${OPENJPEG_LIBRARY_NAME}_JPWL
${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME}) ${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
# To support universal exe: # To support universal exe:
IF(ZLIB_FOUND AND APPLE) if(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k z) target_link_libraries(JPWL_image_to_j2k z)
ELSe(ZLIB_FOUND AND APPLE) ELSe(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${Z_LIBNAME}) target_link_libraries(JPWL_image_to_j2k ${Z_LIBNAME})
ENDIF(ZLIB_FOUND AND APPLE) endif(ZLIB_FOUND AND APPLE)
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k m) target_link_libraries(JPWL_image_to_j2k m)
ENDIF(UNIX) endif(UNIX)
INSTALL(TARGETS JPWL_image_to_j2k JPWL_j2k_to_image install(TARGETS JPWL_image_to_j2k JPWL_j2k_to_image
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )
ENDIF(BUILD_JPWL) endif(BUILD_JPWL)

View File

@ -1,16 +1,16 @@
# required dep for server: # required dep for server:
IF(BUILD_JPIP_SERVER) if(BUILD_JPIP_SERVER)
FIND_PACKAGE(CURL REQUIRED) find_package(CURL REQUIRED)
FIND_PACKAGE(FCGI REQUIRED) find_package(FCGI REQUIRED)
FIND_PACKAGE(Threads REQUIRED) find_package(Threads REQUIRED)
IF(NOT CMAKE_USE_PTHREADS_INIT) if(NOT CMAKE_USE_PTHREADS_INIT)
MESSAGE(FATAL_ERROR "Only pthread are supported") message(FATAL_ERROR "Only pthread are supported")
ENDIF(NOT CMAKE_USE_PTHREADS_INIT) endif(NOT CMAKE_USE_PTHREADS_INIT)
ENDIF(BUILD_JPIP_SERVER) endif(BUILD_JPIP_SERVER)
# JPIP library: # JPIP library:
ADD_SUBDIRECTORY(libopenjpip) add_subdirectory(libopenjpip)
# JPIP binaries: # JPIP binaries:
ADD_SUBDIRECTORY(util) add_subdirectory(util)

View File

@ -1,13 +1,13 @@
INCLUDE_REGULAR_EXPRESSION("^.*$") include_regular_expression("^.*$")
INCLUDE_DIRECTORIES( include_directories(
${OPENJPEG_SOURCE_DIR}/libopenjpeg ${OPENJPEG_SOURCE_DIR}/libopenjpeg
${FCGI_INCLUDE_DIRS} ${FCGI_INCLUDE_DIRS}
${CURL_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS}
) )
# Defines the source code for the library # Defines the source code for the library
SET(OPENJPIP_SRCS set(OPENJPIP_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/boxheader_manager.c ${CMAKE_CURRENT_SOURCE_DIR}/boxheader_manager.c
${CMAKE_CURRENT_SOURCE_DIR}/codestream_manager.c ${CMAKE_CURRENT_SOURCE_DIR}/codestream_manager.c
${CMAKE_CURRENT_SOURCE_DIR}/imgreg_manager.c ${CMAKE_CURRENT_SOURCE_DIR}/imgreg_manager.c
@ -34,11 +34,11 @@ SET(OPENJPIP_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/sock_manager.c ${CMAKE_CURRENT_SOURCE_DIR}/sock_manager.c
) )
SET(SERVER_SRCS set(SERVER_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/auxtrans_manager.c ${CMAKE_CURRENT_SOURCE_DIR}/auxtrans_manager.c
) )
SET(LOCAL_SRCS set(LOCAL_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/jp2k_decoder.c ${CMAKE_CURRENT_SOURCE_DIR}/jp2k_decoder.c
${CMAKE_CURRENT_SOURCE_DIR}/imgsock_manager.c ${CMAKE_CURRENT_SOURCE_DIR}/imgsock_manager.c
${CMAKE_CURRENT_SOURCE_DIR}/jpipstream_manager.c ${CMAKE_CURRENT_SOURCE_DIR}/jpipstream_manager.c
@ -47,26 +47,26 @@ SET(LOCAL_SRCS
) )
# Build the library # Build the library
ADD_LIBRARY(openjpip_local STATIC ${OPENJPIP_SRCS} ${LOCAL_SRCS}) add_library(openjpip_local STATIC ${OPENJPIP_SRCS} ${LOCAL_SRCS})
TARGET_LINK_LIBRARIES(openjpip_local ${OPENJPEG_LIBRARY_NAME}) target_link_libraries(openjpip_local ${OPENJPEG_LIBRARY_NAME})
IF(WIN32) if(WIN32)
# add Winsock on windows+mingw # add Winsock on windows+mingw
TARGET_LINK_LIBRARIES(openjpip_local ws2_32) target_link_libraries(openjpip_local ws2_32)
ENDIF(WIN32) endif(WIN32)
# Install library # Install library
INSTALL(TARGETS openjpip_local install(TARGETS openjpip_local
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
) )
IF(BUILD_JPIP_SERVER) if(BUILD_JPIP_SERVER)
ADD_LIBRARY(openjpip_server STATIC ${OPENJPIP_SRCS} ${SERVER_SRCS}) add_library(openjpip_server STATIC ${OPENJPIP_SRCS} ${SERVER_SRCS})
TARGET_LINK_LIBRARIES(openjpip_server ${FCGI_LIBRARIES} ${CURL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(openjpip_server ${FCGI_LIBRARIES} ${CURL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
SET_TARGET_PROPERTIES(openjpip_server set_target_properties(openjpip_server
PROPERTIES COMPILE_FLAGS "-DSERVER") PROPERTIES COMPILE_FLAGS "-DSERVER")
INSTALL(TARGETS openjpip_server install(TARGETS openjpip_server
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
) )
ENDIF(BUILD_JPIP_SERVER) endif(BUILD_JPIP_SERVER)

View File

@ -1,62 +1,62 @@
# Headers file are located here: # Headers file are located here:
INCLUDE_DIRECTORIES( include_directories(
${OPENJPEG_SOURCE_DIR}/libopenjpeg # opj_stdint.h ${OPENJPEG_SOURCE_DIR}/libopenjpeg # opj_stdint.h
${OPENJPEG_SOURCE_DIR}/applications/jpip/libopenjpip ${OPENJPEG_SOURCE_DIR}/applications/jpip/libopenjpip
${FCGI_INCLUDE_DIRS} ${FCGI_INCLUDE_DIRS}
) )
# Tool to embed metadata into JP2 file # Tool to embed metadata into JP2 file
ADD_EXECUTABLE(addXMLinJP2 addXMLinJP2.c) add_executable(addXMLinJP2 addXMLinJP2.c)
# Install exe # Install exe
INSTALL(TARGETS addXMLinJP2 install(TARGETS addXMLinJP2
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )
IF(BUILD_JPIP_SERVER) if(BUILD_JPIP_SERVER)
SET(OPJ_SERVER_SRCS set(OPJ_SERVER_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/opj_server.c ${CMAKE_CURRENT_SOURCE_DIR}/opj_server.c
) )
# Build executable # Build executable
ADD_EXECUTABLE(opj_server ${OPJ_SERVER_SRCS}) add_executable(opj_server ${OPJ_SERVER_SRCS})
TARGET_LINK_LIBRARIES(opj_server openjpip_server) target_link_libraries(opj_server openjpip_server)
SET_PROPERTY( set_property(
TARGET opj_server TARGET opj_server
APPEND PROPERTY APPEND PROPERTY
COMPILE_DEFINITIONS SERVER QUIT_SIGNAL="quitJPIP" COMPILE_DEFINITIONS SERVER QUIT_SIGNAL="quitJPIP"
) )
# On unix you need to link to the math library: # On unix you need to link to the math library:
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(opj_server m) target_link_libraries(opj_server m)
ENDIF(UNIX) endif(UNIX)
# Install exe # Install exe
INSTALL(TARGETS opj_server install(TARGETS opj_server
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )
ENDIF(BUILD_JPIP_SERVER) endif(BUILD_JPIP_SERVER)
SET(EXES set(EXES
opj_dec_server opj_dec_server
jpip_to_jp2 jpip_to_jp2
jpip_to_j2k jpip_to_j2k
test_index test_index
) )
FOREACH(exe ${EXES}) foreach(exe ${EXES})
ADD_EXECUTABLE(${exe} ${exe}.c) add_executable(${exe} ${exe}.c)
TARGET_LINK_LIBRARIES(${exe} openjpip_local) target_link_libraries(${exe} openjpip_local)
INSTALL(TARGETS ${exe} install(TARGETS ${exe}
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )
ENDFOREACH(exe) endforeach(exe)
# Build the two java clients: # Build the two java clients:
FIND_PACKAGE(Java 1.5 COMPONENTS Development) # javac, jar find_package(Java 1.5 COMPONENTS Development) # javac, jar
# Only build the java viewer if dev is found: # Only build the java viewer if dev is found:
if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE) if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
@ -68,7 +68,7 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
# make sure target javac dir exists: # make sure target javac dir exists:
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes1) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes1)
# Build java # Build java
ADD_CUSTOM_COMMAND( add_custom_command(
OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar
COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags} COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags}
${java1_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes1 ${java1_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes1
@ -81,12 +81,12 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
) )
# name the target # name the target
ADD_CUSTOM_TARGET(OPJViewerJar ALL add_custom_target(OPJViewerJar ALL
DEPENDS ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar DEPENDS ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar
COMMENT "building opj_viewer.jar" COMMENT "building opj_viewer.jar"
) )
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar install(FILES ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar
DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
) )
@ -122,7 +122,7 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
# make sure target javac dir exists: # make sure target javac dir exists:
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes2) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes2)
# Build java # Build java
ADD_CUSTOM_COMMAND( add_custom_command(
OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags} COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags}
-classpath ${APACHE_XERCES_JAR} -classpath ${APACHE_XERCES_JAR}
@ -136,12 +136,12 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
) )
# name the target # name the target
ADD_CUSTOM_TARGET(OPJViewerXercesJar ALL add_custom_target(OPJViewerXercesJar ALL
DEPENDS ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar DEPENDS ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
COMMENT "building opj_viewer_xerces.jar" COMMENT "building opj_viewer_xerces.jar"
) )
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar install(FILES ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
) )
endif() endif()

View File

@ -1,9 +1,9 @@
# Makefile for the MJ2 codecs of the OpenJPEG library: frames_to_mj2, mj2_to_frames, extract_j2k_from_mj2 and wrap_j2k_in_mj2 # Makefile for the MJ2 codecs of the OpenJPEG library: frames_to_mj2, mj2_to_frames, extract_j2k_from_mj2 and wrap_j2k_in_mj2
SET(common_SRCS ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c) set(common_SRCS ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c)
# While mj2 executables do not use the API correctly, we do not link with the library but rather compile the sources files. # While mj2 executables do not use the API correctly, we do not link with the library but rather compile the sources files.
SET(OPJ_SRCS set(OPJ_SRCS
${OPENJPEG_SOURCE_DIR}/libopenjpeg/bio.c ${OPENJPEG_SOURCE_DIR}/libopenjpeg/bio.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/cio.c ${OPENJPEG_SOURCE_DIR}/libopenjpeg/cio.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/dwt.c ${OPENJPEG_SOURCE_DIR}/libopenjpeg/dwt.c
@ -30,65 +30,65 @@ ${OPENJPEG_SOURCE_DIR}/libopenjpeg/tpix_manager.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/function_list.c ${OPENJPEG_SOURCE_DIR}/libopenjpeg/function_list.c
) )
SET(MJ2_SRCS mj2.c mj2_convert.c) set(MJ2_SRCS mj2.c mj2_convert.c)
IF(WIN32) if(WIN32)
ADD_DEFINITIONS(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
ENDIF(WIN32) endif(WIN32)
# Headers file are located here: # Headers file are located here:
INCLUDE_DIRECTORIES( include_directories(
${OPENJPEG_SOURCE_DIR}/libopenjpeg ${OPENJPEG_SOURCE_DIR}/libopenjpeg
${OPENJPEG_SOURCE_DIR}/applications/common ${OPENJPEG_SOURCE_DIR}/applications/common
${LCMS_INCLUDE_DIRNAME} ${LCMS_INCLUDE_DIRNAME}
) )
ADD_EXECUTABLE(frames_to_mj2 add_executable(frames_to_mj2
frames_to_mj2.c frames_to_mj2.c
${common_SRCS} ${common_SRCS}
${OPJ_SRCS} ${OPJ_SRCS}
${MJ2_SRCS} ${MJ2_SRCS}
) )
TARGET_LINK_LIBRARIES(frames_to_mj2 ${LCMS_LIBNAME}) target_link_libraries(frames_to_mj2 ${LCMS_LIBNAME})
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(frames_to_mj2 m) target_link_libraries(frames_to_mj2 m)
ENDIF(UNIX) endif(UNIX)
ADD_EXECUTABLE(mj2_to_frames add_executable(mj2_to_frames
mj2_to_frames.c mj2_to_frames.c
${common_SRCS} ${common_SRCS}
${OPJ_SRCS} ${OPJ_SRCS}
${MJ2_SRCS} ${MJ2_SRCS}
${OPENJPEG_SOURCE_DIR}/applications/common/color.c ${OPENJPEG_SOURCE_DIR}/applications/common/color.c
) )
TARGET_LINK_LIBRARIES(mj2_to_frames ${LCMS_LIBNAME}) target_link_libraries(mj2_to_frames ${LCMS_LIBNAME})
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(mj2_to_frames m) target_link_libraries(mj2_to_frames m)
ENDIF(UNIX) endif(UNIX)
ADD_EXECUTABLE(extract_j2k_from_mj2 add_executable(extract_j2k_from_mj2
extract_j2k_from_mj2.c extract_j2k_from_mj2.c
${OPJ_SRCS} ${OPJ_SRCS}
${MJ2_SRCS} ${MJ2_SRCS}
) )
TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 ${LCMS_LIBNAME}) target_link_libraries(extract_j2k_from_mj2 ${LCMS_LIBNAME})
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 m) target_link_libraries(extract_j2k_from_mj2 m)
ENDIF(UNIX) endif(UNIX)
ADD_EXECUTABLE(wrap_j2k_in_mj2 add_executable(wrap_j2k_in_mj2
wrap_j2k_in_mj2.c wrap_j2k_in_mj2.c
${OPJ_SRCS} ${OPJ_SRCS}
${MJ2_SRCS} ${MJ2_SRCS}
) )
TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 ${LCMS_LIBNAME}) target_link_libraries(wrap_j2k_in_mj2 ${LCMS_LIBNAME})
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 m) target_link_libraries(wrap_j2k_in_mj2 m)
ENDIF(UNIX) endif(UNIX)
INSTALL(TARGETS frames_to_mj2 mj2_to_frames extract_j2k_from_mj2 wrap_j2k_in_mj2 install(TARGETS frames_to_mj2 mj2_to_frames extract_j2k_from_mj2 wrap_j2k_in_mj2
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR}) DESTINATION ${OPENJPEG_INSTALL_BIN_DIR})

View File

@ -3,24 +3,24 @@
# to generate the html documentation in the doc/html repository of the build folder. # to generate the html documentation in the doc/html repository of the build folder.
# Try to find the doxygen tool # Try to find the doxygen tool
FIND_PACKAGE(Doxygen) find_package(Doxygen)
IF(DOXYGEN_FOUND) if(DOXYGEN_FOUND)
# Configure the doxygen config file with variable from CMake and move it # Configure the doxygen config file with variable from CMake and move it
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.dox.cmake.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.dox.cmake.in
${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox @ONLY) ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox @ONLY)
# Configure the html mainpage file of the doxygen documentation with variable # Configure the html mainpage file of the doxygen documentation with variable
# from CMake and move it # from CMake and move it
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mainpage.dox.cmake configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mainpage.dox.cmake
${CMAKE_BINARY_DIR}/doc/mainpage.dox @ONLY) ${CMAKE_BINARY_DIR}/doc/mainpage.dox @ONLY)
# Generate new target to build the html documentation # Generate new target to build the html documentation
ADD_CUSTOM_TARGET(doc ALL add_custom_target(doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox) ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox)
ELSE(DOXYGEN_FOUND) else(DOXYGEN_FOUND)
MESSAGE(STATUS "Doxygen not found, we cannot generate the documentation") message(STATUS "Doxygen not found, we cannot generate the documentation")
ENDIF(DOXYGEN_FOUND) endif(DOXYGEN_FOUND)

View File

@ -1,6 +1,6 @@
INCLUDE_REGULAR_EXPRESSION("^.*$") include_regular_expression("^.*$")
# Defines the source code for the library # Defines the source code for the library
SET(OPENJPEG_SRCS set(OPENJPEG_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/bio.c ${CMAKE_CURRENT_SOURCE_DIR}/bio.c
${CMAKE_CURRENT_SOURCE_DIR}/cio.c ${CMAKE_CURRENT_SOURCE_DIR}/cio.c
${CMAKE_CURRENT_SOURCE_DIR}/dwt.c ${CMAKE_CURRENT_SOURCE_DIR}/dwt.c
@ -28,26 +28,26 @@ SET(OPENJPEG_SRCS
) )
# Build the library # Build the library
IF(WIN32) if(WIN32)
IF(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS) add_definitions(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS) else(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS) endif(BUILD_SHARED_LIBS)
ENDIF(WIN32) endif(WIN32)
ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS}) add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME} m) target_link_libraries(${OPENJPEG_LIBRARY_NAME} m)
ENDIF(UNIX) endif(UNIX)
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES}) set_target_properties(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
# Build the JPWL library ? # Build the JPWL library ?
IF(BUILD_JPWL) if(BUILD_JPWL)
ADD_SUBDIRECTORY(jpwl) add_subdirectory(jpwl)
ENDIF(BUILD_JPWL) endif(BUILD_JPWL)
# Install library # Install library
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME} install(TARGETS ${OPENJPEG_LIBRARY_NAME}
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
@ -55,12 +55,12 @@ INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}
) )
# Install includes files # Install includes files
INSTALL(FILES openjpeg.h opj_stdint.h install(FILES openjpeg.h opj_stdint.h
DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers
) )
# install man page of the library # install man page of the library
INSTALL( install(
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man3/libopenjpeg.3 FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man3/libopenjpeg.3
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3) DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3)

View File

@ -1,33 +1,33 @@
# Makefile for the main JPWL OpenJPEG codecs: JPWL_ j2k_to_image and JPWL_image_to_j2k # Makefile for the main JPWL OpenJPEG codecs: JPWL_ j2k_to_image and JPWL_image_to_j2k
ADD_DEFINITIONS(-DUSE_JPWL) add_definitions(-DUSE_JPWL)
SET(JPWL_SRCS crc.c jpwl.c jpwl_lib.c rs.c) set(JPWL_SRCS crc.c jpwl.c jpwl_lib.c rs.c)
IF(APPLE) if(APPLE)
SET_SOURCE_FILES_PROPERTIES( set_source_files_properties(
rs.c rs.c
PROPERTIES PROPERTIES
COMPILE_FLAGS -fno-common) COMPILE_FLAGS -fno-common)
ENDIF(APPLE) endif(APPLE)
INCLUDE_DIRECTORIES( include_directories(
${OPENJPEG_SOURCE_DIR}/libopenjpeg ${OPENJPEG_SOURCE_DIR}/libopenjpeg
) )
# Build the library # Build the library
IF(WIN32) if(WIN32)
IF(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS) add_definitions(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS) else(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS) endif(BUILD_SHARED_LIBS)
ENDIF(WIN32) endif(WIN32)
ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME}_JPWL ${JPWL_SRCS} ${OPENJPEG_SRCS}) add_library(${OPENJPEG_LIBRARY_NAME}_JPWL ${JPWL_SRCS} ${OPENJPEG_SRCS})
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME}_JPWL set_target_properties(${OPENJPEG_LIBRARY_NAME}_JPWL
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES}) PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
# Install library # Install library
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}_JPWL install(TARGETS ${OPENJPEG_LIBRARY_NAME}_JPWL
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries

View File

@ -1,5 +1,5 @@
# Tests # Tests
INCLUDE_DIRECTORIES( include_directories(
${OPENJPEG_SOURCE_DIR}/libopenjpeg ${OPENJPEG_SOURCE_DIR}/libopenjpeg
${OPENJPEG_SOURCE_DIR}/applications/codec ${OPENJPEG_SOURCE_DIR}/applications/codec
${OPENJPEG_SOURCE_DIR}/applications/common ${OPENJPEG_SOURCE_DIR}/applications/common
@ -9,72 +9,72 @@ INCLUDE_DIRECTORIES(
) )
# First thing define the common source: # First thing define the common source:
SET(comparePGXimages_SRCS comparePGXimages.c set(comparePGXimages_SRCS comparePGXimages.c
${OPENJPEG_SOURCE_DIR}/applications/codec/convert.c ${OPENJPEG_SOURCE_DIR}/applications/codec/convert.c
${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
) )
SET(compare_dump_files_SRCS compare_dump_files.c set(compare_dump_files_SRCS compare_dump_files.c
${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c) ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c)
SET(compareRAWimages_SRCS compareRAWimages.c set(compareRAWimages_SRCS compareRAWimages.c
${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c) ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c)
ADD_EXECUTABLE(comparePGXimages ${comparePGXimages_SRCS}) add_executable(comparePGXimages ${comparePGXimages_SRCS})
TARGET_LINK_LIBRARIES(comparePGXimages target_link_libraries(comparePGXimages
${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_LIBRARY_NAME}
${PNG_LIBNAME} ${TIFF_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME}
) )
# To support universal exe: # To support universal exe:
IF(ZLIB_FOUND AND APPLE) if(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(comparePGXimages z) target_link_libraries(comparePGXimages z)
ELSe(ZLIB_FOUND AND APPLE) ELSe(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(comparePGXimages ${Z_LIBNAME}) target_link_libraries(comparePGXimages ${Z_LIBNAME})
ENDIF(ZLIB_FOUND AND APPLE) endif(ZLIB_FOUND AND APPLE)
ADD_EXECUTABLE(compare_dump_files ${compare_dump_files_SRCS}) add_executable(compare_dump_files ${compare_dump_files_SRCS})
ADD_EXECUTABLE(j2k_random_tile_access j2k_random_tile_access.c) add_executable(j2k_random_tile_access j2k_random_tile_access.c)
TARGET_LINK_LIBRARIES(j2k_random_tile_access ${OPENJPEG_LIBRARY_NAME}) target_link_libraries(j2k_random_tile_access ${OPENJPEG_LIBRARY_NAME})
ADD_EXECUTABLE(compareRAWimages ${compareRAWimages_SRCS}) add_executable(compareRAWimages ${compareRAWimages_SRCS})
ADD_EXECUTABLE(test_tile_encoder test_tile_encoder.c) add_executable(test_tile_encoder test_tile_encoder.c)
TARGET_LINK_LIBRARIES(test_tile_encoder ${OPENJPEG_LIBRARY_NAME}) target_link_libraries(test_tile_encoder ${OPENJPEG_LIBRARY_NAME})
# Let's try a couple of possibilities: # Let's try a couple of possibilities:
ADD_TEST(tte0 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder) add_test(tte0 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder)
ADD_TEST(tte1 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 3 2048 2048 1024 1024 8 1 tte1.j2k) add_test(tte1 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 3 2048 2048 1024 1024 8 1 tte1.j2k)
ADD_TEST(tte2 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 3 2048 2048 1024 1024 8 1 tte2.jp2) add_test(tte2 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 3 2048 2048 1024 1024 8 1 tte2.jp2)
ADD_TEST(tte3 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 2048 2048 1024 1024 8 1 tte3.j2k) add_test(tte3 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 2048 2048 1024 1024 8 1 tte3.j2k)
ADD_TEST(tte4 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 256 256 128 128 8 0 tte4.j2k) add_test(tte4 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 256 256 128 128 8 0 tte4.j2k)
ADD_TEST(tte5 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 512 512 256 256 8 0 tte5.j2k) add_test(tte5 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 512 512 256 256 8 0 tte5.j2k)
ADD_EXECUTABLE(test_tile_decoder test_tile_decoder.c) add_executable(test_tile_decoder test_tile_decoder.c)
TARGET_LINK_LIBRARIES(test_tile_decoder ${OPENJPEG_LIBRARY_NAME}) target_link_libraries(test_tile_decoder ${OPENJPEG_LIBRARY_NAME})
ADD_TEST(ttd0 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder) add_test(ttd0 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder)
set_property(TEST ttd0 APPEND PROPERTY DEPENDS tte0) set_property(TEST ttd0 APPEND PROPERTY DEPENDS tte0)
ADD_TEST(ttd1 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder 0 0 1024 1024 tte1.j2k) add_test(ttd1 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder 0 0 1024 1024 tte1.j2k)
set_property(TEST ttd1 APPEND PROPERTY DEPENDS tte1) set_property(TEST ttd1 APPEND PROPERTY DEPENDS tte1)
ADD_TEST(ttd2 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder 0 0 1024 1024 tte2.jp2) add_test(ttd2 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder 0 0 1024 1024 tte2.jp2)
set_property(TEST ttd2 APPEND PROPERTY DEPENDS tte2) set_property(TEST ttd2 APPEND PROPERTY DEPENDS tte2)
# No image send to the dashboard if lib PNG is not available. # No image send to the dashboard if lib PNG is not available.
IF(NOT HAVE_LIBPNG) if(NOT HAVE_LIBPNG)
MESSAGE(WARNING "Lib PNG seems to be not available: if you want run the non-regression tests with images reported to the dashboard, you need it (try BUILD_THIRDPARTY)") message(WARNING "Lib PNG seems to be not available: if you want run the non-regression tests with images reported to the dashboard, you need it (try BUILD_THIRDPARTY)")
ENDIF(NOT HAVE_LIBPNG) endif(NOT HAVE_LIBPNG)
ADD_SUBDIRECTORY(conformance) add_subdirectory(conformance)
ADD_SUBDIRECTORY(nonregression) add_subdirectory(nonregression)
IF(BUILD_JPIP) if(BUILD_JPIP)
IF(JPIP_SERVER) if(JPIP_SERVER)
#SET(s "http://jpip.example.com/myFCGI?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream") #set(s "http://jpip.example.com/myFCGI?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream")
SET(s "${JPIP_SERVER}?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream") set(s "${JPIP_SERVER}?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream")
SET(p "${CMAKE_CURRENT_BINARY_DIR}/jpip.dat") set(p "${CMAKE_CURRENT_BINARY_DIR}/jpip.dat")
SET(md5 "62b00c620fb0a600c5ffd413cada4674") set(md5 "62b00c620fb0a600c5ffd413cada4674")
ADD_TEST(TestJPIP1 ${CMAKE_COMMAND} -DD_URL:STRING=${s} -DD_FILE:PATH=${p} add_test(TestJPIP1 ${CMAKE_COMMAND} -DD_URL:STRING=${s} -DD_FILE:PATH=${p}
-DEXPECTED_MD5=${md5} -P ${PROJECT_SOURCE_DIR}/CMake/JPIPTestDriver.cmake) -DEXPECTED_MD5=${md5} -P ${PROJECT_SOURCE_DIR}/CMake/JPIPTestDriver.cmake)
ENDIF(JPIP_SERVER) endif(JPIP_SERVER)
ENDIF(BUILD_JPIP) endif(BUILD_JPIP)

View File

@ -1,19 +1,19 @@
# CONFORMANCE TESTS AND NON-REGRESSION ON THIS DATASET # CONFORMANCE TESTS AND NON-REGRESSION ON THIS DATASET
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Temporary) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Temporary)
SET(TEMP ${CMAKE_CURRENT_BINARY_DIR}/Temporary) set(TEMP ${CMAKE_CURRENT_BINARY_DIR}/Temporary)
SET(BASELINE_CONF ${OPJ_DATA_ROOT}/baseline/conformance) set(BASELINE_CONF ${OPJ_DATA_ROOT}/baseline/conformance)
SET(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression) set(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression)
SET(INPUT_CONF ${OPJ_DATA_ROOT}/input/conformance) set(INPUT_CONF ${OPJ_DATA_ROOT}/input/conformance)
# List of components by file (normaly p0_13.j2k have 257 components but for this # List of components by file (normaly p0_13.j2k have 257 components but for this
#set of test we consider only 4) #set of test we consider only 4)
SET( CP0_nbC_list "not_used;1;1;1;3;4;4;3;3;1;3;1;1;4;3;1;1") set( CP0_nbC_list "not_used;1;1;1;3;4;4;3;3;1;3;1;1;4;3;1;1")
SET( CP1_nbC_list "not_used;1;3;4;1;3;3;2") set( CP1_nbC_list "not_used;1;3;4;1;3;3;2")
SET(COMMENTCODEVAR FALSE) set(COMMENTCODEVAR FALSE)
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
@ -23,20 +23,20 @@ SET(COMMENTCODEVAR FALSE)
# non regression comparison # non regression comparison
# Parameters and tolerances given by Table C.1 # Parameters and tolerances given by Table C.1
SET( C0P0_ResFactor_list "not_used;0;0;0;3;3;3;0;5;2;0;0;0;0;2;0;0") set( C0P0_ResFactor_list "not_used;0;0;0;3;3;3;0;5;2;0;0;0;0;2;0;0")
SET( C0P0_PEAK_list "not_used;0;0;0;33;54;109;10;7;4;10;0;0;0;0;0;0") set( C0P0_PEAK_list "not_used;0;0;0;33;54;109;10;7;4;10;0;0;0;0;0;0")
SET( C0P0_MSE_list "not_used;0;0;0;55.8;68;743;0.34;6.72;1.47;2.84;0;0;0;0;0;0") set( C0P0_MSE_list "not_used;0;0;0;55.8;68;743;0.34;6.72;1.47;2.84;0;0;0;0;0;0")
FOREACH(numFileC0P0 RANGE 1 16) foreach(numFileC0P0 RANGE 1 16)
# Build filenames # Build filenames
IF(${numFileC0P0} LESS 10) if(${numFileC0P0} LESS 10)
SET( filenameInput p0_0${numFileC0P0}.j2k ) set( filenameInput p0_0${numFileC0P0}.j2k )
SET( filenameRef c0p0_0${numFileC0P0}.pgx ) set( filenameRef c0p0_0${numFileC0P0}.pgx )
ELSE(${numFileC0P0} LESS 10) else(${numFileC0P0} LESS 10)
SET( filenameInput p0_${numFileC0P0}.j2k ) set( filenameInput p0_${numFileC0P0}.j2k )
SET( filenameRef c0p0_${numFileC0P0}.pgx ) set( filenameRef c0p0_${numFileC0P0}.pgx )
ENDIF(${numFileC0P0} LESS 10) endif(${numFileC0P0} LESS 10)
# Get corresponding tests parameters # Get corresponding tests parameters
list(GET C0P0_ResFactor_list ${numFileC0P0} ResFactor) list(GET C0P0_ResFactor_list ${numFileC0P0} ResFactor)
@ -45,18 +45,18 @@ FOREACH(numFileC0P0 RANGE 1 16)
list(GET C0P0_MSE_list ${numFileC0P0} MSE_limit) list(GET C0P0_MSE_list ${numFileC0P0} MSE_limit)
# Manage cases which need to try different resolution reduction # Manage cases which need to try different resolution reduction
IF (numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15) if (numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15)
get_filename_component(filenameRefSub ${filenameRef} NAME_WE) get_filename_component(filenameRefSub ${filenameRef} NAME_WE)
#r = 0 #r = 0
ADD_TEST(ETS-C0P0-${filenameInput}-r0-decode add_test(ETS-C0P0-${filenameInput}-r0-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}-r0.pgx -o ${TEMP}/c0${filenameInput}-r0.pgx
-r 0 -r 0
) )
ADD_TEST(ETS-C0P0-${filenameInput}-r0-compare2ref add_test(ETS-C0P0-${filenameInput}-r0-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRefSub}r0.pgx -b ${BASELINE_CONF}/${filenameRefSub}r0.pgx
-t ${TEMP}/c0${filenameInput}-r0.pgx -t ${TEMP}/c0${filenameInput}-r0.pgx
@ -66,11 +66,11 @@ FOREACH(numFileC0P0 RANGE 1 16)
-s t_ -s t_
) )
SET_TESTS_PROPERTIES(ETS-C0P0-${filenameInput}-r0-compare2ref set_tests_properties(ETS-C0P0-${filenameInput}-r0-compare2ref
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r0-decode) ETS-C0P0-${filenameInput}-r0-decode)
ADD_TEST(NR-C0P0-${filenameInput}-r0-compare2base add_test(NR-C0P0-${filenameInput}-r0-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRefSub}-r0.pgx -b ${BASELINE_NR}/opj_${filenameRefSub}-r0.pgx
-t ${TEMP}/c0${filenameInput}-r0.pgx -t ${TEMP}/c0${filenameInput}-r0.pgx
@ -79,19 +79,19 @@ FOREACH(numFileC0P0 RANGE 1 16)
-s b_t_ -s b_t_
) )
SET_TESTS_PROPERTIES(NR-C0P0-${filenameInput}-r0-compare2base set_tests_properties(NR-C0P0-${filenameInput}-r0-compare2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r0-decode) ETS-C0P0-${filenameInput}-r0-decode)
#r = 1 #r = 1
ADD_TEST(ETS-C0P0-${filenameInput}-r1-decode add_test(ETS-C0P0-${filenameInput}-r1-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}-r1.pgx -o ${TEMP}/c0${filenameInput}-r1.pgx
-r 1 -r 1
) )
ADD_TEST(ETS-C0P0-${filenameInput}-r1-compare2ref add_test(ETS-C0P0-${filenameInput}-r1-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRefSub}r1.pgx -b ${BASELINE_CONF}/${filenameRefSub}r1.pgx
-t ${TEMP}/c0${filenameInput}-r1.pgx -t ${TEMP}/c0${filenameInput}-r1.pgx
@ -101,11 +101,11 @@ FOREACH(numFileC0P0 RANGE 1 16)
-s t_ -s t_
) )
SET_TESTS_PROPERTIES(ETS-C0P0-${filenameInput}-r1-compare2ref set_tests_properties(ETS-C0P0-${filenameInput}-r1-compare2ref
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r1-decode) ETS-C0P0-${filenameInput}-r1-decode)
ADD_TEST(NR-C0P0-${filenameInput}-r1-compare2base add_test(NR-C0P0-${filenameInput}-r1-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRefSub}-r1.pgx -b ${BASELINE_NR}/opj_${filenameRefSub}-r1.pgx
-t ${TEMP}/c0${filenameInput}-r1.pgx -t ${TEMP}/c0${filenameInput}-r1.pgx
@ -114,20 +114,20 @@ FOREACH(numFileC0P0 RANGE 1 16)
-s b_t_ -s b_t_
) )
SET_TESTS_PROPERTIES(NR-C0P0-${filenameInput}-r1-compare2base set_tests_properties(NR-C0P0-${filenameInput}-r1-compare2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r1-decode) ETS-C0P0-${filenameInput}-r1-decode)
ELSE(numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15) else(numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15)
ADD_TEST(ETS-C0P0-${filenameInput}-decode add_test(ETS-C0P0-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}.pgx -o ${TEMP}/c0${filenameInput}.pgx
-r ${ResFactor} -r ${ResFactor}
) )
ADD_TEST(ETS-C0P0-${filenameInput}-compare2ref add_test(ETS-C0P0-${filenameInput}-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRef} -b ${BASELINE_CONF}/${filenameRef}
-t ${TEMP}/c0${filenameInput}.pgx -t ${TEMP}/c0${filenameInput}.pgx
@ -137,11 +137,11 @@ FOREACH(numFileC0P0 RANGE 1 16)
-s t_ -s t_
) )
SET_TESTS_PROPERTIES(ETS-C0P0-${filenameInput}-compare2ref set_tests_properties(ETS-C0P0-${filenameInput}-compare2ref
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-decode) ETS-C0P0-${filenameInput}-decode)
ADD_TEST(NR-C0P0-${filenameInput}-compare2base add_test(NR-C0P0-${filenameInput}-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRef} -b ${BASELINE_NR}/opj_${filenameRef}
-t ${TEMP}/c0${filenameInput}.pgx -t ${TEMP}/c0${filenameInput}.pgx
@ -150,13 +150,13 @@ FOREACH(numFileC0P0 RANGE 1 16)
-s b_t_ -s b_t_
) )
SET_TESTS_PROPERTIES(NR-C0P0-${filenameInput}-compare2base set_tests_properties(NR-C0P0-${filenameInput}-compare2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-decode) ETS-C0P0-${filenameInput}-decode)
ENDIF(numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15) endif(numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15)
ENDFOREACH(numFileC0P0) endforeach(numFileC0P0)
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about class 0 profile 1 # Tests about class 0 profile 1
@ -165,15 +165,15 @@ ENDFOREACH(numFileC0P0)
# non regression comparison # non regression comparison
# Parameters and tolerances given by Table C.4 # Parameters and tolerances given by Table C.4
SET( C0P1_ResFactor_list "not_used;0;3;3;0;4;1;0") set( C0P1_ResFactor_list "not_used;0;3;3;0;4;1;0")
SET( C0P1_PEAK_list "not_used;0;35;28;2;128;128;0") set( C0P1_PEAK_list "not_used;0;35;28;2;128;128;0")
SET( C0P1_MSE_list "not_used;0;74;18.8;0.550;16384;16384;0") set( C0P1_MSE_list "not_used;0;74;18.8;0.550;16384;16384;0")
FOREACH(numFileC0P1 RANGE 1 7) foreach(numFileC0P1 RANGE 1 7)
# Build filenames # Build filenames
SET( filenameInput p1_0${numFileC0P1}.j2k ) set( filenameInput p1_0${numFileC0P1}.j2k )
SET( filenameRef c0p1_0${numFileC0P1}.pgx ) set( filenameRef c0p1_0${numFileC0P1}.pgx )
# Get corresponding tests parameters # Get corresponding tests parameters
list(GET C0P1_ResFactor_list ${numFileC0P1} ResFactor) list(GET C0P1_ResFactor_list ${numFileC0P1} ResFactor)
@ -182,18 +182,18 @@ FOREACH(numFileC0P1 RANGE 1 7)
list(GET C0P1_MSE_list ${numFileC0P1} MSE_limit) list(GET C0P1_MSE_list ${numFileC0P1} MSE_limit)
# Manage cases which need to try different resolution reduction # Manage cases which need to try different resolution reduction
IF (numFileC0P1 EQUAL 4 ) if (numFileC0P1 EQUAL 4 )
get_filename_component(filenameRefSub ${filenameRef} NAME_WE) get_filename_component(filenameRefSub ${filenameRef} NAME_WE)
#r = 0 #r = 0
ADD_TEST(ETS-C0P1-${filenameInput}-r0-decode add_test(ETS-C0P1-${filenameInput}-r0-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}-r0.pgx -o ${TEMP}/c0${filenameInput}-r0.pgx
-r 0 -r 0
) )
ADD_TEST(ETS-C0P1-${filenameInput}-r0-compare2ref add_test(ETS-C0P1-${filenameInput}-r0-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRefSub}r0.pgx -b ${BASELINE_CONF}/${filenameRefSub}r0.pgx
-t ${TEMP}/c0${filenameInput}-r0.pgx -t ${TEMP}/c0${filenameInput}-r0.pgx
@ -203,11 +203,11 @@ FOREACH(numFileC0P1 RANGE 1 7)
-s t_ -s t_
) )
SET_TESTS_PROPERTIES(ETS-C0P1-${filenameInput}-r0-compare2ref set_tests_properties(ETS-C0P1-${filenameInput}-r0-compare2ref
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r0-decode) ETS-C0P1-${filenameInput}-r0-decode)
ADD_TEST(NR-C0P1-${filenameInput}-r0-compare2base add_test(NR-C0P1-${filenameInput}-r0-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRefSub}-r0.pgx -b ${BASELINE_NR}/opj_${filenameRefSub}-r0.pgx
-t ${TEMP}/c0${filenameInput}-r0.pgx -t ${TEMP}/c0${filenameInput}-r0.pgx
@ -216,19 +216,19 @@ FOREACH(numFileC0P1 RANGE 1 7)
-s b_t_ -s b_t_
) )
SET_TESTS_PROPERTIES(NR-C0P1-${filenameInput}-r0-compare2base set_tests_properties(NR-C0P1-${filenameInput}-r0-compare2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r0-decode) ETS-C0P1-${filenameInput}-r0-decode)
#r = 3 #r = 3
ADD_TEST(ETS-C0P1-${filenameInput}-r3-decode add_test(ETS-C0P1-${filenameInput}-r3-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}-r3.pgx -o ${TEMP}/c0${filenameInput}-r3.pgx
-r 3 -r 3
) )
ADD_TEST(ETS-C0P1-${filenameInput}-r3-compare2ref add_test(ETS-C0P1-${filenameInput}-r3-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRefSub}r3.pgx -b ${BASELINE_CONF}/${filenameRefSub}r3.pgx
-t ${TEMP}/c0${filenameInput}-r3.pgx -t ${TEMP}/c0${filenameInput}-r3.pgx
@ -238,11 +238,11 @@ FOREACH(numFileC0P1 RANGE 1 7)
-s t_ -s t_
) )
SET_TESTS_PROPERTIES(ETS-C0P1-${filenameInput}-r3-compare2ref set_tests_properties(ETS-C0P1-${filenameInput}-r3-compare2ref
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r3-decode) ETS-C0P1-${filenameInput}-r3-decode)
ADD_TEST(NR-C0P1-${filenameInput}-r3-compare2base add_test(NR-C0P1-${filenameInput}-r3-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRefSub}-r3.pgx -b ${BASELINE_NR}/opj_${filenameRefSub}-r3.pgx
-t ${TEMP}/c0${filenameInput}-r3.pgx -t ${TEMP}/c0${filenameInput}-r3.pgx
@ -251,20 +251,20 @@ FOREACH(numFileC0P1 RANGE 1 7)
-s b_t_ -s b_t_
) )
SET_TESTS_PROPERTIES(NR-C0P1-${filenameInput}-r3-compare2base set_tests_properties(NR-C0P1-${filenameInput}-r3-compare2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r3-decode) ETS-C0P1-${filenameInput}-r3-decode)
ELSE(numFileC0P1 EQUAL 4) else(numFileC0P1 EQUAL 4)
ADD_TEST(ETS-C0P1-${filenameInput}-decode add_test(ETS-C0P1-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}.pgx -o ${TEMP}/c0${filenameInput}.pgx
-r ${ResFactor} -r ${ResFactor}
) )
ADD_TEST(ETS-C0P1-${filenameInput}-compare2ref add_test(ETS-C0P1-${filenameInput}-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRef} -b ${BASELINE_CONF}/${filenameRef}
-t ${TEMP}/c0${filenameInput}.pgx -t ${TEMP}/c0${filenameInput}.pgx
@ -274,11 +274,11 @@ FOREACH(numFileC0P1 RANGE 1 7)
-s t_ -s t_
) )
SET_TESTS_PROPERTIES(ETS-C0P1-${filenameInput}-compare2ref set_tests_properties(ETS-C0P1-${filenameInput}-compare2ref
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-decode) ETS-C0P1-${filenameInput}-decode)
ADD_TEST(NR-C0P1-${filenameInput}-compare2base add_test(NR-C0P1-${filenameInput}-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRef} -b ${BASELINE_NR}/opj_${filenameRef}
-t ${TEMP}/c0${filenameInput}.pgx -t ${TEMP}/c0${filenameInput}.pgx
@ -287,13 +287,13 @@ FOREACH(numFileC0P1 RANGE 1 7)
-s b_t_ -s b_t_
) )
SET_TESTS_PROPERTIES(NR-C0P1-${filenameInput}-compare2base set_tests_properties(NR-C0P1-${filenameInput}-compare2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-decode) ETS-C0P1-${filenameInput}-decode)
ENDIF(numFileC0P1 EQUAL 4) endif(numFileC0P1 EQUAL 4)
ENDFOREACH(numFileC0P1) endforeach(numFileC0P1)
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about class 1 profile 0 # Tests about class 1 profile 0
@ -302,20 +302,20 @@ ENDFOREACH(numFileC0P1)
# non regression comparison # non regression comparison
# Parameters and tolerances given by Table C.6 # Parameters and tolerances given by Table C.6
SET( C1P0_ResFactor_list "not_used;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0;0") set( C1P0_ResFactor_list "not_used;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0;0")
SET( C1P0_PEAK_list "not_used;0;0;0;5:4:6;2:2:2:0;635:403:378:0;0:0:0;0:0:0;0;0:0:0;0;0;0:0:0:0;0:0:0;0;0") set( C1P0_PEAK_list "not_used;0;0;0;5:4:6;2:2:2:0;635:403:378:0;0:0:0;0:0:0;0;0:0:0;0;0;0:0:0:0;0:0:0;0;0")
SET( C1P0_MSE_list "not_used;0;0;0;0.776:0.626:1.070;0.302:0.307:0.269:0;11287:6124:3968:0;0:0:0;0:0:0;0;0:0:0;0;0;0:0:0:0;0:0:0;0;0") set( C1P0_MSE_list "not_used;0;0;0;0.776:0.626:1.070;0.302:0.307:0.269:0;11287:6124:3968:0;0:0:0;0:0:0;0;0:0:0;0;0;0:0:0:0;0:0:0;0;0")
FOREACH(numFileC1P0 RANGE 1 16) foreach(numFileC1P0 RANGE 1 16)
# Build filenames # Build filenames
IF(${numFileC1P0} LESS 10) if(${numFileC1P0} LESS 10)
SET( filenameInput p0_0${numFileC1P0}.j2k ) set( filenameInput p0_0${numFileC1P0}.j2k )
SET( filenameRef c1p0_0${numFileC1P0}.pgx ) set( filenameRef c1p0_0${numFileC1P0}.pgx )
ELSE(${numFileC1P0} LESS 10) else(${numFileC1P0} LESS 10)
SET( filenameInput p0_${numFileC1P0}.j2k ) set( filenameInput p0_${numFileC1P0}.j2k )
SET( filenameRef c1p0_${numFileC1P0}.pgx ) set( filenameRef c1p0_${numFileC1P0}.pgx )
ENDIF(${numFileC1P0} LESS 10) endif(${numFileC1P0} LESS 10)
# Get corresponding tests parameters # Get corresponding tests parameters
list(GET CP0_nbC_list ${numFileC1P0} nbComponents) list(GET CP0_nbC_list ${numFileC1P0} nbComponents)
@ -323,14 +323,14 @@ FOREACH(numFileC1P0 RANGE 1 16)
list(GET C1P0_PEAK_list ${numFileC1P0} PEAK_limit) list(GET C1P0_PEAK_list ${numFileC1P0} PEAK_limit)
list(GET C1P0_MSE_list ${numFileC1P0} MSE_limit) list(GET C1P0_MSE_list ${numFileC1P0} MSE_limit)
ADD_TEST(ETS-C1P0-${filenameInput}-decode add_test(ETS-C1P0-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c1${filenameInput}.pgx -o ${TEMP}/c1${filenameInput}.pgx
-r ${ResFactor} -r ${ResFactor}
) )
ADD_TEST(ETS-C1P0-${filenameInput}-compare2ref add_test(ETS-C1P0-${filenameInput}-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRef} -b ${BASELINE_CONF}/${filenameRef}
-t ${TEMP}/c1${filenameInput}.pgx -t ${TEMP}/c1${filenameInput}.pgx
@ -340,11 +340,11 @@ FOREACH(numFileC1P0 RANGE 1 16)
-s b_t_ -s b_t_
) )
SET_TESTS_PROPERTIES(ETS-C1P0-${filenameInput}-compare2ref set_tests_properties(ETS-C1P0-${filenameInput}-compare2ref
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C1P0-${filenameInput}-decode) ETS-C1P0-${filenameInput}-decode)
ADD_TEST(NR-C1P0-${filenameInput}-compare2base add_test(NR-C1P0-${filenameInput}-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRef} -b ${BASELINE_NR}/opj_${filenameRef}
-t ${TEMP}/c1${filenameInput}.pgx -t ${TEMP}/c1${filenameInput}.pgx
@ -353,11 +353,11 @@ FOREACH(numFileC1P0 RANGE 1 16)
-s b_t_ -s b_t_
) )
SET_TESTS_PROPERTIES(NR-C1P0-${filenameInput}-compare2base set_tests_properties(NR-C1P0-${filenameInput}-compare2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C1P0-${filenameInput}-decode) ETS-C1P0-${filenameInput}-decode)
ENDFOREACH(numFileC1P0) endforeach(numFileC1P0)
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about class 1 profile 1 # Tests about class 1 profile 1
@ -366,28 +366,28 @@ ENDFOREACH(numFileC1P0)
# non regression comparison # non regression comparison
# Parameters and tolerances given by Table C.7 # Parameters and tolerances given by Table C.7
SET( C1P1_PEAK_list "not_used;0;5:4:6;2:2:1:0;624;40:40:40;2:2:2;0:0") set( C1P1_PEAK_list "not_used;0;5:4:6;2:2:1:0;624;40:40:40;2:2:2;0:0")
SET( C1P1_MSE_list "not_used;0;0.765:0.616:1.051;0.3:0.210:0.200:0;3080;8.458:9.816:10.154;0.6:0.6:0.6;0:0") set( C1P1_MSE_list "not_used;0;0.765:0.616:1.051;0.3:0.210:0.200:0;3080;8.458:9.816:10.154;0.6:0.6:0.6;0:0")
FOREACH(numFileC1P1 RANGE 1 7) foreach(numFileC1P1 RANGE 1 7)
# Build filenames # Build filenames
SET( filenameInput p1_0${numFileC1P1}.j2k ) set( filenameInput p1_0${numFileC1P1}.j2k )
SET( filenameRef c1p1_0${numFileC1P1}.pgx ) set( filenameRef c1p1_0${numFileC1P1}.pgx )
# Get corresponding tests parameters # Get corresponding tests parameters
list(GET CP1_nbC_list ${numFileC1P1} nbComponents) list(GET CP1_nbC_list ${numFileC1P1} nbComponents)
list(GET C1P1_PEAK_list ${numFileC1P1} PEAK_limit) list(GET C1P1_PEAK_list ${numFileC1P1} PEAK_limit)
list(GET C1P1_MSE_list ${numFileC1P1} MSE_limit) list(GET C1P1_MSE_list ${numFileC1P1} MSE_limit)
ADD_TEST(ETS-C1P1-${filenameInput}-decode add_test(ETS-C1P1-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c1${filenameInput}.pgx -o ${TEMP}/c1${filenameInput}.pgx
-r 0 -r 0
) )
ADD_TEST(ETS-C1P1-${filenameInput}-compare2ref add_test(ETS-C1P1-${filenameInput}-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRef} -b ${BASELINE_CONF}/${filenameRef}
-t ${TEMP}/c1${filenameInput}.pgx -t ${TEMP}/c1${filenameInput}.pgx
@ -397,11 +397,11 @@ FOREACH(numFileC1P1 RANGE 1 7)
-s b_t_ -s b_t_
) )
SET_TESTS_PROPERTIES(ETS-C1P1-${filenameInput}-compare2ref set_tests_properties(ETS-C1P1-${filenameInput}-compare2ref
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C1P1-${filenameInput}-decode) ETS-C1P1-${filenameInput}-decode)
ADD_TEST(NR-C1P1-${filenameInput}-compare2base add_test(NR-C1P1-${filenameInput}-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRef} -b ${BASELINE_NR}/opj_${filenameRef}
-t ${TEMP}/c1${filenameInput}.pgx -t ${TEMP}/c1${filenameInput}.pgx
@ -410,11 +410,11 @@ FOREACH(numFileC1P1 RANGE 1 7)
-s b_t_ -s b_t_
) )
SET_TESTS_PROPERTIES(NR-C1P1-${filenameInput}-compare2base set_tests_properties(NR-C1P1-${filenameInput}-compare2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C1P1-${filenameInput}-decode) ETS-C1P1-${filenameInput}-decode)
ENDFOREACH(numFileC1P1) endforeach(numFileC1P1)
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about JP2 file # Tests about JP2 file
@ -424,16 +424,16 @@ ENDFOREACH(numFileC1P1)
# Tolerances given by Table G.1 # Tolerances given by Table G.1
FOREACH(numFileJP2 RANGE 1 9) foreach(numFileJP2 RANGE 1 9)
# Build filenames # Build filenames
SET( filenameInput "file${numFileJP2}.jp2" ) set( filenameInput "file${numFileJP2}.jp2" )
SET( filenameRef jp2_${numFileJP2}.tif ) set( filenameRef jp2_${numFileJP2}.tif )
# Get corresponding tests parameters # Get corresponding tests parameters
list(GET JP2_PEAK_list ${numFileJP2} PEAK_limit) list(GET JP2_PEAK_list ${numFileJP2} PEAK_limit)
ADD_TEST(ETS-JP2-${filenameInput}-decode add_test(ETS-JP2-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/${filenameInput}.tif -o ${TEMP}/${filenameInput}.tif
@ -441,29 +441,29 @@ FOREACH(numFileJP2 RANGE 1 9)
# #
# FIXME: Need to implement a compare tif images function # FIXME: Need to implement a compare tif images function
# #
# ADD_TEST(ETS-JP2-${filenameInput}-compare2ref # add_test(ETS-JP2-${filenameInput}-compare2ref
# ${EXECUTABLE_OUTPUT_PATH}/compareTIFimages # ${EXECUTABLE_OUTPUT_PATH}/compareTIFimages
# -b ${BASELINE_CONF}/${filenameRef_tif} # -b ${BASELINE_CONF}/${filenameRef_tif}
# -t ${TEMP}/${filenameInput}.pgx # -t ${TEMP}/${filenameInput}.pgx
# -p 4 # -p 4
# ) # )
# #
# SET_TESTS_PROPERTIES(ETS-JP2-${filenameInput}-compare2ref # set_tests_properties(ETS-JP2-${filenameInput}-compare2ref
# PROPERTIES DEPENDS # PROPERTIES DEPENDS
# ETS-JP2-${filenameInput}-decode) # ETS-JP2-${filenameInput}-decode)
# #
# ADD_TEST(NR-JP2-${filenameInput}-compare2base # add_test(NR-JP2-${filenameInput}-compare2base
# ${EXECUTABLE_OUTPUT_PATH}/compareTIFimages # ${EXECUTABLE_OUTPUT_PATH}/compareTIFimages
# -b ${BASELINE_NR}/opj_${filenameRef} # -b ${BASELINE_NR}/opj_${filenameRef}
# -t ${TEMP}/${filenameInput}.tif # -t ${TEMP}/${filenameInput}.tif
# -d # -d
# ) # )
# #
# SET_TESTS_PROPERTIES(NR-JP2-${filenameInput}-compare2base # set_tests_properties(NR-JP2-${filenameInput}-compare2base
# PROPERTIES DEPENDS # PROPERTIES DEPENDS
# ETS-JP2-${filenameInput}-decode) # ETS-JP2-${filenameInput}-decode)
ENDFOREACH(numFileJP2) endforeach(numFileJP2)
#--------------------------------------------------------------------------# #--------------------------------------------------------------------------#
#--------------------------------------------------------------------------# #--------------------------------------------------------------------------#
@ -474,89 +474,89 @@ ENDFOREACH(numFileJP2)
# try to dump image and codestream informations into a file # try to dump image and codestream informations into a file
# non regression comparison this file to the baseline # non regression comparison this file to the baseline
FOREACH(numFileP0 RANGE 1 16) foreach(numFileP0 RANGE 1 16)
# Build filenames # Build filenames
IF(${numFileP0} LESS 10) if(${numFileP0} LESS 10)
SET( filenameInput p0_0${numFileP0}.j2k ) set( filenameInput p0_0${numFileP0}.j2k )
ELSE(${numFileP0} LESS 10) else(${numFileP0} LESS 10)
SET( filenameInput p0_${numFileP0}.j2k ) set( filenameInput p0_${numFileP0}.j2k )
ENDIF(${numFileP0} LESS 10) endif(${numFileP0} LESS 10)
get_filename_component(filenameRefSub ${filenameInput} NAME_WE) get_filename_component(filenameRefSub ${filenameInput} NAME_WE)
ADD_TEST(NR-${filenameInput}-dump add_test(NR-${filenameInput}-dump
${EXECUTABLE_OUTPUT_PATH}/j2k_dump ${EXECUTABLE_OUTPUT_PATH}/j2k_dump
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/${filenameInput}.txt -o ${TEMP}/${filenameInput}.txt
) )
ADD_TEST(NR-${filenameInput}-compare_dump2base add_test(NR-${filenameInput}-compare_dump2base
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files ${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
-b ${BASELINE_NR}/opj_v2_${filenameRefSub}.txt -b ${BASELINE_NR}/opj_v2_${filenameRefSub}.txt
-t ${TEMP}/${filenameInput}.txt -t ${TEMP}/${filenameInput}.txt
) )
SET_TESTS_PROPERTIES(NR-${filenameInput}-compare_dump2base set_tests_properties(NR-${filenameInput}-compare_dump2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-${filenameInput}-dump) NR-${filenameInput}-dump)
ENDFOREACH(numFileP0) endforeach(numFileP0)
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about dump of profile 1 file # Tests about dump of profile 1 file
# try to dump image and codestream informations into a file # try to dump image and codestream informations into a file
# non regression comparison this file to the baseline # non regression comparison this file to the baseline
FOREACH(numFileP1 RANGE 1 7) foreach(numFileP1 RANGE 1 7)
# Build filenames # Build filenames
SET( filenameInput p1_0${numFileP1}.j2k ) set( filenameInput p1_0${numFileP1}.j2k )
get_filename_component(filenameInputSub ${filenameInput} NAME_WE) get_filename_component(filenameInputSub ${filenameInput} NAME_WE)
ADD_TEST(NR-${filenameInput}-dump add_test(NR-${filenameInput}-dump
${EXECUTABLE_OUTPUT_PATH}/j2k_dump ${EXECUTABLE_OUTPUT_PATH}/j2k_dump
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/${filenameInput}.txt -o ${TEMP}/${filenameInput}.txt
) )
ADD_TEST(NR-${filenameInput}-compare_dump2base add_test(NR-${filenameInput}-compare_dump2base
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files ${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
-b ${BASELINE_NR}/opj_v2_${filenameInputSub}.txt -b ${BASELINE_NR}/opj_v2_${filenameInputSub}.txt
-t ${TEMP}/${filenameInput}.txt -t ${TEMP}/${filenameInput}.txt
) )
SET_TESTS_PROPERTIES(NR-${filenameInput}-compare_dump2base set_tests_properties(NR-${filenameInput}-compare_dump2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-${filenameInput}-dump) NR-${filenameInput}-dump)
ENDFOREACH(numFileP1) endforeach(numFileP1)
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about dump of JP2 file # Tests about dump of JP2 file
# try to dump image and codestream informations into a file # try to dump image and codestream informations into a file
# non regression comparison this file to the baseline # non regression comparison this file to the baseline
FOREACH(numFileJP2 RANGE 1 9) foreach(numFileJP2 RANGE 1 9)
# Build filenames # Build filenames
SET( filenameInput "file${numFileJP2}.jp2" ) set( filenameInput "file${numFileJP2}.jp2" )
get_filename_component(filenameInputSub ${filenameInput} NAME_WE) get_filename_component(filenameInputSub ${filenameInput} NAME_WE)
ADD_TEST(NR-${filenameInput}-dump add_test(NR-${filenameInput}-dump
${EXECUTABLE_OUTPUT_PATH}/j2k_dump ${EXECUTABLE_OUTPUT_PATH}/j2k_dump
-i ${INPUT_CONF}/${filenameInput} -i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/${filenameInput}.txt -o ${TEMP}/${filenameInput}.txt
) )
ADD_TEST(NR-${filenameInput}-compare_dump2base add_test(NR-${filenameInput}-compare_dump2base
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files ${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
-b ${BASELINE_NR}/opj_v2_${filenameInputSub}.txt -b ${BASELINE_NR}/opj_v2_${filenameInputSub}.txt
-t ${TEMP}/${filenameInput}.txt -t ${TEMP}/${filenameInput}.txt
) )
SET_TESTS_PROPERTIES(NR-${filenameInput}-compare_dump2base set_tests_properties(NR-${filenameInput}-compare_dump2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-${filenameInput}-dump) NR-${filenameInput}-dump)
ENDFOREACH(numFileJP2) endforeach(numFileJP2)

View File

@ -1,15 +1,15 @@
# NON-REGRESSION TESTS ON THIS DATASET LOCATED ${OPJ_DATA_ROOT}/input/nonregression # NON-REGRESSION TESTS ON THIS DATASET LOCATED ${OPJ_DATA_ROOT}/input/nonregression
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Temporary) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Temporary)
SET(TEMP ${CMAKE_CURRENT_BINARY_DIR}/Temporary) set(TEMP ${CMAKE_CURRENT_BINARY_DIR}/Temporary)
SET(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression) set(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression)
SET(INPUT_NR ${OPJ_DATA_ROOT}/input/nonregression) set(INPUT_NR ${OPJ_DATA_ROOT}/input/nonregression)
SET(INPUT_NR_PATH ${INPUT_NR}) set(INPUT_NR_PATH ${INPUT_NR})
SET(TEMP_PATH ${TEMP}) set(TEMP_PATH ${TEMP})
SET(INPUT_CONF_PATH ${OPJ_DATA_ROOT}/input/conformance) set(INPUT_CONF_PATH ${OPJ_DATA_ROOT}/input/conformance)
# need kdu_expand if possible # need kdu_expand if possible
find_package(KAKADU) find_package(KAKADU)
@ -19,49 +19,49 @@ find_package(KAKADU)
# Dump all files with the selected extension inside the input directory # Dump all files with the selected extension inside the input directory
# Define a list of file which should be gracefully rejected: # Define a list of file which should be gracefully rejected:
SET(BLACKLIST_JPEG2000 set(BLACKLIST_JPEG2000
empty empty
) )
FILE(GLOB_RECURSE OPJ_DATA_NR_LIST file(GLOB_RECURSE OPJ_DATA_NR_LIST
"${INPUT_NR}/*.j2k" "${INPUT_NR}/*.j2k"
"${INPUT_NR}/*.j2c" "${INPUT_NR}/*.j2c"
"${INPUT_NR}/*.jp2" "${INPUT_NR}/*.jp2"
#"${INPUT_NR}/*.jpx" #"${INPUT_NR}/*.jpx"
) )
FOREACH(INPUT_FILENAME ${OPJ_DATA_NR_LIST}) foreach(INPUT_FILENAME ${OPJ_DATA_NR_LIST})
GET_FILENAME_COMPONENT(INPUT_FILENAME_NAME ${INPUT_FILENAME} NAME) get_filename_component(INPUT_FILENAME_NAME ${INPUT_FILENAME} NAME)
GET_FILENAME_COMPONENT(INPUT_FILENAME_NAME_WE ${INPUT_FILENAME_NAME} NAME_WE) get_filename_component(INPUT_FILENAME_NAME_WE ${INPUT_FILENAME_NAME} NAME_WE)
STRING(REGEX MATCH ${INPUT_FILENAME_NAME} bad_jpeg2000 ${BLACKLIST_JPEG2000}) string(REGEX MATCH ${INPUT_FILENAME_NAME} bad_jpeg2000 ${BLACKLIST_JPEG2000})
# Dump the input image # Dump the input image
ADD_TEST(NR-${INPUT_FILENAME_NAME}-dump add_test(NR-${INPUT_FILENAME_NAME}-dump
${EXECUTABLE_OUTPUT_PATH}/j2k_dump ${EXECUTABLE_OUTPUT_PATH}/j2k_dump
-i ${INPUT_FILENAME} -i ${INPUT_FILENAME}
-o ${TEMP}/${INPUT_FILENAME_NAME}.txt -o ${TEMP}/${INPUT_FILENAME_NAME}.txt
-v -v
) )
IF(bad_jpeg2000) if(bad_jpeg2000)
SET_TESTS_PROPERTIES(NR-${INPUT_FILENAME_NAME}-dump set_tests_properties(NR-${INPUT_FILENAME_NAME}-dump
PROPERTIES WILL_FAIL TRUE) PROPERTIES WILL_FAIL TRUE)
ELSE(bad_jpeg2000) else(bad_jpeg2000)
# Compare the dump output with the baseline # Compare the dump output with the baseline
ADD_TEST(NR-${INPUT_FILENAME_NAME}-compare_dump2base add_test(NR-${INPUT_FILENAME_NAME}-compare_dump2base
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files ${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
-b ${BASELINE_NR}/opj_v2_${INPUT_FILENAME_NAME_WE}.txt -b ${BASELINE_NR}/opj_v2_${INPUT_FILENAME_NAME_WE}.txt
-t ${TEMP}/${INPUT_FILENAME_NAME}.txt -t ${TEMP}/${INPUT_FILENAME_NAME}.txt
) )
SET_TESTS_PROPERTIES(NR-${INPUT_FILENAME_NAME}-compare_dump2base set_tests_properties(NR-${INPUT_FILENAME_NAME}-compare_dump2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-${INPUT_FILENAME_NAME}-dump) NR-${INPUT_FILENAME_NAME}-dump)
ENDIF(bad_jpeg2000) endif(bad_jpeg2000)
ENDFOREACH(INPUT_FILENAME) endforeach(INPUT_FILENAME)
######################################################################### #########################################################################
@ -70,233 +70,233 @@ ENDFOREACH(INPUT_FILENAME)
# to know which files processed and with which options. # to know which files processed and with which options.
# Configure the test suite file: # Configure the test suite file:
CONFIGURE_FILE("test_suite.ctest.in" configure_file("test_suite.ctest.in"
"${CMAKE_CURRENT_BINARY_DIR}/test_suite.ctest" "${CMAKE_CURRENT_BINARY_DIR}/test_suite.ctest"
@ONLY) @ONLY)
# Read the file into a list # Read the file into a list
FILE(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/test_suite.ctest OPJ_TEST_CMD_LINE_LIST) file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/test_suite.ctest OPJ_TEST_CMD_LINE_LIST)
# Try to find and configure and read another test suite file # Try to find and configure and read another test suite file
FILE(GLOB TEST_SUITE_FILES *.ctest.in) file(GLOB TEST_SUITE_FILES *.ctest.in)
IF (TEST_SUITE_FILES) if (TEST_SUITE_FILES)
FOREACH(TEST_SUITE_FILE ${TEST_SUITE_FILES}) foreach(TEST_SUITE_FILE ${TEST_SUITE_FILES})
# Avoid to process the official test suite # Avoid to process the official test suite
SET(FILE_ALREADY_READ 0) set(FILE_ALREADY_READ 0)
GET_FILENAME_COMPONENT(TEST_SUITE_FILENAME ${TEST_SUITE_FILE} NAME) get_filename_component(TEST_SUITE_FILENAME ${TEST_SUITE_FILE} NAME)
STRING(REGEX MATCH "^test_suite.ctest.in$" FILE_ALREADY_READ ${TEST_SUITE_FILENAME}) string(REGEX MATCH "^test_suite.ctest.in$" FILE_ALREADY_READ ${TEST_SUITE_FILENAME})
IF(NOT FILE_ALREADY_READ) if(NOT FILE_ALREADY_READ)
# Configure the additional test suite file: # Configure the additional test suite file:
GET_FILENAME_COMPONENT(TEST_SUITE_FILE_SUB ${TEST_SUITE_FILE} NAME_WE) get_filename_component(TEST_SUITE_FILE_SUB ${TEST_SUITE_FILE} NAME_WE)
CONFIGURE_FILE("${TEST_SUITE_FILE}" configure_file("${TEST_SUITE_FILE}"
"${CMAKE_CURRENT_BINARY_DIR}/${TEST_SUITE_FILE_SUB}.ctest" "${CMAKE_CURRENT_BINARY_DIR}/${TEST_SUITE_FILE_SUB}.ctest"
@ONLY) @ONLY)
# Read the additional file into a list # Read the additional file into a list
FILE(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/${TEST_SUITE_FILE_SUB}.ctest OPJ_TEST_CMD_LINE_LIST_TEMP) file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/${TEST_SUITE_FILE_SUB}.ctest OPJ_TEST_CMD_LINE_LIST_TEMP)
# Append the list of command # Append the list of command
SET(OPJ_TEST_CMD_LINE_LIST ${OPJ_TEST_CMD_LINE_LIST} ${OPJ_TEST_CMD_LINE_LIST_TEMP}) set(OPJ_TEST_CMD_LINE_LIST ${OPJ_TEST_CMD_LINE_LIST} ${OPJ_TEST_CMD_LINE_LIST_TEMP})
ENDIF(NOT FILE_ALREADY_READ) endif(NOT FILE_ALREADY_READ)
ENDFOREACH(TEST_SUITE_FILE) endforeach(TEST_SUITE_FILE)
ELSE(TEST_SUITE_FILES) else(TEST_SUITE_FILES)
MESSAGE(FATAL_ERROR "One test suite should be available (test_suite.ctest.in) !!!") message(FATAL_ERROR "One test suite should be available (test_suite.ctest.in) !!!")
ENDIF(TEST_SUITE_FILES) endif(TEST_SUITE_FILES)
# Parse the command line found in the file(s) # Parse the command line found in the file(s)
SET(IT_TEST_ENC 0) set(IT_TEST_ENC 0)
SET(IT_TEST_DEC 0) set(IT_TEST_DEC 0)
FOREACH(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST}) foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
SET(IGNORE_LINE_FOUND 0) set(IGNORE_LINE_FOUND 0)
# Replace space by ; to generate a list # Replace space by ; to generate a list
STRING(REPLACE " " ";" CMD_ARG_LIST ${OPJ_TEST_CMD_LINE}) string(REPLACE " " ";" CMD_ARG_LIST ${OPJ_TEST_CMD_LINE})
# Check if the first argument begin by the comment sign # Check if the first argument begin by the comment sign
LIST(GET CMD_ARG_LIST 0 EXE_NAME) list(GET CMD_ARG_LIST 0 EXE_NAME)
IF(EXE_NAME) if(EXE_NAME)
STRING(REGEX MATCH "^#" IGNORE_LINE_FOUND ${EXE_NAME}) string(REGEX MATCH "^#" IGNORE_LINE_FOUND ${EXE_NAME})
ENDIF(EXE_NAME) endif(EXE_NAME)
IF(IGNORE_LINE_FOUND OR NOT EXE_NAME) if(IGNORE_LINE_FOUND OR NOT EXE_NAME)
#MESSAGE( STATUS "Current line is ignored: ${OPJ_TEST_CMD_LINE}") #message( STATUS "Current line is ignored: ${OPJ_TEST_CMD_LINE}")
ELSE(IGNORE_LINE_FOUND OR NOT EXE_NAME) else(IGNORE_LINE_FOUND OR NOT EXE_NAME)
# Check if the first argument begin by the failed sign # Check if the first argument begin by the failed sign
SET(FAILED_TEST_FOUND 0) set(FAILED_TEST_FOUND 0)
STRING(REGEX MATCH "^!" FAILED_TEST_FOUND ${EXE_NAME}) string(REGEX MATCH "^!" FAILED_TEST_FOUND ${EXE_NAME})
IF (FAILED_TEST_FOUND) if (FAILED_TEST_FOUND)
# Manage the different cases with the failed sign to remove the first argument which must be image_to_j2k # Manage the different cases with the failed sign to remove the first argument which must be image_to_j2k
SET(FAILED_TEST_FOUND_1 0) set(FAILED_TEST_FOUND_1 0)
STRING(REGEX MATCH "^!image_to_j2k$|^!j2k_to_image$" FAILED_TEST_FOUND_1 ${EXE_NAME}) string(REGEX MATCH "^!image_to_j2k$|^!j2k_to_image$" FAILED_TEST_FOUND_1 ${EXE_NAME})
IF (FAILED_TEST_FOUND_1) if (FAILED_TEST_FOUND_1)
LIST(REMOVE_AT CMD_ARG_LIST 0) list(REMOVE_AT CMD_ARG_LIST 0)
ELSE (FAILED_TEST_FOUND_1) else (FAILED_TEST_FOUND_1)
SET(FAILED_TEST_FOUND_2 0) set(FAILED_TEST_FOUND_2 0)
LIST(GET CMD_ARG_LIST 1 EXE_NAME) list(GET CMD_ARG_LIST 1 EXE_NAME)
STRING(REGEX MATCH "^image_to_j2k$|^j2k_to_image$" FAILED_TEST_FOUND_2 ${EXE_NAME}) string(REGEX MATCH "^image_to_j2k$|^j2k_to_image$" FAILED_TEST_FOUND_2 ${EXE_NAME})
IF (FAILED_TEST_FOUND_2) if (FAILED_TEST_FOUND_2)
LIST(REMOVE_AT CMD_ARG_LIST 0) list(REMOVE_AT CMD_ARG_LIST 0)
LIST(REMOVE_AT CMD_ARG_LIST 0) list(REMOVE_AT CMD_ARG_LIST 0)
ELSE (FAILED_TEST_FOUND_2) else (FAILED_TEST_FOUND_2)
MESSAGE( FATAL_ERROR "${EXE_NAME} is not the right executable name to encode file (try to use image_to_j2k or j2k_to_image)") message( FATAL_ERROR "${EXE_NAME} is not the right executable name to encode file (try to use image_to_j2k or j2k_to_image)")
ENDIF (FAILED_TEST_FOUND_2) endif (FAILED_TEST_FOUND_2)
ENDIF (FAILED_TEST_FOUND_1) endif (FAILED_TEST_FOUND_1)
ELSE (FAILED_TEST_FOUND) else (FAILED_TEST_FOUND)
# Check if the first argument is equal to image_to_j2k # Check if the first argument is equal to image_to_j2k
STRING(REGEX MATCH "^image_to_j2k$|^j2k_to_image$" EXE_NAME_FOUND ${EXE_NAME}) string(REGEX MATCH "^image_to_j2k$|^j2k_to_image$" EXE_NAME_FOUND ${EXE_NAME})
IF(EXE_NAME_FOUND) if(EXE_NAME_FOUND)
STRING(REGEX MATCH "image_to_j2k" ENC_TEST_FOUND ${EXE_NAME}) string(REGEX MATCH "image_to_j2k" ENC_TEST_FOUND ${EXE_NAME})
ELSE(EXE_NAME_FOUND) else(EXE_NAME_FOUND)
MESSAGE( FATAL_ERROR "${EXE_NAME} is not the right executable name to encode file (try to use image_to_j2k)") message( FATAL_ERROR "${EXE_NAME} is not the right executable name to encode file (try to use image_to_j2k)")
ENDIF(EXE_NAME_FOUND) endif(EXE_NAME_FOUND)
LIST(REMOVE_AT CMD_ARG_LIST 0) list(REMOVE_AT CMD_ARG_LIST 0)
ENDIF (FAILED_TEST_FOUND) endif (FAILED_TEST_FOUND)
# Parse the argument list to find the input filename and output filename # Parse the argument list to find the input filename and output filename
SET(CMD_ARG_LIST_2 "") set(CMD_ARG_LIST_2 "")
SET(ARG_POS 0) set(ARG_POS 0)
SET(INPUT_ARG_POS 0) set(INPUT_ARG_POS 0)
SET(OUTPUT_ARG_POS 0) set(OUTPUT_ARG_POS 0)
FOREACH(CMD_ARG_ELT ${CMD_ARG_LIST}) foreach(CMD_ARG_ELT ${CMD_ARG_LIST})
math(EXPR ARG_POS "${ARG_POS}+1" ) math(EXPR ARG_POS "${ARG_POS}+1" )
STRING(COMPARE EQUAL ${CMD_ARG_ELT} "-i" INPUT_ARG_FOUND) string(COMPARE EQUAL ${CMD_ARG_ELT} "-i" INPUT_ARG_FOUND)
IF(INPUT_ARG_FOUND) if(INPUT_ARG_FOUND)
SET(INPUT_ARG_POS ${ARG_POS}) set(INPUT_ARG_POS ${ARG_POS})
SET(INPUT_ARG_FOUND 0) set(INPUT_ARG_FOUND 0)
ENDIF(INPUT_ARG_FOUND) endif(INPUT_ARG_FOUND)
STRING(COMPARE EQUAL ${CMD_ARG_ELT} "-o" OUTPUT_ARG_FOUND) string(COMPARE EQUAL ${CMD_ARG_ELT} "-o" OUTPUT_ARG_FOUND)
IF(OUTPUT_ARG_FOUND) if(OUTPUT_ARG_FOUND)
SET(OUTPUT_ARG_POS ${ARG_POS}) set(OUTPUT_ARG_POS ${ARG_POS})
SET(OUTPUT_ARG_FOUND 0) set(OUTPUT_ARG_FOUND 0)
ENDIF(OUTPUT_ARG_FOUND) endif(OUTPUT_ARG_FOUND)
LIST (APPEND CMD_ARG_LIST_2 ${CMD_ARG_ELT}) list (APPEND CMD_ARG_LIST_2 ${CMD_ARG_ELT})
ENDFOREACH(CMD_ARG_ELT) endforeach(CMD_ARG_ELT)
LIST(GET CMD_ARG_LIST_2 ${INPUT_ARG_POS} INPUT_FILENAME) list(GET CMD_ARG_LIST_2 ${INPUT_ARG_POS} INPUT_FILENAME)
GET_FILENAME_COMPONENT(INPUT_FILENAME_NAME ${INPUT_FILENAME} NAME) get_filename_component(INPUT_FILENAME_NAME ${INPUT_FILENAME} NAME)
GET_FILENAME_COMPONENT(INPUT_FILENAME_NAME_WE ${INPUT_FILENAME_NAME} NAME_WE) get_filename_component(INPUT_FILENAME_NAME_WE ${INPUT_FILENAME_NAME} NAME_WE)
LIST(GET CMD_ARG_LIST_2 ${OUTPUT_ARG_POS} OUTPUT_FILENAME) list(GET CMD_ARG_LIST_2 ${OUTPUT_ARG_POS} OUTPUT_FILENAME)
GET_FILENAME_COMPONENT(OUTPUT_FILENAME_NAME_WE ${OUTPUT_FILENAME} NAME_WE) get_filename_component(OUTPUT_FILENAME_NAME_WE ${OUTPUT_FILENAME} NAME_WE)
#----- #-----
# Now we can add the test suite corresponding to a line command in the file # Now we can add the test suite corresponding to a line command in the file
#----- #-----
# ENCODER TEST SUITE # ENCODER TEST SUITE
IF(ENC_TEST_FOUND) if(ENC_TEST_FOUND)
math(EXPR IT_TEST_ENC "${IT_TEST_ENC}+1" ) math(EXPR IT_TEST_ENC "${IT_TEST_ENC}+1" )
# Encode an image into the jpeg2000 format # Encode an image into the jpeg2000 format
ADD_TEST(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode
${EXECUTABLE_OUTPUT_PATH}/image_to_j2k ${EXECUTABLE_OUTPUT_PATH}/image_to_j2k
${CMD_ARG_LIST_2} ${CMD_ARG_LIST_2}
) )
IF(FAILED_TEST_FOUND) if(FAILED_TEST_FOUND)
SET_TESTS_PROPERTIES(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode PROPERTIES WILL_FAIL TRUE) set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode PROPERTIES WILL_FAIL TRUE)
ELSE(FAILED_TEST_FOUND) else(FAILED_TEST_FOUND)
# Dump the encoding file # Dump the encoding file
ADD_TEST(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump
${EXECUTABLE_OUTPUT_PATH}/j2k_dump ${EXECUTABLE_OUTPUT_PATH}/j2k_dump
-i ${OUTPUT_FILENAME} -i ${OUTPUT_FILENAME}
-o ${OUTPUT_FILENAME}-ENC-${IT_TEST_ENC}.txt -o ${OUTPUT_FILENAME}-ENC-${IT_TEST_ENC}.txt
) )
SET_TESTS_PROPERTIES(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode) NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode)
# Compare the dump file with the baseline # Compare the dump file with the baseline
ADD_TEST(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dump2base add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dump2base
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files ${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
-b ${BASELINE_NR}/opj_v2_${OUTPUT_FILENAME_NAME_WE}-ENC-${IT_TEST_ENC}.txt -b ${BASELINE_NR}/opj_v2_${OUTPUT_FILENAME_NAME_WE}-ENC-${IT_TEST_ENC}.txt
-t ${OUTPUT_FILENAME}-ENC-${IT_TEST_ENC}.txt -t ${OUTPUT_FILENAME}-ENC-${IT_TEST_ENC}.txt
) )
SET_TESTS_PROPERTIES(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dump2base set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dump2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump) NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump)
# Decode the encoding file with kakadu expand command # Decode the encoding file with kakadu expand command
IF (KDU_EXPAND_EXECUTABLE) if (KDU_EXPAND_EXECUTABLE)
ADD_TEST(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref
${KDU_EXPAND_EXECUTABLE} ${KDU_EXPAND_EXECUTABLE}
-i ${OUTPUT_FILENAME} -i ${OUTPUT_FILENAME}
-o ${OUTPUT_FILENAME}.raw -o ${OUTPUT_FILENAME}.raw
) )
SET_TESTS_PROPERTIES(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode) NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode)
# Compare the decoding file with baseline generated from the kdu_expand and baseline.j2k # Compare the decoding file with baseline generated from the kdu_expand and baseline.j2k
ADD_TEST(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dec-ref-out2base add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dec-ref-out2base
${EXECUTABLE_OUTPUT_PATH}/compareRAWimages ${EXECUTABLE_OUTPUT_PATH}/compareRAWimages
-b ${BASELINE_NR}/opj_${OUTPUT_FILENAME_NAME_WE}-ENC-${IT_TEST_ENC}.raw -b ${BASELINE_NR}/opj_${OUTPUT_FILENAME_NAME_WE}-ENC-${IT_TEST_ENC}.raw
-t ${OUTPUT_FILENAME}.raw -t ${OUTPUT_FILENAME}.raw
) )
SET_TESTS_PROPERTIES(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dec-ref-out2base set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dec-ref-out2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref) NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref)
ENDIF() endif()
ENDIF(FAILED_TEST_FOUND) endif(FAILED_TEST_FOUND)
# DECODER TEST SUITE # DECODER TEST SUITE
ELSE(ENC_TEST_FOUND) else(ENC_TEST_FOUND)
math(EXPR IT_TEST_DEC "${IT_TEST_DEC}+1" ) math(EXPR IT_TEST_DEC "${IT_TEST_DEC}+1" )
# Decode the input image # Decode the input image
ADD_TEST(NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-decode add_test(NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
${CMD_ARG_LIST_2} ${CMD_ARG_LIST_2}
) )
IF(FAILED_TEST_FOUND) if(FAILED_TEST_FOUND)
SET_TESTS_PROPERTIES(NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-decode PROPERTIES WILL_FAIL TRUE) set_tests_properties(NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-decode PROPERTIES WILL_FAIL TRUE)
ELSE(FAILED_TEST_FOUND) else(FAILED_TEST_FOUND)
# FIXME: add a compare2base function base on raw which # FIXME: add a compare2base function base on raw which
# can output png diff files if necesary # can output png diff files if necesary
# ADD_TEST(NR-${filename}-compare2base # add_test(NR-${filename}-compare2base
# ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages # ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
# -b ${BASELINE_NR}/opj_${filenameRef} # -b ${BASELINE_NR}/opj_${filenameRef}
# -t ${TEMP}/${filename}.pgx # -t ${TEMP}/${filename}.pgx
@ -305,14 +305,14 @@ FOREACH(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
# -s b_t_ # -s b_t_
# ) # )
# #
# SET_TESTS_PROPERTIES(NR-${filename}-compare2base # set_tests_properties(NR-${filename}-compare2base
# PROPERTIES DEPENDS # PROPERTIES DEPENDS
# NR-${filename}-decode) # NR-${filename}-decode)
ENDIF(FAILED_TEST_FOUND) endif(FAILED_TEST_FOUND)
ENDIF(ENC_TEST_FOUND) endif(ENC_TEST_FOUND)
ENDIF(IGNORE_LINE_FOUND OR NOT EXE_NAME) endif(IGNORE_LINE_FOUND OR NOT EXE_NAME)
ENDFOREACH(OPJ_TEST_CMD_LINE) endforeach(OPJ_TEST_CMD_LINE)