[trunk] Remove CMake-language block-end command arguments

Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block.  This is no longer the preferred style.
Thanks to Hans Johnson
This commit is contained in:
Mickael Savinaud 2012-08-30 17:20:03 +00:00
parent d5bb3b0039
commit 3135642ff5
24 changed files with 438 additions and 438 deletions

View File

@ -12,9 +12,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(FCGI DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR
if(FCGI_FOUND)
set(FCGI_LIBRARIES ${FCGI_LIBRARY})
set(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR})
else(FCGI_FOUND)
else()
set(FCGI_LIBRARIES)
set(FCGI_INCLUDE_DIRS)
endif(FCGI_FOUND)
endif()
mark_as_advanced(FCGI_INCLUDE_DIR FCGI_LIBRARY)

View File

@ -28,4 +28,4 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS DEFAULT_MSG LCMS_LIBRARY LCMS_INCLUDE_
if(LCMS_FOUND)
set( LCMS_INCLUDE_DIRS ${LCMS_INCLUDE_DIR})
set( LCMS_LIBRARIES ${LCMS_LIBRARY} )
endif(LCMS_FOUND)
endif()

View File

@ -20,7 +20,7 @@ find_library(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} )
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
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR)
@ -28,4 +28,4 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLU
if(LCMS2_FOUND)
set( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
set( LCMS2_LIBRARIES ${LCMS2_LIBRARY} )
endif(LCMS2_FOUND)
endif()

View File

@ -7,7 +7,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
endif()
include(${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake)
endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
endif()
set(OPJ_PACKAGE_DESCRIPTION_SUMMARY "OpenJPEG - OpenJPEG a JPEG 2000 implementation.")
set(OPJ_PACKAGE_CONTACT "openjpeg users <openjpeg@googlegroups.com>")
@ -35,29 +35,29 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# cygwin is good for the system name
if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
set(CPACK_SYSTEM_NAME Cygwin)
else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
else()
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
endif(NOT DEFINED CPACK_SYSTEM_NAME)
endif()
endif()
if(${CPACK_SYSTEM_NAME} MATCHES Windows)
if(CMAKE_CL_64)
set(CPACK_SYSTEM_NAME win64-x64)
else(CMAKE_CL_64)
else()
set(CPACK_SYSTEM_NAME win32-x86)
endif(CMAKE_CL_64)
endif(${CPACK_SYSTEM_NAME} MATCHES Windows)
endif()
endif()
if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
# 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
if(CYGWIN)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
else(CYGWIN)
set(CPACK_PACKAGE_FILE_NAME
else()
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
endif(CYGWIN)
endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
endif()
endif()
set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist

View File

@ -29,17 +29,17 @@ if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
get_filename_component(OPENJPEG_INCLUDE_ROOT "${SELF_DIR}/../../@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE)
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_ROOT})
else(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
else()
if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
# This is a build tree
set( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@)
include(${SELF_DIR}/OpenJPEGExports.cmake)
else(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
else()
message(FATAL_ERROR "ooops")
endif(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
endif(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
endif()
endif()
set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake)

View File

@ -12,7 +12,7 @@ int main(int argc, char **argv)
* and make sure we have ftello / fseeko.
*/
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
FILE *fp = fopen(argv[0],"r");
off_t offset = ftello( fp );

View File

@ -6,7 +6,7 @@
# This macro will also defines the necessary variable enable large file support, for instance
# _LARGE_FILES
# _LARGEFILE_SOURCE
# _FILE_OFFSET_BITS 64
# _FILE_OFFSET_BITS 64
# HAVE_FSEEKO
#
# However, it is YOUR job to make sure these defines are set in a #cmakedefine so they
@ -14,7 +14,7 @@
#
# Adapted from Gromacs project (http://www.gromacs.org/)
# by Julien Malik
#
#
macro(OPJ_TEST_LARGE_FILES VARIABLE)
if("${VARIABLE}" MATCHES "^${VARIABLE}$")
@ -30,7 +30,7 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
"${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c")
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present")
endif(FILE64_OK)
endif()
if(NOT FILE64_OK)
# Test with _FILE_OFFSET_BITS=64
@ -40,8 +40,8 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64")
set(_FILE_OFFSET_BITS 64)
endif(FILE64_OK)
endif(NOT FILE64_OK)
endif()
endif()
if(NOT FILE64_OK)
# Test with _LARGE_FILES
@ -51,8 +51,8 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES")
set(_LARGE_FILES 1)
endif(FILE64_OK)
endif(NOT FILE64_OK)
endif()
endif()
if(NOT FILE64_OK)
# Test with _LARGEFILE_SOURCE
@ -62,8 +62,8 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE 1)
endif(FILE64_OK)
endif(NOT FILE64_OK)
endif()
endif()
#if(NOT FILE64_OK)
@ -73,31 +73,31 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
# if(FILE64_OK)
# message(STATUS "Checking for 64-bit off_t - present with _fseeki64")
# set(HAVE__FSEEKI64 1)
# endif(FILE64_OK)
#endif(NOT FILE64_OK)
# endif()
#endif()
if(NOT FILE64_OK)
message(STATUS "Checking for 64-bit off_t - not present")
endif(NOT FILE64_OK)
endif()
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(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE")
# 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")
message(STATUS "Checking for fseeko/ftello")
# Test if ftello/fseeko are available
try_compile(FSEEKO_COMPILE_OK
"${PROJECT_BINARY_DIR}"
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")
if(FSEEKO_COMPILE_OK)
message(STATUS "Checking for fseeko/ftello - present")
endif(FSEEKO_COMPILE_OK)
endif()
if(NOT FSEEKO_COMPILE_OK)
# glibc 2.2 needs _LARGEFILE_SOURCE for fseeko (but not for 64-bit off_t...)
@ -105,30 +105,30 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
"${PROJECT_BINARY_DIR}"
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c"
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" )
if(FSEEKO_COMPILE_OK)
message(STATUS "Checking for fseeko/ftello - present with _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE")
endif(FSEEKO_COMPILE_OK)
endif(NOT FSEEKO_COMPILE_OK)
endif()
endif()
if(FSEEKO_COMPILE_OK)
set(HAVE_FSEEKO ON CACHE INTERNAL "Result of test for fseeko/ftello")
else(FSEEKO_COMPILE_OK)
else()
message(STATUS "Checking for fseeko/ftello - not found")
set(HAVE_FSEEKO OFF CACHE INTERNAL "Result of test for fseeko/ftello")
endif(FSEEKO_COMPILE_OK)
endif()
if(FILE64_OK AND FSEEKO_COMPILE_OK)
message(STATUS "Large File support - found")
set(${VARIABLE} ON CACHE INTERNAL "Result of test for large file support")
else(FILE64_OK AND FSEEKO_COMPILE_OK)
else()
message(STATUS "Large File support - not found")
set(${VARIABLE} OFF CACHE INTERNAL "Result of test for large file support")
endif(FILE64_OK AND FSEEKO_COMPILE_OK)
endif()
endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
endmacro(OPJ_TEST_LARGE_FILES VARIABLE)
endif()
endmacro()

View File

@ -11,12 +11,12 @@ cmake_minimum_required(VERSION 2.6)
if(COMMAND CMAKE_POLICY)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND CMAKE_POLICY)
endif()
if(NOT OPENJPEG_NAMESPACE)
set(OPENJPEG_NAMESPACE "OPENJPEG")
set(OPENJPEG_STANDALONE 1)
endif(NOT OPENJPEG_NAMESPACE)
endif()
# In all cases:
string(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME)
@ -65,11 +65,11 @@ if(WIN32)
-D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE
)
endif(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
endif(NOT MINGW)
endif(NOT CYGWIN)
endif(NOT BORLAND)
endif(WIN32)
endif()
endif()
endif()
endif()
endif()
# --------------------------------------------------------------------------
@ -80,38 +80,38 @@ set(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG
if(NOT OPENJPEG_INSTALL_BIN_DIR)
set(OPENJPEG_INSTALL_BIN_DIR "bin")
endif(NOT OPENJPEG_INSTALL_BIN_DIR)
endif()
if(NOT OPENJPEG_INSTALL_LIB_DIR)
set(OPENJPEG_INSTALL_LIB_DIR "lib")
endif(NOT OPENJPEG_INSTALL_LIB_DIR)
endif()
if(NOT OPENJPEG_INSTALL_SHARE_DIR)
set(OPENJPEG_INSTALL_SHARE_DIR "share")
endif(NOT OPENJPEG_INSTALL_SHARE_DIR)
endif()
if(NOT OPENJPEG_INSTALL_DATA_DIR)
set(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
endif(NOT OPENJPEG_INSTALL_DATA_DIR)
endif()
if(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
set(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}")
endif(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
endif()
if(NOT OPENJPEG_INSTALL_MAN_DIR)
set(OPENJPEG_INSTALL_MAN_DIR "share/man/")
endif(NOT OPENJPEG_INSTALL_MAN_DIR)
endif()
if(NOT OPENJPEG_INSTALL_DOC_DIR)
set(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}")
endif(NOT OPENJPEG_INSTALL_DOC_DIR)
endif()
if(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
# We could install *.cmake files in share/ however those files contains
# 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)
set(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
endif(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
endif()
#-----------------------------------------------------------------------------
# Big endian test:
@ -141,7 +141,7 @@ set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in
${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h
@ONLY)
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
endif()
#-----------------------------------------------------------------------------
# pkgconfig support
@ -154,7 +154,7 @@ if(UNIX)
install( CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
\"libopenjpeg1.pc\"
\"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_SHARE_DIR}/pkgconfig/libopenjpeg.pc\")")
endif(UNIX)
endif()
#-----------------------------------------------------------------------------
# Compiler specific flags:
@ -163,7 +163,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
# 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:
set(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}")
endif(CMAKE_COMPILER_IS_GNUCC)
endif()
#-----------------------------------------------------------------------------
# opj_config.h generation (1/2)
@ -195,7 +195,7 @@ option(BUILD_JPWL "Build the JPWL library and executables" OFF)
option(BUILD_JPIP "Build the JPIP library and executables." OFF)
if(BUILD_JPIP)
option(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
endif(BUILD_JPIP)
endif()
option(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF)
option(BUILD_JAVA "Build the openjpeg jar (Java)" OFF)
mark_as_advanced(BUILD_VIEWER)
@ -207,7 +207,7 @@ if(BUILD_CODEC OR BUILD_MJ2)
option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
add_subdirectory(thirdparty)
add_subdirectory(applications)
endif (BUILD_CODEC OR BUILD_MJ2)
endif ()
include(CheckTypeSize)
CHECK_TYPE_SIZE(ssize_t SSIZE_T)
@ -226,7 +226,7 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/opj_config.h
option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
if(BUILD_DOC)
add_subdirectory(doc)
endif(BUILD_DOC)
endif()
#-----------------------------------------------------------------------------
# Buld Testing
@ -235,10 +235,10 @@ if(BUILD_TESTING)
if(BUILD_CODEC)
enable_testing()
include(CTest)
# Search openjpeg data needed for the tests
# 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
PATHS
$ENV{OPJ_DATA_ROOT}
@ -247,11 +247,11 @@ if(BUILD_TESTING)
# Add repository where to find tests
add_subdirectory(tests)
else(BUILD_CODEC)
else()
message(FATAL_ERROR "You need build codec to run the tests")
endif(BUILD_CODEC)
endif(BUILD_TESTING)
endif()
endif()
#-----------------------------------------------------------------------------
# install all targets referenced as OPENJPEGTargets
@ -268,7 +268,7 @@ install( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
# install CHANGES and LICENSE
if(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
install(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
endif(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
endif()
install(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
include (CMake/OpenJPEGCPack.cmake)

View File

@ -2,21 +2,21 @@
if(BUILD_CODEC)
add_subdirectory(codec)
endif(BUILD_CODEC)
endif()
if(BUILD_MJ2)
add_subdirectory(mj2)
endif(BUILD_MJ2)
endif()
# Client & Server:
if(BUILD_JPIP)
add_subdirectory(jpip)
endif(BUILD_JPIP)
endif()
if(BUILD_VIEWER)
add_subdirectory(OPJViewer)
endif(BUILD_VIEWER)
endif()
if(BUILD_JAVA)
add_subdirectory(JavaOpenJPEG)
endif(BUILD_JAVA)
endif()

View File

@ -21,15 +21,15 @@ include_directories(
if(WIN32)
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else(BUILD_SHARED_LIBS)
else()
add_definitions(-DOPJ_STATIC)
endif(BUILD_SHARED_LIBS)
endif(WIN32)
endif()
endif()
# Loop over all executables:
foreach(exe j2k_to_image image_to_j2k j2k_dump)
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}
)
# To support universal exe:
@ -37,18 +37,18 @@ foreach(exe j2k_to_image image_to_j2k j2k_dump)
target_link_libraries(${exe} z)
ELSe(ZLIB_FOUND AND APPLE)
target_link_libraries(${exe} ${Z_LIBNAME})
endif(ZLIB_FOUND AND APPLE)
endif()
# On unix you need to link to the math library:
if(UNIX)
target_link_libraries(${exe} m)
endif(UNIX)
endif()
# Install exe
install(TARGETS ${exe}
EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
endforeach(exe)
endforeach()
# Install man pages
install(
@ -63,7 +63,7 @@ if(BUILD_JPWL)
j2k_to_image.c
${common_SRCS}
)
set_property(
TARGET JPWL_j2k_to_image
APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
@ -71,29 +71,29 @@ if(BUILD_JPWL)
target_link_libraries(JPWL_j2k_to_image ${OPENJPEG_LIBRARY_NAME}_JPWL
${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
# To support universal exe:
if(ZLIB_FOUND AND APPLE)
target_link_libraries(JPWL_j2k_to_image z)
ELSe(ZLIB_FOUND AND APPLE)
target_link_libraries(JPWL_j2k_to_image ${Z_LIBNAME})
endif(ZLIB_FOUND AND APPLE)
endif()
if(UNIX)
target_link_libraries(JPWL_j2k_to_image m)
endif(UNIX)
endif()
add_executable(JPWL_image_to_j2k
image_to_j2k.c
${common_SRCS}
)
set_property(
TARGET JPWL_image_to_j2k
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})
# To support universal exe:
@ -101,13 +101,13 @@ if(BUILD_JPWL)
target_link_libraries(JPWL_image_to_j2k z)
ELSe(ZLIB_FOUND AND APPLE)
target_link_libraries(JPWL_image_to_j2k ${Z_LIBNAME})
endif(ZLIB_FOUND AND APPLE)
endif()
if(UNIX)
target_link_libraries(JPWL_image_to_j2k m)
endif(UNIX)
endif()
install(TARGETS JPWL_image_to_j2k JPWL_j2k_to_image
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
endif(BUILD_JPWL)
endif()

View File

@ -5,8 +5,8 @@ if(BUILD_JPIP_SERVER)
find_package(Threads REQUIRED)
if(NOT CMAKE_USE_PTHREADS_INIT)
message(FATAL_ERROR "Only pthread are supported")
endif(NOT CMAKE_USE_PTHREADS_INIT)
endif(BUILD_JPIP_SERVER)
endif()
endif()
# JPIP library:
add_subdirectory(libopenjpip)

View File

@ -52,7 +52,7 @@ target_link_libraries(openjpip_local ${OPENJPEG_LIBRARY_NAME})
if(WIN32)
# add Winsock on windows+mingw
target_link_libraries(openjpip_local ws2_32)
endif(WIN32)
endif()
# Install library
install(TARGETS openjpip_local
@ -69,4 +69,4 @@ if(BUILD_JPIP_SERVER)
EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
)
endif(BUILD_JPIP_SERVER)
endif()

View File

@ -14,11 +14,11 @@ install(TARGETS addXMLinJP2
)
if(BUILD_JPIP_SERVER)
set(OPJ_SERVER_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/opj_server.c
)
# Build executable
add_executable(opj_server ${OPJ_SERVER_SRCS})
target_link_libraries(opj_server openjpip_server)
@ -31,14 +31,14 @@ if(BUILD_JPIP_SERVER)
# On unix you need to link to the math library:
if(UNIX)
target_link_libraries(opj_server m)
endif(UNIX)
endif()
# Install exe
install(TARGETS opj_server
EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
endif(BUILD_JPIP_SERVER)
endif()
set(EXES
opj_dec_server
@ -53,7 +53,7 @@ foreach(exe ${EXES})
EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
endforeach(exe)
endforeach()
# Build the two java clients:
find_package(Java 1.5 COMPONENTS Development) # javac, jar
@ -128,7 +128,7 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
-classpath ${APACHE_XERCES_JAR}
${java2_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes2
COMMAND ${Java_JAR_EXECUTABLE} cfm ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
${CMAKE_CURRENT_BINARY_DIR}/opj_viewer_xerces/dist/manifest.txt
${CMAKE_CURRENT_BINARY_DIR}/opj_viewer_xerces/dist/manifest.txt
-C ${CMAKE_CURRENT_BINARY_DIR}/classes2 .
DEPENDS ${java2_srcs}
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer_xerces/dist/manifest.txt.in
@ -145,6 +145,6 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
)
endif()
else(Java_Development_FOUND)
else()
message(WARNING "No java compiler found. Wont be able to build java viewer")
endif()

View File

@ -34,7 +34,7 @@ set(MJ2_SRCS mj2.c mj2_convert.c)
if(WIN32)
add_definitions(-DOPJ_STATIC)
endif(WIN32)
endif()
# Headers file are located here:
include_directories(
@ -53,7 +53,7 @@ target_link_libraries(frames_to_mj2 ${LCMS_LIBNAME})
if(UNIX)
target_link_libraries(frames_to_mj2 m)
endif(UNIX)
endif()
add_executable(mj2_to_frames
mj2_to_frames.c
@ -66,7 +66,7 @@ target_link_libraries(mj2_to_frames ${LCMS_LIBNAME})
if(UNIX)
target_link_libraries(mj2_to_frames m)
endif(UNIX)
endif()
add_executable(extract_j2k_from_mj2
extract_j2k_from_mj2.c
@ -77,7 +77,7 @@ target_link_libraries(extract_j2k_from_mj2 ${LCMS_LIBNAME})
if(UNIX)
target_link_libraries(extract_j2k_from_mj2 m)
endif(UNIX)
endif()
add_executable(wrap_j2k_in_mj2
wrap_j2k_in_mj2.c
@ -88,7 +88,7 @@ target_link_libraries(wrap_j2k_in_mj2 ${LCMS_LIBNAME})
if(UNIX)
target_link_libraries(wrap_j2k_in_mj2 m)
endif(UNIX)
endif()
install(TARGETS frames_to_mj2 mj2_to_frames extract_j2k_from_mj2 wrap_j2k_in_mj2
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR})

View File

@ -11,7 +11,7 @@ if(DOXYGEN_FOUND)
${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox @ONLY)
# 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
${CMAKE_BINARY_DIR}/doc/mainpage.dox @ONLY)
@ -19,8 +19,8 @@ if(DOXYGEN_FOUND)
add_custom_target(doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox)
else(DOXYGEN_FOUND)
else()
message(STATUS "Doxygen not found, we cannot generate the documentation")
endif(DOXYGEN_FOUND)
endif()

View File

@ -26,30 +26,30 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*! \mainpage OpenJPEG v@OPENJPEG_VERSION@ Documentation
*
* \section intro Introduction
* This manual documents the low-level OpenJPEG C API.\n
* The OpenJPEG library is an open-source JPEG 2000 library developed in order to promote the use of JPEG 2000.\n
* This documents is focused on the main part of the library which try to implement Part 1 and Part 2 of the JPEG2000 norm.\n
* This documents is focused on the main part of the library which try to implement Part 1 and Part 2 of the JPEG2000 norm.\n
*
* \section home Home page
*
* The Home Page of the OpenJPEG library can be found at:
*
* http://code.google.com/p/openjpeg/
*
*
* More information about the OpenJPEG library is available here:
*
* http://www.openjpeg.org/
*
*
* The OpenJPEG mailing list is located here:
*
*
* http://groups.google.com/group/openjpeg
*
*
* All the source code is online and can be retrieved using svn from here:
*
*
* http://openjpeg.googlecode.com/svn/
*
* \section license License
@ -59,4 +59,4 @@
*
* \author OpenJPEG Team
*
*/
*/

View File

@ -31,20 +31,20 @@ set(OPENJPEG_SRCS
if(WIN32)
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else(BUILD_SHARED_LIBS)
else()
add_definitions(-DOPJ_STATIC)
endif(BUILD_SHARED_LIBS)
endif(WIN32)
endif()
endif()
add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
if(UNIX)
target_link_libraries(${OPENJPEG_LIBRARY_NAME} m)
endif(UNIX)
endif()
set_target_properties(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
# Build the JPWL library ?
if(BUILD_JPWL)
add_subdirectory(jpwl)
endif(BUILD_JPWL)
endif()
# Install library
install(TARGETS ${OPENJPEG_LIBRARY_NAME}

View File

@ -8,7 +8,7 @@ if(APPLE)
rs.c
PROPERTIES
COMPILE_FLAGS -fno-common)
endif(APPLE)
endif()
include_directories(
${OPENJPEG_SOURCE_DIR}/libopenjpeg
@ -18,12 +18,12 @@ include_directories(
if(WIN32)
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else(BUILD_SHARED_LIBS)
else()
add_definitions(-DOPJ_STATIC)
endif(BUILD_SHARED_LIBS)
endif(WIN32)
endif()
endif()
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})
# Install library

View File

@ -6,7 +6,7 @@ includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@
Name: openjpeg
Description: JPEG2000 files library
URL: http://www.openjpeg.org/
URL: http://www.openjpeg.org/
Version: @OPENJPEG_VERSION@
Libs: -L${libdir} -lopenjpeg
Cflags: -I${includedir}

View File

@ -30,7 +30,7 @@ if(ZLIB_FOUND AND APPLE)
target_link_libraries(comparePGXimages z)
ELSe(ZLIB_FOUND AND APPLE)
target_link_libraries(comparePGXimages ${Z_LIBNAME})
endif(ZLIB_FOUND AND APPLE)
endif()
add_executable(compare_dump_files ${compare_dump_files_SRCS})
@ -62,8 +62,8 @@ set_property(TEST ttd2 APPEND PROPERTY DEPENDS tte2)
# No image send to the dashboard if lib PNG is not available.
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)")
endif(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)")
endif()
add_subdirectory(conformance)
add_subdirectory(nonregression)
@ -76,5 +76,5 @@ if(BUILD_JPIP)
set(md5 "62b00c620fb0a600c5ffd413cada4674")
add_test(TestJPIP1 ${CMAKE_COMMAND} -DD_URL:STRING=${s} -DD_FILE:PATH=${p}
-DEXPECTED_MD5=${md5} -P ${PROJECT_SOURCE_DIR}/CMake/JPIPTestDriver.cmake)
endif(JPIP_SERVER)
endif(BUILD_JPIP)
endif()
endif()

View File

@ -8,7 +8,7 @@ set(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression)
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( 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")
@ -27,35 +27,35 @@ 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_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
if(${numFileC0P0} LESS 10)
set( filenameInput p0_0${numFileC0P0}.j2k )
set( filenameRef c0p0_0${numFileC0P0}.pgx )
else(${numFileC0P0} LESS 10)
else()
set( filenameInput p0_${numFileC0P0}.j2k )
set( filenameRef c0p0_${numFileC0P0}.pgx )
endif(${numFileC0P0} LESS 10)
endif()
# Get corresponding tests parameters
list(GET C0P0_ResFactor_list ${numFileC0P0} ResFactor)
list(GET CP0_nbC_list ${numFileC0P0} nbComponents)
list(GET C0P0_PEAK_list ${numFileC0P0} PEAK_limit)
list(GET C0P0_MSE_list ${numFileC0P0} MSE_limit)
# Manage cases which need to try different resolution reduction
if (numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15)
get_filename_component(filenameRefSub ${filenameRef} NAME_WE)
#r = 0
add_test(ETS-C0P0-${filenameInput}-r0-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
add_test(ETS-C0P0-${filenameInput}-r0-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}-r0.pgx
-r 0
)
add_test(ETS-C0P0-${filenameInput}-r0-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRefSub}r0.pgx
@ -65,32 +65,32 @@ foreach(numFileC0P0 RANGE 1 16)
-m ${MSE_limit}
-s t_
)
set_tests_properties(ETS-C0P0-${filenameInput}-r0-compare2ref
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r0-decode)
set_tests_properties(ETS-C0P0-${filenameInput}-r0-compare2ref
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r0-decode)
add_test(NR-C0P0-${filenameInput}-r0-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRefSub}-r0.pgx
-t ${TEMP}/c0${filenameInput}-r0.pgx
-n ${nbComponents}
-d
-d
-s b_t_
)
set_tests_properties(NR-C0P0-${filenameInput}-r0-compare2base
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r0-decode)
set_tests_properties(NR-C0P0-${filenameInput}-r0-compare2base
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r0-decode)
#r = 1
add_test(ETS-C0P0-${filenameInput}-r1-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}-r1.pgx
-r 1
)
add_test(ETS-C0P0-${filenameInput}-r1-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRefSub}r1.pgx
@ -100,33 +100,33 @@ foreach(numFileC0P0 RANGE 1 16)
-m ${MSE_limit}
-s t_
)
set_tests_properties(ETS-C0P0-${filenameInput}-r1-compare2ref
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r1-decode)
set_tests_properties(ETS-C0P0-${filenameInput}-r1-compare2ref
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r1-decode)
add_test(NR-C0P0-${filenameInput}-r1-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRefSub}-r1.pgx
-t ${TEMP}/c0${filenameInput}-r1.pgx
-n ${nbComponents}
-d
-d
-s b_t_
)
set_tests_properties(NR-C0P0-${filenameInput}-r1-compare2base
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r1-decode)
else(numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15)
set_tests_properties(NR-C0P0-${filenameInput}-r1-compare2base
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r1-decode)
else()
add_test(ETS-C0P0-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}.pgx
-r ${ResFactor}
)
add_test(ETS-C0P0-${filenameInput}-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRef}
@ -136,27 +136,27 @@ foreach(numFileC0P0 RANGE 1 16)
-m ${MSE_limit}
-s t_
)
set_tests_properties(ETS-C0P0-${filenameInput}-compare2ref
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-decode)
set_tests_properties(ETS-C0P0-${filenameInput}-compare2ref
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-decode)
add_test(NR-C0P0-${filenameInput}-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRef}
-t ${TEMP}/c0${filenameInput}.pgx
-n ${nbComponents}
-d
-d
-s b_t_
)
set_tests_properties(NR-C0P0-${filenameInput}-compare2base
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-decode)
endif(numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15)
endforeach(numFileC0P0)
set_tests_properties(NR-C0P0-${filenameInput}-compare2base
PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-decode)
endif()
endforeach()
#--------------------------------------------------------------------------
# Tests about class 0 profile 1
@ -169,30 +169,30 @@ 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_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
set( filenameInput p1_0${numFileC0P1}.j2k )
set( filenameRef c0p1_0${numFileC0P1}.pgx )
# Get corresponding tests parameters
# Get corresponding tests parameters
list(GET C0P1_ResFactor_list ${numFileC0P1} ResFactor)
list(GET CP1_nbC_list ${numFileC0P1} nbComponents)
list(GET C0P1_PEAK_list ${numFileC0P1} PEAK_limit)
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
if (numFileC0P1 EQUAL 4 )
get_filename_component(filenameRefSub ${filenameRef} NAME_WE)
#r = 0
add_test(ETS-C0P1-${filenameInput}-r0-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
add_test(ETS-C0P1-${filenameInput}-r0-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}-r0.pgx
-r 0
)
add_test(ETS-C0P1-${filenameInput}-r0-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRefSub}r0.pgx
@ -202,32 +202,32 @@ foreach(numFileC0P1 RANGE 1 7)
-m ${MSE_limit}
-s t_
)
set_tests_properties(ETS-C0P1-${filenameInput}-r0-compare2ref
PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r0-decode)
set_tests_properties(ETS-C0P1-${filenameInput}-r0-compare2ref
PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r0-decode)
add_test(NR-C0P1-${filenameInput}-r0-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRefSub}-r0.pgx
-t ${TEMP}/c0${filenameInput}-r0.pgx
-n ${nbComponents}
-d
-d
-s b_t_
)
set_tests_properties(NR-C0P1-${filenameInput}-r0-compare2base
PROPERTIES DEPENDS
set_tests_properties(NR-C0P1-${filenameInput}-r0-compare2base
PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r0-decode)
#r = 3
add_test(ETS-C0P1-${filenameInput}-r3-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}-r3.pgx
-r 3
)
add_test(ETS-C0P1-${filenameInput}-r3-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRefSub}r3.pgx
@ -237,33 +237,33 @@ foreach(numFileC0P1 RANGE 1 7)
-m ${MSE_limit}
-s t_
)
set_tests_properties(ETS-C0P1-${filenameInput}-r3-compare2ref
PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r3-decode)
set_tests_properties(ETS-C0P1-${filenameInput}-r3-compare2ref
PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r3-decode)
add_test(NR-C0P1-${filenameInput}-r3-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRefSub}-r3.pgx
-t ${TEMP}/c0${filenameInput}-r3.pgx
-n ${nbComponents}
-d
-d
-s b_t_
)
set_tests_properties(NR-C0P1-${filenameInput}-r3-compare2base
PROPERTIES DEPENDS
set_tests_properties(NR-C0P1-${filenameInput}-r3-compare2base
PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r3-decode)
else(numFileC0P1 EQUAL 4)
else()
add_test(ETS-C0P1-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c0${filenameInput}.pgx
-r ${ResFactor}
)
add_test(ETS-C0P1-${filenameInput}-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRef}
@ -273,27 +273,27 @@ foreach(numFileC0P1 RANGE 1 7)
-m ${MSE_limit}
-s t_
)
set_tests_properties(ETS-C0P1-${filenameInput}-compare2ref
PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-decode)
set_tests_properties(ETS-C0P1-${filenameInput}-compare2ref
PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-decode)
add_test(NR-C0P1-${filenameInput}-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRef}
-t ${TEMP}/c0${filenameInput}.pgx
-n ${nbComponents}
-d
-d
-s b_t_
)
set_tests_properties(NR-C0P1-${filenameInput}-compare2base
PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-decode)
endif(numFileC0P1 EQUAL 4)
endforeach(numFileC0P1)
set_tests_properties(NR-C0P1-${filenameInput}-compare2base
PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-decode)
endif()
endforeach()
#--------------------------------------------------------------------------
# Tests about class 1 profile 0
@ -306,30 +306,30 @@ 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_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
if(${numFileC1P0} LESS 10)
set( filenameInput p0_0${numFileC1P0}.j2k )
set( filenameRef c1p0_0${numFileC1P0}.pgx )
else(${numFileC1P0} LESS 10)
else()
set( filenameInput p0_${numFileC1P0}.j2k )
set( filenameRef c1p0_${numFileC1P0}.pgx )
endif(${numFileC1P0} LESS 10)
# Get corresponding tests parameters
endif()
# Get corresponding tests parameters
list(GET CP0_nbC_list ${numFileC1P0} nbComponents)
list(GET C1P0_ResFactor_list ${numFileC1P0} ResFactor)
list(GET C1P0_PEAK_list ${numFileC1P0} PEAK_limit)
list(GET C1P0_MSE_list ${numFileC1P0} MSE_limit)
add_test(ETS-C1P0-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c1${filenameInput}.pgx
-r ${ResFactor}
)
add_test(ETS-C1P0-${filenameInput}-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRef}
@ -339,25 +339,25 @@ foreach(numFileC1P0 RANGE 1 16)
-m ${MSE_limit}
-s b_t_
)
set_tests_properties(ETS-C1P0-${filenameInput}-compare2ref
PROPERTIES DEPENDS
ETS-C1P0-${filenameInput}-decode)
set_tests_properties(ETS-C1P0-${filenameInput}-compare2ref
PROPERTIES DEPENDS
ETS-C1P0-${filenameInput}-decode)
add_test(NR-C1P0-${filenameInput}-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRef}
-t ${TEMP}/c1${filenameInput}.pgx
-n ${nbComponents}
-d
-d
-s b_t_
)
set_tests_properties(NR-C1P0-${filenameInput}-compare2base
PROPERTIES DEPENDS
set_tests_properties(NR-C1P0-${filenameInput}-compare2base
PROPERTIES DEPENDS
ETS-C1P0-${filenameInput}-decode)
endforeach(numFileC1P0)
endforeach()
#--------------------------------------------------------------------------
# Tests about class 1 profile 1
@ -369,24 +369,24 @@ endforeach(numFileC1P0)
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")
foreach(numFileC1P1 RANGE 1 7)
foreach(numFileC1P1 RANGE 1 7)
# Build filenames
set( filenameInput p1_0${numFileC1P1}.j2k )
set( filenameRef c1p1_0${numFileC1P1}.pgx )
# Get corresponding tests parameters
list(GET CP1_nbC_list ${numFileC1P1} nbComponents)
list(GET C1P1_PEAK_list ${numFileC1P1} PEAK_limit)
list(GET C1P1_MSE_list ${numFileC1P1} MSE_limit)
add_test(ETS-C1P1-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/c1${filenameInput}.pgx
-r 0
)
add_test(ETS-C1P1-${filenameInput}-compare2ref
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_CONF}/${filenameRef}
@ -396,25 +396,25 @@ foreach(numFileC1P1 RANGE 1 7)
-m ${MSE_limit}
-s b_t_
)
set_tests_properties(ETS-C1P1-${filenameInput}-compare2ref
PROPERTIES DEPENDS
set_tests_properties(ETS-C1P1-${filenameInput}-compare2ref
PROPERTIES DEPENDS
ETS-C1P1-${filenameInput}-decode)
add_test(NR-C1P1-${filenameInput}-compare2base
${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
-b ${BASELINE_NR}/opj_${filenameRef}
-t ${TEMP}/c1${filenameInput}.pgx
-n ${nbComponents}
-d
-d
-s b_t_
)
set_tests_properties(NR-C1P1-${filenameInput}-compare2base
PROPERTIES DEPENDS
set_tests_properties(NR-C1P1-${filenameInput}-compare2base
PROPERTIES DEPENDS
ETS-C1P1-${filenameInput}-decode)
endforeach(numFileC1P1)
endforeach()
#--------------------------------------------------------------------------
# Tests about JP2 file
@ -424,46 +424,46 @@ endforeach(numFileC1P1)
# Tolerances given by Table G.1
foreach(numFileJP2 RANGE 1 9)
foreach(numFileJP2 RANGE 1 9)
# Build filenames
set( filenameInput "file${numFileJP2}.jp2" )
set( filenameRef jp2_${numFileJP2}.tif )
# Get corresponding tests parameters
list(GET JP2_PEAK_list ${numFileJP2} PEAK_limit)
add_test(ETS-JP2-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/${filenameInput}.tif
)
#
# FIXME: Need to implement a compare tif images function
#
#
# add_test(ETS-JP2-${filenameInput}-compare2ref
# ${EXECUTABLE_OUTPUT_PATH}/compareTIFimages
# -b ${BASELINE_CONF}/${filenameRef_tif}
# -t ${TEMP}/${filenameInput}.pgx
# -p 4
# )
#
# set_tests_properties(ETS-JP2-${filenameInput}-compare2ref
# PROPERTIES DEPENDS
#
# set_tests_properties(ETS-JP2-${filenameInput}-compare2ref
# PROPERTIES DEPENDS
# ETS-JP2-${filenameInput}-decode)
#
#
# add_test(NR-JP2-${filenameInput}-compare2base
# ${EXECUTABLE_OUTPUT_PATH}/compareTIFimages
# -b ${BASELINE_NR}/opj_${filenameRef}
# -t ${TEMP}/${filenameInput}.tif
# -d
# -d
# )
#
# set_tests_properties(NR-JP2-${filenameInput}-compare2base
# PROPERTIES DEPENDS
#
# set_tests_properties(NR-JP2-${filenameInput}-compare2base
# PROPERTIES DEPENDS
# ETS-JP2-${filenameInput}-decode)
endforeach(numFileJP2)
endforeach()
#--------------------------------------------------------------------------#
#--------------------------------------------------------------------------#
@ -474,14 +474,14 @@ endforeach(numFileJP2)
# try to dump image and codestream informations into a file
# non regression comparison this file to the baseline
foreach(numFileP0 RANGE 1 16)
foreach(numFileP0 RANGE 1 16)
# Build filenames
if(${numFileP0} LESS 10)
set( filenameInput p0_0${numFileP0}.j2k )
else(${numFileP0} LESS 10)
else()
set( filenameInput p0_${numFileP0}.j2k )
endif(${numFileP0} LESS 10)
endif()
get_filename_component(filenameRefSub ${filenameInput} NAME_WE)
@ -490,25 +490,25 @@ foreach(numFileP0 RANGE 1 16)
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/${filenameInput}.txt
)
add_test(NR-${filenameInput}-compare_dump2base
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
-b ${BASELINE_NR}/opj_v2_${filenameRefSub}.txt
-t ${TEMP}/${filenameInput}.txt
)
set_tests_properties(NR-${filenameInput}-compare_dump2base
PROPERTIES DEPENDS
set_tests_properties(NR-${filenameInput}-compare_dump2base
PROPERTIES DEPENDS
NR-${filenameInput}-dump)
endforeach(numFileP0)
endforeach()
#--------------------------------------------------------------------------
# Tests about dump of profile 1 file
# try to dump image and codestream informations into a file
# non regression comparison this file to the baseline
foreach(numFileP1 RANGE 1 7)
foreach(numFileP1 RANGE 1 7)
# Build filenames
set( filenameInput p1_0${numFileP1}.j2k )
@ -519,25 +519,25 @@ foreach(numFileP1 RANGE 1 7)
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/${filenameInput}.txt
)
add_test(NR-${filenameInput}-compare_dump2base
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
-b ${BASELINE_NR}/opj_v2_${filenameInputSub}.txt
-t ${TEMP}/${filenameInput}.txt
)
set_tests_properties(NR-${filenameInput}-compare_dump2base
PROPERTIES DEPENDS
NR-${filenameInput}-dump)
endforeach(numFileP1)
PROPERTIES DEPENDS
NR-${filenameInput}-dump)
endforeach()
#--------------------------------------------------------------------------
# Tests about dump of JP2 file
# try to dump image and codestream informations into a file
# non regression comparison this file to the baseline
foreach(numFileJP2 RANGE 1 9)
foreach(numFileJP2 RANGE 1 9)
# Build filenames
set( filenameInput "file${numFileJP2}.jp2" )
@ -548,15 +548,15 @@ foreach(numFileJP2 RANGE 1 9)
-i ${INPUT_CONF}/${filenameInput}
-o ${TEMP}/${filenameInput}.txt
)
add_test(NR-${filenameInput}-compare_dump2base
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
-b ${BASELINE_NR}/opj_v2_${filenameInputSub}.txt
-t ${TEMP}/${filenameInput}.txt
)
set_tests_properties(NR-${filenameInput}-compare_dump2base
PROPERTIES DEPENDS
NR-${filenameInput}-dump)
endforeach(numFileJP2)
PROPERTIES DEPENDS
NR-${filenameInput}-dump)
endforeach()

View File

@ -19,7 +19,7 @@ find_package(KAKADU)
# Dump all files with the selected extension inside the input directory
# Define a list of file which should be gracefully rejected:
set(BLACKLIST_JPEG2000
set(BLACKLIST_JPEG2000
empty
)
@ -29,12 +29,12 @@ file(GLOB_RECURSE OPJ_DATA_NR_LIST
"${INPUT_NR}/*.jp2"
#"${INPUT_NR}/*.jpx"
)
foreach(INPUT_FILENAME ${OPJ_DATA_NR_LIST})
get_filename_component(INPUT_FILENAME_NAME ${INPUT_FILENAME} NAME)
get_filename_component(INPUT_FILENAME_NAME_WE ${INPUT_FILENAME_NAME} NAME_WE)
string(REGEX MATCH ${INPUT_FILENAME_NAME} bad_jpeg2000 ${BLACKLIST_JPEG2000})
# Dump the input image
add_test(NR-${INPUT_FILENAME_NAME}-dump
${EXECUTABLE_OUTPUT_PATH}/j2k_dump
@ -42,31 +42,31 @@ foreach(INPUT_FILENAME ${OPJ_DATA_NR_LIST})
-o ${TEMP}/${INPUT_FILENAME_NAME}.txt
-v
)
if(bad_jpeg2000)
set_tests_properties(NR-${INPUT_FILENAME_NAME}-dump
PROPERTIES WILL_FAIL TRUE)
else(bad_jpeg2000)
else()
# Compare the dump output with the baseline
add_test(NR-${INPUT_FILENAME_NAME}-compare_dump2base
${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
)
set_tests_properties(NR-${INPUT_FILENAME_NAME}-compare_dump2base
PROPERTIES DEPENDS
NR-${INPUT_FILENAME_NAME}-dump)
endif(bad_jpeg2000)
endif()
endforeach(INPUT_FILENAME)
endforeach()
#########################################################################
# GENERATION OF THE TEST SUITE (DECODE AND ENCODE)
# Read one and more input file(s) (located in ${OPJ_DATA_ROOT}/input/nonregression)
# Read one and more input file(s) (located in ${OPJ_DATA_ROOT}/input/nonregression)
# to know which files processed and with which options.
# Configure the test suite file:
@ -81,13 +81,13 @@ file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/test_suite.ctest OPJ_TEST_CMD_LINE_LIST
file(GLOB TEST_SUITE_FILES *.ctest.in)
if (TEST_SUITE_FILES)
foreach(TEST_SUITE_FILE ${TEST_SUITE_FILES})
# Avoid to process the official test suite
set(FILE_ALREADY_READ 0)
get_filename_component(TEST_SUITE_FILENAME ${TEST_SUITE_FILE} NAME)
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:
get_filename_component(TEST_SUITE_FILE_SUB ${TEST_SUITE_FILE} NAME_WE)
configure_file("${TEST_SUITE_FILE}"
@ -96,17 +96,17 @@ if (TEST_SUITE_FILES)
# Read the additional file into a list
file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/${TEST_SUITE_FILE_SUB}.ctest OPJ_TEST_CMD_LINE_LIST_TEMP)
# Append the list of command
set(OPJ_TEST_CMD_LINE_LIST ${OPJ_TEST_CMD_LINE_LIST} ${OPJ_TEST_CMD_LINE_LIST_TEMP})
endif(NOT FILE_ALREADY_READ)
set(OPJ_TEST_CMD_LINE_LIST ${OPJ_TEST_CMD_LINE_LIST} ${OPJ_TEST_CMD_LINE_LIST_TEMP})
endforeach(TEST_SUITE_FILE)
else(TEST_SUITE_FILES)
endif()
endforeach()
else()
message(FATAL_ERROR "One test suite should be available (test_suite.ctest.in) !!!")
endif(TEST_SUITE_FILES)
endif()
# Parse the command line found in the file(s)
@ -121,137 +121,137 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
# Check if the first argument begin by the comment sign
list(GET CMD_ARG_LIST 0 EXE_NAME)
if(EXE_NAME)
string(REGEX MATCH "^#" IGNORE_LINE_FOUND ${EXE_NAME})
endif(EXE_NAME)
endif()
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}")
else(IGNORE_LINE_FOUND OR NOT EXE_NAME)
else()
# Check if the first argument begin by the failed sign
set(FAILED_TEST_FOUND 0)
string(REGEX MATCH "^!" FAILED_TEST_FOUND ${EXE_NAME})
if (FAILED_TEST_FOUND)
# 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)
string(REGEX MATCH "^!image_to_j2k$|^!j2k_to_image$" FAILED_TEST_FOUND_1 ${EXE_NAME})
if (FAILED_TEST_FOUND_1)
list(REMOVE_AT CMD_ARG_LIST 0)
else (FAILED_TEST_FOUND_1)
else ()
set(FAILED_TEST_FOUND_2 0)
list(GET CMD_ARG_LIST 1 EXE_NAME)
string(REGEX MATCH "^image_to_j2k$|^j2k_to_image$" FAILED_TEST_FOUND_2 ${EXE_NAME})
if (FAILED_TEST_FOUND_2)
list(REMOVE_AT CMD_ARG_LIST 0)
list(REMOVE_AT CMD_ARG_LIST 0)
else (FAILED_TEST_FOUND_2)
else ()
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_1)
else (FAILED_TEST_FOUND)
endif ()
endif ()
else ()
# 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})
if(EXE_NAME_FOUND)
string(REGEX MATCH "image_to_j2k" ENC_TEST_FOUND ${EXE_NAME})
else(EXE_NAME_FOUND)
else()
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()
list(REMOVE_AT CMD_ARG_LIST 0)
endif (FAILED_TEST_FOUND)
endif ()
# Parse the argument list to find the input filename and output filename
set(CMD_ARG_LIST_2 "")
set(ARG_POS 0)
set(INPUT_ARG_POS 0)
set(OUTPUT_ARG_POS 0)
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)
if(INPUT_ARG_FOUND)
set(INPUT_ARG_POS ${ARG_POS})
set(INPUT_ARG_FOUND 0)
endif(INPUT_ARG_FOUND)
endif()
string(COMPARE EQUAL ${CMD_ARG_ELT} "-o" OUTPUT_ARG_FOUND)
if(OUTPUT_ARG_FOUND)
set(OUTPUT_ARG_POS ${ARG_POS})
set(OUTPUT_ARG_FOUND 0)
endif(OUTPUT_ARG_FOUND)
endif()
list (APPEND CMD_ARG_LIST_2 ${CMD_ARG_ELT})
endforeach(CMD_ARG_ELT)
endforeach()
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_WE ${INPUT_FILENAME_NAME} NAME_WE)
list(GET CMD_ARG_LIST_2 ${OUTPUT_ARG_POS} OUTPUT_FILENAME)
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
#-----
# ENCODER TEST SUITE
if(ENC_TEST_FOUND)
math(EXPR IT_TEST_ENC "${IT_TEST_ENC}+1" )
# Encode an image into the jpeg2000 format
add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode
${EXECUTABLE_OUTPUT_PATH}/image_to_j2k
${CMD_ARG_LIST_2}
)
if(FAILED_TEST_FOUND)
set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode PROPERTIES WILL_FAIL TRUE)
else(FAILED_TEST_FOUND)
# Dump the encoding file
else()
# Dump the encoding file
add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump
${EXECUTABLE_OUTPUT_PATH}/j2k_dump
-i ${OUTPUT_FILENAME}
-o ${OUTPUT_FILENAME}-ENC-${IT_TEST_ENC}.txt
)
set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump
PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode)
# Compare the dump file with the baseline
PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode)
# Compare the dump file with the baseline
add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dump2base
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
-b ${BASELINE_NR}/opj_v2_${OUTPUT_FILENAME_NAME_WE}-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
PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump)
PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump)
# Decode the encoding file with kakadu expand command
if (KDU_EXPAND_EXECUTABLE)
add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref
@ -259,60 +259,60 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
-i ${OUTPUT_FILENAME}
-o ${OUTPUT_FILENAME}.raw
)
set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref
PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode)
# Compare the decoding file with baseline generated from the kdu_expand and baseline.j2k
PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode)
# 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
${EXECUTABLE_OUTPUT_PATH}/compareRAWimages
-b ${BASELINE_NR}/opj_${OUTPUT_FILENAME_NAME_WE}-ENC-${IT_TEST_ENC}.raw
-t ${OUTPUT_FILENAME}.raw
)
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)
endif()
endif(FAILED_TEST_FOUND)
endif()
# DECODER TEST SUITE
else(ENC_TEST_FOUND)
else()
math(EXPR IT_TEST_DEC "${IT_TEST_DEC}+1" )
# Decode the input image
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}
)
if(FAILED_TEST_FOUND)
set_tests_properties(NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-decode PROPERTIES WILL_FAIL TRUE)
else(FAILED_TEST_FOUND)
# FIXME: add a compare2base function base on raw which
# can output png diff files if necesary
else()
# FIXME: add a compare2base function base on raw which
# can output png diff files if necesary
# add_test(NR-${filename}-compare2base
# ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
# -b ${BASELINE_NR}/opj_${filenameRef}
# -t ${TEMP}/${filename}.pgx
# -n ${nbComponents}
# -d
# -d
# -s b_t_
# )
#
# set_tests_properties(NR-${filename}-compare2base
# PROPERTIES DEPENDS
# NR-${filename}-decode)
# set_tests_properties(NR-${filename}-compare2base
# PROPERTIES DEPENDS
# NR-${filename}-decode)
endif(FAILED_TEST_FOUND)
endif(ENC_TEST_FOUND)
endif(IGNORE_LINE_FOUND OR NOT EXE_NAME)
endif()
endforeach(OPJ_TEST_CMD_LINE)
endif()
endif()
endforeach()

View File

@ -1,4 +1,4 @@
# 3rd party libs
# 3rd party libs
#------------
# Try to find lib Z
@ -14,14 +14,14 @@ ELSE (BUILD_THIRDPARTY)
FIND_PACKAGE(ZLIB)
IF(ZLIB_FOUND)
SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
message(STATUS "Your system seems to have a Z lib available, we will use it to generate PNG lib")
message(STATUS "DEBUG: ${ZLIB_INCLUDE_DIRS} vs ${ZLIB_INCLUDE_DIR}")
ELSE (ZLIB_FOUND) # not found
message(STATUS "Z lib not found, activate BUILD_THIRDPARTY if you want build it (necessary to build libPNG)")
ENDIF(ZLIB_FOUND)
ENDIF(BUILD_THIRDPARTY)
ENDIF(BUILD_THIRDPARTY)
#------------
# Try to find lib PNG (which depends on zlib)
@ -41,26 +41,26 @@ ELSE (BUILD_THIRDPARTY)
SET(HAVE_PNG_H 1 PARENT_SCOPE)
SET(HAVE_LIBPNG 1 PARENT_SCOPE)
SET(PNG_LIBNAME ${PNG_LIBRARIES} PARENT_SCOPE)
SET(PNG_INCLUDE_DIRNAME ${PNG_PNG_INCLUDE_DIR} PARENT_SCOPE)
SET(PNG_INCLUDE_DIRNAME ${PNG_PNG_INCLUDE_DIR} PARENT_SCOPE)
ELSE(PNG_FOUND) # not found
SET(HAVE_PNG_H 0 PARENT_SCOPE)
SET(HAVE_LIBPNG 0 PARENT_SCOPE)
message(STATUS "PNG lib not found, activate BUILD_THIRDPARTY if you want build it")
ENDIF(PNG_FOUND)
ENDIF (ZLIB_FOUND)
ENDIF(BUILD_THIRDPARTY)
ENDIF(BUILD_THIRDPARTY)
#------------
# Try to find lib TIFF
IF(BUILD_THIRDPARTY)
# Try to build it
message(STATUS "We will build TIFF lib from thirdparty")
ADD_SUBDIRECTORY(libtiff)
SET(TIFF_LIBNAME tiff PARENT_SCOPE)
SET(TIFF_INCLUDE_DIRNAME
${OPENJPEG_SOURCE_DIR}/thirdparty/libtiff
${OPENJPEG_BINARY_DIR}/thirdparty/libtiff
SET(TIFF_INCLUDE_DIRNAME
${OPENJPEG_SOURCE_DIR}/thirdparty/libtiff
${OPENJPEG_BINARY_DIR}/thirdparty/libtiff
PARENT_SCOPE)
SET(HAVE_TIFF_H 1 PARENT_SCOPE)
SET(HAVE_LIBTIFF 1 PARENT_SCOPE)
@ -71,13 +71,13 @@ ELSE (BUILD_THIRDPARTY)
SET(HAVE_TIFF_H 1 PARENT_SCOPE)
SET(HAVE_LIBTIFF 1 PARENT_SCOPE)
SET(TIFF_LIBNAME ${TIFF_LIBRARIES} PARENT_SCOPE)
SET(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} PARENT_SCOPE)
SET(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} PARENT_SCOPE)
ELSE (TIFF_FOUND) # not found
SET(HAVE_TIFF_H 0 PARENT_SCOPE)
SET(HAVE_LIBTIFF 0 PARENT_SCOPE)
message(STATUS "TIFF lib not found, activate BUILD_THIRDPARTY if you want build it")
ENDIF(TIFF_FOUND)
ENDIF(BUILD_THIRDPARTY)
ENDIF(BUILD_THIRDPARTY)
#------------
# Try to find lib LCMS2 (or by default LCMS)
@ -99,20 +99,20 @@ ELSE (BUILD_THIRDPARTY)
SET(HAVE_LCMS2_H 1 PARENT_SCOPE)
SET(HAVE_LIBLCMS2 1 PARENT_SCOPE)
SET(LCMS_LIBNAME ${LCMS2_LIBRARIES} PARENT_SCOPE)
SET(LCMS_INCLUDE_DIRNAME ${LCMS2_INCLUDE_DIRS} PARENT_SCOPE)
SET(LCMS_INCLUDE_DIRNAME ${LCMS2_INCLUDE_DIRS} PARENT_SCOPE)
ELSE (LCMS2_FOUND) # not found lcms2
# try to find LCMS
FIND_PACKAGE(LCMS)
FIND_PACKAGE(LCMS)
IF(LCMS_FOUND)
message(STATUS "Your system seems to have a LCMS lib available, we will use it")
SET(HAVE_LCMS_H 1 PARENT_SCOPE)
SET(HAVE_LIBLCMS 1 PARENT_SCOPE)
SET(LCMS_LIBNAME ${LCMS_LIBRARIES} PARENT_SCOPE)
SET(LCMS_INCLUDE_DIRNAME ${LCMS_INCLUDE_DIRS} PARENT_SCOPE)
SET(LCMS_INCLUDE_DIRNAME ${LCMS_INCLUDE_DIRS} PARENT_SCOPE)
ELSE (LCMS_FOUND) # not found lcms
SET(HAVE_LCMS2_H 0 PARENT_SCOPE)
SET(HAVE_LIBLCMS2 0 PARENT_SCOPE)
message(STATUS "LCMS2 or LCMS lib not found, activate BUILD_THIRDPARTY if you want build it")
ENDIF (LCMS_FOUND)
ENDIF(LCMS2_FOUND)
ENDIF(BUILD_THIRDPARTY)
ENDIF(BUILD_THIRDPARTY)

View File

@ -7,7 +7,7 @@ INCLUDE_DIRECTORIES(
FILE(GLOB SRCS *.c)
FILE(GLOB HDRS *.h)
SET(EXT_HDRS
SET(EXT_HDRS
${OPENJPEG_SOURCE_DIR}/thirdparty/include/zlib.h
${OPENJPEG_SOURCE_DIR}/thirdparty/include/zconf.h
)
@ -23,7 +23,7 @@ ENDIF(MSVC)
TARGET_LINK_LIBRARIES(${LIBTARGET} ${Z_LIBNAME} ${M_LIBRARY})
#
SET_TARGET_PROPERTIES(${LIBTARGET}
PROPERTIES
PROPERTIES
OUTPUT_NAME "${LIBTARGET}"
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib)
#