From d5bb3b0039159a61c7e9b2ae157a7b6ec2c0aef5 Mon Sep 17 00:00:00 2001 From: Mickael Savinaud Date: Thu, 30 Aug 2012 17:14:39 +0000 Subject: [PATCH] =?UTF-8?q?[trunk]=20Convert=20CMake-language=20commands?= =?UTF-8?q?=20to=20lower=20case=20Ancient=20CMake=20versions=20required=20?= =?UTF-8?q?upper-case=20commands.=20=20Later=20command=20names=20became=20?= =?UTF-8?q?case-insensitive.=20=20Now=20the=20preferred=20style=20is=20low?= =?UTF-8?q?er-case.=20This=20also=20changes=20all=20the=20key=20words=20to?= =?UTF-8?q?=20lower=20case.=20The=20primary=20reason=20for=20changing=20ke?= =?UTF-8?q?y=20words=20is=20that=20all=20documentation=20for=20CMakeLists.?= =?UTF-8?q?txt=20now=20shows=20the=20key=20words=20as=20lower=20case.=20Ev?= =?UTF-8?q?en=20the=20printed=20=E2=80=9CMastering=20CMake=20v5=E2=80=9D?= =?UTF-8?q?=20uses=20lower=20case.=20Thanks=20to=20Hans=20Johnson?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMake/CTestCustom.cmake.in | 10 +- CMake/FindCPPCHECK.cmake | 4 +- CMake/FindFCGI.cmake | 22 +- CMake/FindKAKADU.cmake | 4 +- CMake/FindLCMS.cmake | 18 +- CMake/FindLCMS2.cmake | 18 +- CMake/OpenJPEGCPack.cmake | 46 ++-- CMake/OpenJPEGConfig.cmake.in | 18 +- CMake/TestLargeFiles.cmake | 78 +++--- CMakeLists.txt | 238 ++++++++--------- applications/CMakeLists.txt | 30 +-- applications/JavaOpenJPEG/CMakeLists.txt | 8 +- applications/OPJViewer/CMakeLists.txt | 16 +- applications/codec/CMakeLists.txt | 90 +++---- applications/jpip/CMakeLists.txt | 20 +- applications/jpip/libopenjpip/CMakeLists.txt | 34 +-- applications/jpip/util/CMakeLists.txt | 52 ++-- applications/mj2/CMakeLists.txt | 56 ++-- doc/CMakeLists.txt | 16 +- libopenjpeg/CMakeLists.txt | 40 +-- libopenjpeg/jpwl/CMakeLists.txt | 32 +-- tests/CMakeLists.txt | 82 +++--- tests/conformance/CMakeLists.txt | 244 +++++++++--------- tests/nonregression/CMakeLists.txt | 254 +++++++++---------- 24 files changed, 715 insertions(+), 715 deletions(-) diff --git a/CMake/CTestCustom.cmake.in b/CMake/CTestCustom.cmake.in index 487f8b99..d92f5ec5 100644 --- a/CMake/CTestCustom.cmake.in +++ b/CMake/CTestCustom.cmake.in @@ -8,11 +8,11 @@ # #---------------------------------------------------------------------- -SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000) -SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50) -SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000) +set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000) +set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50) +set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000) -SET(CTEST_CUSTOM_COVERAGE_EXCLUDE +set(CTEST_CUSTOM_COVERAGE_EXCLUDE ${CTEST_CUSTOM_COVERAGE_EXCLUDE} # Exclude files from the Testing directories @@ -22,7 +22,7 @@ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE ".*/thirdparty/.*" ) -SET(CTEST_CUSTOM_WARNING_EXCEPTION +set(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} # Suppress warning caused by intentional messages about deprecation diff --git a/CMake/FindCPPCHECK.cmake b/CMake/FindCPPCHECK.cmake index 0db297db..6e11bf73 100644 --- a/CMake/FindCPPCHECK.cmake +++ b/CMake/FindCPPCHECK.cmake @@ -7,10 +7,10 @@ # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # -FIND_PROGRAM(CPPCHECK_EXECUTABLE +find_program(CPPCHECK_EXECUTABLE cppcheck ) -MARK_AS_ADVANCED( +mark_as_advanced( CPPCHECK_EXECUTABLE ) diff --git a/CMake/FindFCGI.cmake b/CMake/FindFCGI.cmake index e387bfaa..f7d762af 100644 --- a/CMake/FindFCGI.cmake +++ b/CMake/FindFCGI.cmake @@ -1,20 +1,20 @@ # 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. -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. -INCLUDE(FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(FCGI DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR) # Copy the results to the output variables. -IF(FCGI_FOUND) - SET(FCGI_LIBRARIES ${FCGI_LIBRARY}) - SET(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR}) -ELSE(FCGI_FOUND) - SET(FCGI_LIBRARIES) - SET(FCGI_INCLUDE_DIRS) -ENDIF(FCGI_FOUND) +if(FCGI_FOUND) + set(FCGI_LIBRARIES ${FCGI_LIBRARY}) + set(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR}) +else(FCGI_FOUND) + set(FCGI_LIBRARIES) + set(FCGI_INCLUDE_DIRS) +endif(FCGI_FOUND) -MARK_AS_ADVANCED(FCGI_INCLUDE_DIR FCGI_LIBRARY) +mark_as_advanced(FCGI_INCLUDE_DIR FCGI_LIBRARY) diff --git a/CMake/FindKAKADU.cmake b/CMake/FindKAKADU.cmake index 763304d6..3e0409df 100644 --- a/CMake/FindKAKADU.cmake +++ b/CMake/FindKAKADU.cmake @@ -10,10 +10,10 @@ # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # -FIND_PROGRAM(KDU_EXPAND_EXECUTABLE +find_program(KDU_EXPAND_EXECUTABLE kdu_expand ) -MARK_AS_ADVANCED( +mark_as_advanced( KDU_EXPAND_EXECUTABLE ) diff --git a/CMake/FindLCMS.cmake b/CMake/FindLCMS.cmake index 1a476a4a..2853a0f1 100644 --- a/CMake/FindLCMS.cmake +++ b/CMake/FindLCMS.cmake @@ -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 # all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS DEFAULT_MSG LCMS_LIBRARY LCMS_INCLUDE_DIR) -IF(LCMS_FOUND) - SET( LCMS_INCLUDE_DIRS ${LCMS_INCLUDE_DIR}) - SET( LCMS_LIBRARIES ${LCMS_LIBRARY} ) -ENDIF(LCMS_FOUND) +if(LCMS_FOUND) + set( LCMS_INCLUDE_DIRS ${LCMS_INCLUDE_DIR}) + set( LCMS_LIBRARIES ${LCMS_LIBRARY} ) +endif(LCMS_FOUND) diff --git a/CMake/FindLCMS2.cmake b/CMake/FindLCMS2.cmake index b781d84c..1a0053af 100644 --- a/CMake/FindLCMS2.cmake +++ b/CMake/FindLCMS2.cmake @@ -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 # all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR) -IF(LCMS2_FOUND) - SET( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR}) - SET( LCMS2_LIBRARIES ${LCMS2_LIBRARY} ) -ENDIF(LCMS2_FOUND) +if(LCMS2_FOUND) + set( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR}) + set( LCMS2_LIBRARIES ${LCMS2_LIBRARY} ) +endif(LCMS2_FOUND) diff --git a/CMake/OpenJPEGCPack.cmake b/CMake/OpenJPEGCPack.cmake index b7f2ba37..b8cc8e01 100644 --- a/CMake/OpenJPEGCPack.cmake +++ b/CMake/OpenJPEGCPack.cmake @@ -28,41 +28,41 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") # Make this explicit here, rather than accepting the CPack default value, # 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 # cygwin is good for the system name - IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") - SET(CPACK_SYSTEM_NAME Cygwin) - ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") - SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) - ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") - ENDIF(NOT DEFINED CPACK_SYSTEM_NAME) - IF(${CPACK_SYSTEM_NAME} MATCHES Windows) - IF(CMAKE_CL_64) - SET(CPACK_SYSTEM_NAME win64-x64) - ELSE(CMAKE_CL_64) - SET(CPACK_SYSTEM_NAME win32-x86) - ENDIF(CMAKE_CL_64) - ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") + set(CPACK_SYSTEM_NAME Cygwin) + else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") + set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) + endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") + endif(NOT DEFINED CPACK_SYSTEM_NAME) + if(${CPACK_SYSTEM_NAME} MATCHES Windows) + if(CMAKE_CL_64) + set(CPACK_SYSTEM_NAME win64-x64) + else(CMAKE_CL_64) + set(CPACK_SYSTEM_NAME win32-x86) + endif(CMAKE_CL_64) + 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 # 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 + if(CYGWIN) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") + else(CYGWIN) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}") - ENDIF(CYGWIN) - ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) + endif(CYGWIN) + endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME) set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist ${CMAKE_CURRENT_BINARY_DIR}/opj.plist) - SET(CPACK_BUNDLE_PLIST + set(CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_BINARY_DIR}/opj.plist) #include(BundleUtilities) diff --git a/CMake/OpenJPEGConfig.cmake.in b/CMake/OpenJPEGConfig.cmake.in index 020ddfcc..62410cf4 100644 --- a/CMake/OpenJPEGConfig.cmake.in +++ b/CMake/OpenJPEGConfig.cmake.in @@ -6,21 +6,21 @@ # module to load OPENJPEG's settings for an external project. @OPENJPEG_CONFIG_INSTALL_ONLY@ # The OPENJPEG version number. -SET(OPENJPEG_MAJOR_VERSION "@OPENJPEG_VERSION_MAJOR@") -SET(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@") -SET(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@") +set(OPENJPEG_MAJOR_VERSION "@OPENJPEG_VERSION_MAJOR@") +set(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@") +set(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@") # The libraries. -SET(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARY_NAME@") +set(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARY_NAME@") # The CMake macros dir. -SET(OPENJPEG_CMAKE_DIR "@OPENJPEG_INSTALL_PACKAGE_DIR@") +set(OPENJPEG_CMAKE_DIR "@OPENJPEG_INSTALL_PACKAGE_DIR@") # The configuration options. -SET(OPENJPEG_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@") +set(OPENJPEG_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@") # 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) if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) @@ -32,7 +32,7 @@ if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) else(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake) # This is a build tree - SET( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@) + set( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@) include(${SELF_DIR}/OpenJPEGExports.cmake) @@ -44,5 +44,5 @@ endif(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake) # Backward compatible part: -SET(OPENJPEG_FOUND TRUE) +set(OPENJPEG_FOUND TRUE) diff --git a/CMake/TestLargeFiles.cmake b/CMake/TestLargeFiles.cmake index d6fd9a64..d12d5899 100644 --- a/CMake/TestLargeFiles.cmake +++ b/CMake/TestLargeFiles.cmake @@ -16,51 +16,51 @@ # by Julien Malik # -MACRO(OPJ_TEST_LARGE_FILES VARIABLE) - IF("${VARIABLE}" MATCHES "^${VARIABLE}$") +macro(OPJ_TEST_LARGE_FILES VARIABLE) + if("${VARIABLE}" MATCHES "^${VARIABLE}$") # 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 # (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 - TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}" + try_compile(FILE64_OK "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c") if(FILE64_OK) - MESSAGE(STATUS "Checking for 64-bit off_t - present") + message(STATUS "Checking for 64-bit off_t - present") endif(FILE64_OK) if(NOT FILE64_OK) # 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" COMPILE_DEFINITIONS "-D_FILE_OFFSET_BITS=64" ) 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) endif(FILE64_OK) endif(NOT FILE64_OK) if(NOT FILE64_OK) # Test with _LARGE_FILES - TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}" + try_compile(FILE64_OK "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c" COMPILE_DEFINITIONS "-D_LARGE_FILES" ) 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) endif(FILE64_OK) endif(NOT FILE64_OK) if(NOT FILE64_OK) # Test with _LARGEFILE_SOURCE - TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}" + try_compile(FILE64_OK "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c" COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" ) 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) endif(FILE64_OK) endif(NOT FILE64_OK) @@ -68,67 +68,67 @@ MACRO(OPJ_TEST_LARGE_FILES VARIABLE) #if(NOT FILE64_OK) # # 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") # 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) # endif(FILE64_OK) #endif(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) - 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(_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") + message(STATUS "Checking for fseeko/ftello") # Test if ftello/fseeko are available - TRY_COMPILE(FSEEKO_COMPILE_OK + 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) + if(FSEEKO_COMPILE_OK) + message(STATUS "Checking for fseeko/ftello - present") + 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...) - TRY_COMPILE(FSEEKO_COMPILE_OK + try_compile(FSEEKO_COMPILE_OK "${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) + 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) 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) - MESSAGE(STATUS "Checking for fseeko/ftello - not found") - SET(HAVE_FSEEKO OFF CACHE INTERNAL "Result of test for fseeko/ftello") + message(STATUS "Checking for fseeko/ftello - not found") + set(HAVE_FSEEKO OFF CACHE INTERNAL "Result of test for fseeko/ftello") endif(FSEEKO_COMPILE_OK) 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") + 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) - MESSAGE(STATUS "Large File support - not found") - SET(${VARIABLE} OFF CACHE INTERNAL "Result of test for large file support") + 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("${VARIABLE}" MATCHES "^${VARIABLE}$") -ENDMACRO(OPJ_TEST_LARGE_FILES VARIABLE) + endif("${VARIABLE}" MATCHES "^${VARIABLE}$") +endmacro(OPJ_TEST_LARGE_FILES VARIABLE) diff --git a/CMakeLists.txt b/CMakeLists.txt index af597a94..9e3a8144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,54 +6,54 @@ # 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 # e.g.: -# SET(OPENJPEG_NAMESPACE "GDCMOPENJPEG") -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +# set(OPENJPEG_NAMESPACE "GDCMOPENJPEG") +cmake_minimum_required(VERSION 2.6) -IF(COMMAND CMAKE_POLICY) - CMAKE_POLICY(SET CMP0003 NEW) -ENDIF(COMMAND CMAKE_POLICY) +if(COMMAND CMAKE_POLICY) + cmake_policy(SET CMP0003 NEW) +endif(COMMAND CMAKE_POLICY) -IF(NOT OPENJPEG_NAMESPACE) - SET(OPENJPEG_NAMESPACE "OPENJPEG") - SET(OPENJPEG_STANDALONE 1) -ENDIF(NOT OPENJPEG_NAMESPACE) +if(NOT OPENJPEG_NAMESPACE) + set(OPENJPEG_NAMESPACE "OPENJPEG") + set(OPENJPEG_STANDALONE 1) +endif(NOT OPENJPEG_NAMESPACE) # 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. -INCLUDE_REGULAR_EXPRESSION("^.*$") +include_regular_expression("^.*$") #----------------------------------------------------------------------------- # OPENJPEG version number, useful for packaging and doxygen doc: -SET(OPENJPEG_VERSION_MAJOR 1) -SET(OPENJPEG_VERSION_MINOR 99) -SET(OPENJPEG_VERSION_BUILD 0) -SET(OPENJPEG_VERSION +set(OPENJPEG_VERSION_MAJOR 1) +set(OPENJPEG_VERSION_MINOR 99) +set(OPENJPEG_VERSION_BUILD 0) +set(OPENJPEG_VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}") -SET(PACKAGE_VERSION +set(PACKAGE_VERSION "${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}" SOVERSION "${OPENJPEG_VERSION_MAJOR}" ) # -------------------------------------------------------------------------- # Path to additional CMake modules -SET(CMAKE_MODULE_PATH +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH}) # -------------------------------------------------------------------------- # On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security # warnings -IF(WIN32) - IF(NOT BORLAND) - IF(NOT CYGWIN) - IF(NOT MINGW) - IF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS) - ADD_DEFINITIONS( +if(WIN32) + if(NOT BORLAND) + if(NOT CYGWIN) + if(NOT MINGW) + if(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS) + add_definitions( -D_CRT_FAR_MAPPINGS_NO_DEPRECATE -D_CRT_IS_WCTYPE_NO_DEPRECATE -D_CRT_MANAGED_FP_NO_DEPRECATE @@ -65,62 +65,62 @@ 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(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS) + endif(NOT MINGW) + endif(NOT CYGWIN) + endif(NOT BORLAND) +endif(WIN32) # -------------------------------------------------------------------------- # Install directories -STRING(TOLOWER ${PROJECT_NAME} projectname) -SET(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}") +string(TOLOWER ${PROJECT_NAME} projectname) +set(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}") -IF(NOT OPENJPEG_INSTALL_BIN_DIR) - SET(OPENJPEG_INSTALL_BIN_DIR "bin") -ENDIF(NOT OPENJPEG_INSTALL_BIN_DIR) +if(NOT OPENJPEG_INSTALL_BIN_DIR) + set(OPENJPEG_INSTALL_BIN_DIR "bin") +endif(NOT OPENJPEG_INSTALL_BIN_DIR) -IF(NOT OPENJPEG_INSTALL_LIB_DIR) - SET(OPENJPEG_INSTALL_LIB_DIR "lib") -ENDIF(NOT OPENJPEG_INSTALL_LIB_DIR) +if(NOT OPENJPEG_INSTALL_LIB_DIR) + set(OPENJPEG_INSTALL_LIB_DIR "lib") +endif(NOT OPENJPEG_INSTALL_LIB_DIR) -IF(NOT OPENJPEG_INSTALL_SHARE_DIR) - SET(OPENJPEG_INSTALL_SHARE_DIR "share") -ENDIF(NOT OPENJPEG_INSTALL_SHARE_DIR) +if(NOT OPENJPEG_INSTALL_SHARE_DIR) + set(OPENJPEG_INSTALL_SHARE_DIR "share") +endif(NOT OPENJPEG_INSTALL_SHARE_DIR) -IF(NOT OPENJPEG_INSTALL_DATA_DIR) - SET(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}") -ENDIF(NOT OPENJPEG_INSTALL_DATA_DIR) +if(NOT OPENJPEG_INSTALL_DATA_DIR) + set(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}") +endif(NOT OPENJPEG_INSTALL_DATA_DIR) -IF(NOT OPENJPEG_INSTALL_INCLUDE_DIR) - SET(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}") -ENDIF(NOT OPENJPEG_INSTALL_INCLUDE_DIR) +if(NOT OPENJPEG_INSTALL_INCLUDE_DIR) + set(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}") +endif(NOT OPENJPEG_INSTALL_INCLUDE_DIR) -IF(NOT OPENJPEG_INSTALL_MAN_DIR) - SET(OPENJPEG_INSTALL_MAN_DIR "share/man/") -ENDIF(NOT OPENJPEG_INSTALL_MAN_DIR) +if(NOT OPENJPEG_INSTALL_MAN_DIR) + set(OPENJPEG_INSTALL_MAN_DIR "share/man/") +endif(NOT OPENJPEG_INSTALL_MAN_DIR) -IF(NOT OPENJPEG_INSTALL_DOC_DIR) - SET(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}") -ENDIF(NOT OPENJPEG_INSTALL_DOC_DIR) +if(NOT OPENJPEG_INSTALL_DOC_DIR) + set(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}") +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 # 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) + set(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}") +endif(NOT OPENJPEG_INSTALL_PACKAGE_DIR) #----------------------------------------------------------------------------- # Big endian test: -INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) +include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN) #----------------------------------------------------------------------------- # Setup file for setting custom ctest vars -CONFIGURE_FILE( +configure_file( ${CMAKE_SOURCE_DIR}/CMake/CTestCustom.cmake.in ${CMAKE_BINARY_DIR}/CTestCustom.cmake @ONLY @@ -128,46 +128,46 @@ CONFIGURE_FILE( #----------------------------------------------------------------------------- # OpenJPEG build configuration options. -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 (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) +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 (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) #----------------------------------------------------------------------------- # configure name mangling to allow multiple libraries to coexist # peacefully -IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) -SET(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME}) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) +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(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) #----------------------------------------------------------------------------- # pkgconfig support -IF(UNIX) +if(UNIX) # 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) - INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc DESTINATION + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc DESTINATION ${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\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_SHARE_DIR}/pkgconfig/libopenjpeg.pc\")") -ENDIF(UNIX) +endif(UNIX) #----------------------------------------------------------------------------- # Compiler specific flags: -IF(CMAKE_COMPILER_IS_GNUCC) +if(CMAKE_COMPILER_IS_GNUCC) # 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: - SET(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}") -ENDIF(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}") +endif(CMAKE_COMPILER_IS_GNUCC) #----------------------------------------------------------------------------- # 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("inttypes.h" HAVE_INTTYPES_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) # Enable Large file support -INCLUDE(TestLargeFiles) +include(TestLargeFiles) OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES) #----------------------------------------------------------------------------- # Build Library -INCLUDE_DIRECTORIES(BEFORE ${OPENJPEG_BINARY_DIR}) -ADD_SUBDIRECTORY(libopenjpeg) +include_directories(BEFORE ${OPENJPEG_BINARY_DIR}) +add_subdirectory(libopenjpeg) #----------------------------------------------------------------------------- # Build Applications -OPTION(BUILD_CODEC "Build the CODEC executables" ON) -OPTION(BUILD_MJ2 "Build the MJ2 executables." OFF) -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) -OPTION(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF) -OPTION(BUILD_JAVA "Build the openjpeg jar (Java)" OFF) -MARK_AS_ADVANCED(BUILD_VIEWER) -MARK_AS_ADVANCED(BUILD_JAVA) +option(BUILD_CODEC "Build the CODEC executables" ON) +option(BUILD_MJ2 "Build the MJ2 executables." OFF) +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) +option(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF) +option(BUILD_JAVA "Build the openjpeg jar (Java)" OFF) +mark_as_advanced(BUILD_VIEWER) +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 # ON: 3rd party libs will ALWAYS be build, and used - OPTION(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF) - ADD_SUBDIRECTORY(thirdparty) - ADD_SUBDIRECTORY(applications) -ENDIF (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) include(CheckTypeSize) CHECK_TYPE_SIZE(ssize_t SSIZE_T) #----------------------------------------------------------------------------- # 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" @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) #----------------------------------------------------------------------------- # Build DOCUMENTATION (not in ALL target and only if Doxygen is found) -OPTION(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF) -IF(BUILD_DOC) - ADD_SUBDIRECTORY(doc) -ENDIF(BUILD_DOC) +option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF) +if(BUILD_DOC) + add_subdirectory(doc) +endif(BUILD_DOC) #----------------------------------------------------------------------------- # Buld Testing -OPTION(BUILD_TESTING "Build the tests." OFF) -IF(BUILD_TESTING) - IF(BUILD_CODEC) - ENABLE_TESTING() - INCLUDE(CTest) +option(BUILD_TESTING "Build the tests." OFF) +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) - FIND_PATH(OPJ_DATA_ROOT README-OPJ-Data + find_path(OPJ_DATA_ROOT README-OPJ-Data PATHS $ENV{OPJ_DATA_ROOT} ${CMAKE_SOURCE_DIR}/../data ) # 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") - ENDIF(BUILD_CODEC) -ENDIF(BUILD_TESTING) + endif(BUILD_CODEC) +endif(BUILD_TESTING) #----------------------------------------------------------------------------- # install all targets referenced as OPENJPEGTargets -INSTALL(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR}) -CONFIGURE_FILE( ${OPENJPEG_SOURCE_DIR}/CMake/OpenJPEGConfig.cmake.in +install(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR}) +configure_file( ${OPENJPEG_SOURCE_DIR}/CMake/OpenJPEGConfig.cmake.in ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake @ONLY ) -INSTALL( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake +install( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR} ) #----------------------------------------------------------------------------- # install CHANGES and LICENSE -IF(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES) - INSTALL(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR}) -ENDIF(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES) -INSTALL(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR}) +if(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES) + install(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR}) +endif(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES) +install(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR}) -INCLUDE (CMake/OpenJPEGCPack.cmake) +include (CMake/OpenJPEGCPack.cmake) diff --git a/applications/CMakeLists.txt b/applications/CMakeLists.txt index a57c58d3..683fd7a3 100644 --- a/applications/CMakeLists.txt +++ b/applications/CMakeLists.txt @@ -1,22 +1,22 @@ # Build the each application if it needed -IF(BUILD_CODEC) - ADD_SUBDIRECTORY(codec) -ENDIF(BUILD_CODEC) +if(BUILD_CODEC) + add_subdirectory(codec) +endif(BUILD_CODEC) -IF(BUILD_MJ2) - ADD_SUBDIRECTORY(mj2) -ENDIF(BUILD_MJ2) +if(BUILD_MJ2) + add_subdirectory(mj2) +endif(BUILD_MJ2) # Client & Server: -IF(BUILD_JPIP) - ADD_SUBDIRECTORY(jpip) -ENDIF(BUILD_JPIP) +if(BUILD_JPIP) + add_subdirectory(jpip) +endif(BUILD_JPIP) -IF(BUILD_VIEWER) - ADD_SUBDIRECTORY(OPJViewer) -ENDIF(BUILD_VIEWER) +if(BUILD_VIEWER) + add_subdirectory(OPJViewer) +endif(BUILD_VIEWER) -IF(BUILD_JAVA) - ADD_SUBDIRECTORY(JavaOpenJPEG) -ENDIF(BUILD_JAVA) +if(BUILD_JAVA) + add_subdirectory(JavaOpenJPEG) +endif(BUILD_JAVA) diff --git a/applications/JavaOpenJPEG/CMakeLists.txt b/applications/JavaOpenJPEG/CMakeLists.txt index 2f4a481b..1b1c9ba1 100644 --- a/applications/JavaOpenJPEG/CMakeLists.txt +++ b/applications/JavaOpenJPEG/CMakeLists.txt @@ -1,7 +1,7 @@ #JavaOpenJPEG/CMakeLists.txt # First thing define the common source: -SET(openjpegjni_SRCS +set(openjpegjni_SRCS JavaOpenJPEGDecoder.c JavaOpenJPEG.c ) @@ -22,7 +22,7 @@ add_library(openjpegjni MODULE ) # build jar: -FIND_PACKAGE(Java 1.5 REQUIRED) # javac, jar +find_package(Java 1.5 REQUIRED) # javac, jar # build dep list: 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: file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes) # Build java -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${LIBRARY_OUTPUT_PATH}/openjpeg.jar COMMAND ${Java_JAVAC_EXECUTABLE} -sourcepath "${CMAKE_CURRENT_SOURCE_DIR}/java-sources" ${java_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes @@ -41,7 +41,7 @@ ADD_CUSTOM_COMMAND( ) # name the target -ADD_CUSTOM_TARGET(OpenJPEGJavaJar ALL +add_custom_target(OpenJPEGJavaJar ALL DEPENDS ${LIBRARY_OUTPUT_PATH}/openjpeg.jar COMMENT "building openjpeg.jar" ) diff --git a/applications/OPJViewer/CMakeLists.txt b/applications/OPJViewer/CMakeLists.txt index f382b14a..34442848 100644 --- a/applications/OPJViewer/CMakeLists.txt +++ b/applications/OPJViewer/CMakeLists.txt @@ -1,17 +1,17 @@ -PROJECT(viewer CXX) +project(viewer CXX) -FIND_PACKAGE(wxWidgets REQUIRED) -INCLUDE(${wxWidgets_USE_FILE}) +find_package(wxWidgets REQUIRED) +include(${wxWidgets_USE_FILE}) -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) # original flags: # -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") -SET(OPJV_SRCS +add_definitions(-DwxUSE_LIBOPENJPEG -DOPENJPEG_VERSION="1.5.0") +set(OPJV_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/source/imagjpeg2000.cpp ${CMAKE_CURRENT_SOURCE_DIR}/source/wxj2kparser.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}/../codec/index.c ) -ADD_EXECUTABLE(opjviewer ${OPJV_SRCS}) -TARGET_LINK_LIBRARIES(opjviewer ${wxWidgets_LIBRARIES} openjpeg) +add_executable(opjviewer ${OPJV_SRCS}) +target_link_libraries(opjviewer ${wxWidgets_LIBRARIES} openjpeg) diff --git a/applications/codec/CMakeLists.txt b/applications/codec/CMakeLists.txt index 2a195155..4c8918f9 100644 --- a/applications/codec/CMakeLists.txt +++ b/applications/codec/CMakeLists.txt @@ -1,7 +1,7 @@ # Build the demo app, small examples # First thing define the common source: -SET(common_SRCS +set(common_SRCS convert.c index.c ${OPENJPEG_SOURCE_DIR}/applications/common/color.c @@ -9,7 +9,7 @@ SET(common_SRCS ) # Headers file are located here: -INCLUDE_DIRECTORIES( +include_directories( ${OPENJPEG_SOURCE_DIR}/libopenjpeg ${LCMS_INCLUDE_DIRNAME} ${OPENJPEG_SOURCE_DIR}/applications/common @@ -18,96 +18,96 @@ INCLUDE_DIRECTORIES( ${TIFF_INCLUDE_DIRNAME} ) -IF(WIN32) - IF(BUILD_SHARED_LIBS) - ADD_DEFINITIONS(-DOPJ_EXPORTS) - ELSE(BUILD_SHARED_LIBS) - ADD_DEFINITIONS(-DOPJ_STATIC) - ENDIF(BUILD_SHARED_LIBS) -ENDIF(WIN32) +if(WIN32) + if(BUILD_SHARED_LIBS) + add_definitions(-DOPJ_EXPORTS) + else(BUILD_SHARED_LIBS) + add_definitions(-DOPJ_STATIC) + endif(BUILD_SHARED_LIBS) +endif(WIN32) # 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} +foreach(exe j2k_to_image image_to_j2k j2k_dump) + add_executable(${exe} ${exe}.c ${common_SRCS}) + target_link_libraries(${exe} ${OPENJPEG_LIBRARY_NAME} ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME} ) # To support universal exe: - IF(ZLIB_FOUND AND APPLE) - TARGET_LINK_LIBRARIES(${exe} z) + if(ZLIB_FOUND AND APPLE) + target_link_libraries(${exe} z) ELSe(ZLIB_FOUND AND APPLE) - TARGET_LINK_LIBRARIES(${exe} ${Z_LIBNAME}) - ENDIF(ZLIB_FOUND AND APPLE) + target_link_libraries(${exe} ${Z_LIBNAME}) + endif(ZLIB_FOUND AND APPLE) # On unix you need to link to the math library: - IF(UNIX) - TARGET_LINK_LIBRARIES(${exe} m) - ENDIF(UNIX) + if(UNIX) + target_link_libraries(${exe} m) + endif(UNIX) # Install exe - INSTALL(TARGETS ${exe} + install(TARGETS ${exe} EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications ) -ENDFOREACH(exe) +endforeach(exe) # Install man pages -INSTALL( +install( 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_to_image.1 DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1) # -IF(BUILD_JPWL) - ADD_EXECUTABLE(JPWL_j2k_to_image +if(BUILD_JPWL) + add_executable(JPWL_j2k_to_image j2k_to_image.c ${common_SRCS} ) - SET_PROPERTY( + set_property( TARGET JPWL_j2k_to_image 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}) # To support universal exe: - IF(ZLIB_FOUND AND APPLE) - TARGET_LINK_LIBRARIES(JPWL_j2k_to_image z) + 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) + target_link_libraries(JPWL_j2k_to_image ${Z_LIBNAME}) + endif(ZLIB_FOUND AND APPLE) - IF(UNIX) - TARGET_LINK_LIBRARIES(JPWL_j2k_to_image m) - ENDIF(UNIX) + if(UNIX) + target_link_libraries(JPWL_j2k_to_image m) + endif(UNIX) - ADD_EXECUTABLE(JPWL_image_to_j2k + add_executable(JPWL_image_to_j2k image_to_j2k.c ${common_SRCS} ) - SET_PROPERTY( + 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: - IF(ZLIB_FOUND AND APPLE) - TARGET_LINK_LIBRARIES(JPWL_image_to_j2k z) + if(ZLIB_FOUND AND APPLE) + 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) + target_link_libraries(JPWL_image_to_j2k ${Z_LIBNAME}) + endif(ZLIB_FOUND AND APPLE) - IF(UNIX) - TARGET_LINK_LIBRARIES(JPWL_image_to_j2k m) - ENDIF(UNIX) + if(UNIX) + target_link_libraries(JPWL_image_to_j2k m) + 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 ) -ENDIF(BUILD_JPWL) +endif(BUILD_JPWL) diff --git a/applications/jpip/CMakeLists.txt b/applications/jpip/CMakeLists.txt index 2ba76313..374f2dbf 100644 --- a/applications/jpip/CMakeLists.txt +++ b/applications/jpip/CMakeLists.txt @@ -1,16 +1,16 @@ # required dep for server: -IF(BUILD_JPIP_SERVER) - FIND_PACKAGE(CURL REQUIRED) - FIND_PACKAGE(FCGI REQUIRED) - 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) +if(BUILD_JPIP_SERVER) + find_package(CURL REQUIRED) + find_package(FCGI REQUIRED) + 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) # JPIP library: -ADD_SUBDIRECTORY(libopenjpip) +add_subdirectory(libopenjpip) # JPIP binaries: -ADD_SUBDIRECTORY(util) +add_subdirectory(util) diff --git a/applications/jpip/libopenjpip/CMakeLists.txt b/applications/jpip/libopenjpip/CMakeLists.txt index daa00f45..a945d18a 100644 --- a/applications/jpip/libopenjpip/CMakeLists.txt +++ b/applications/jpip/libopenjpip/CMakeLists.txt @@ -1,13 +1,13 @@ -INCLUDE_REGULAR_EXPRESSION("^.*$") +include_regular_expression("^.*$") -INCLUDE_DIRECTORIES( +include_directories( ${OPENJPEG_SOURCE_DIR}/libopenjpeg ${FCGI_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ) # Defines the source code for the library -SET(OPENJPIP_SRCS +set(OPENJPIP_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/boxheader_manager.c ${CMAKE_CURRENT_SOURCE_DIR}/codestream_manager.c ${CMAKE_CURRENT_SOURCE_DIR}/imgreg_manager.c @@ -34,11 +34,11 @@ SET(OPENJPIP_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/sock_manager.c ) -SET(SERVER_SRCS +set(SERVER_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/auxtrans_manager.c ) -SET(LOCAL_SRCS +set(LOCAL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/jp2k_decoder.c ${CMAKE_CURRENT_SOURCE_DIR}/imgsock_manager.c ${CMAKE_CURRENT_SOURCE_DIR}/jpipstream_manager.c @@ -47,26 +47,26 @@ SET(LOCAL_SRCS ) # Build the library -ADD_LIBRARY(openjpip_local STATIC ${OPENJPIP_SRCS} ${LOCAL_SRCS}) -TARGET_LINK_LIBRARIES(openjpip_local ${OPENJPEG_LIBRARY_NAME}) -IF(WIN32) +add_library(openjpip_local STATIC ${OPENJPIP_SRCS} ${LOCAL_SRCS}) +target_link_libraries(openjpip_local ${OPENJPEG_LIBRARY_NAME}) +if(WIN32) # add Winsock on windows+mingw - TARGET_LINK_LIBRARIES(openjpip_local ws2_32) -ENDIF(WIN32) + target_link_libraries(openjpip_local ws2_32) +endif(WIN32) # Install library -INSTALL(TARGETS openjpip_local +install(TARGETS openjpip_local EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries ) -IF(BUILD_JPIP_SERVER) - ADD_LIBRARY(openjpip_server STATIC ${OPENJPIP_SRCS} ${SERVER_SRCS}) - TARGET_LINK_LIBRARIES(openjpip_server ${FCGI_LIBRARIES} ${CURL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) - SET_TARGET_PROPERTIES(openjpip_server +if(BUILD_JPIP_SERVER) + add_library(openjpip_server STATIC ${OPENJPIP_SRCS} ${SERVER_SRCS}) + target_link_libraries(openjpip_server ${FCGI_LIBRARIES} ${CURL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + set_target_properties(openjpip_server PROPERTIES COMPILE_FLAGS "-DSERVER") - INSTALL(TARGETS openjpip_server + install(TARGETS openjpip_server EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries ) -ENDIF(BUILD_JPIP_SERVER) +endif(BUILD_JPIP_SERVER) diff --git a/applications/jpip/util/CMakeLists.txt b/applications/jpip/util/CMakeLists.txt index 2f2410dc..93e65240 100644 --- a/applications/jpip/util/CMakeLists.txt +++ b/applications/jpip/util/CMakeLists.txt @@ -1,62 +1,62 @@ # Headers file are located here: -INCLUDE_DIRECTORIES( +include_directories( ${OPENJPEG_SOURCE_DIR}/libopenjpeg # opj_stdint.h ${OPENJPEG_SOURCE_DIR}/applications/jpip/libopenjpip ${FCGI_INCLUDE_DIRS} ) # Tool to embed metadata into JP2 file -ADD_EXECUTABLE(addXMLinJP2 addXMLinJP2.c) +add_executable(addXMLinJP2 addXMLinJP2.c) # Install exe -INSTALL(TARGETS addXMLinJP2 +install(TARGETS addXMLinJP2 EXPORT OpenJPEGTargets 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 ) # Build executable - ADD_EXECUTABLE(opj_server ${OPJ_SERVER_SRCS}) - TARGET_LINK_LIBRARIES(opj_server openjpip_server) - SET_PROPERTY( + add_executable(opj_server ${OPJ_SERVER_SRCS}) + target_link_libraries(opj_server openjpip_server) + set_property( TARGET opj_server APPEND PROPERTY COMPILE_DEFINITIONS SERVER QUIT_SIGNAL="quitJPIP" ) # On unix you need to link to the math library: - IF(UNIX) - TARGET_LINK_LIBRARIES(opj_server m) - ENDIF(UNIX) + if(UNIX) + target_link_libraries(opj_server m) + endif(UNIX) # Install exe - INSTALL(TARGETS opj_server + install(TARGETS opj_server EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications ) -ENDIF(BUILD_JPIP_SERVER) +endif(BUILD_JPIP_SERVER) -SET(EXES +set(EXES opj_dec_server jpip_to_jp2 jpip_to_j2k test_index ) -FOREACH(exe ${EXES}) - ADD_EXECUTABLE(${exe} ${exe}.c) - TARGET_LINK_LIBRARIES(${exe} openjpip_local) - INSTALL(TARGETS ${exe} +foreach(exe ${EXES}) + add_executable(${exe} ${exe}.c) + target_link_libraries(${exe} openjpip_local) + install(TARGETS ${exe} EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications ) -ENDFOREACH(exe) +endforeach(exe) # 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: 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: file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes1) # Build java - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags} ${java1_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes1 @@ -81,12 +81,12 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE) ) # name the target - ADD_CUSTOM_TARGET(OPJViewerJar ALL + add_custom_target(OPJViewerJar ALL DEPENDS ${LIBRARY_OUTPUT_PATH}/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 ) @@ -122,7 +122,7 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE) # make sure target javac dir exists: file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes2) # Build java - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags} -classpath ${APACHE_XERCES_JAR} @@ -136,12 +136,12 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE) ) # name the target - ADD_CUSTOM_TARGET(OPJViewerXercesJar ALL + add_custom_target(OPJViewerXercesJar ALL DEPENDS ${LIBRARY_OUTPUT_PATH}/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 ) endif() diff --git a/applications/mj2/CMakeLists.txt b/applications/mj2/CMakeLists.txt index e96ada3c..57648ee0 100644 --- a/applications/mj2/CMakeLists.txt +++ b/applications/mj2/CMakeLists.txt @@ -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 -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. -SET(OPJ_SRCS +set(OPJ_SRCS ${OPENJPEG_SOURCE_DIR}/libopenjpeg/bio.c ${OPENJPEG_SOURCE_DIR}/libopenjpeg/cio.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 ) -SET(MJ2_SRCS mj2.c mj2_convert.c) +set(MJ2_SRCS mj2.c mj2_convert.c) -IF(WIN32) - ADD_DEFINITIONS(-DOPJ_STATIC) -ENDIF(WIN32) +if(WIN32) + add_definitions(-DOPJ_STATIC) +endif(WIN32) # Headers file are located here: -INCLUDE_DIRECTORIES( +include_directories( ${OPENJPEG_SOURCE_DIR}/libopenjpeg ${OPENJPEG_SOURCE_DIR}/applications/common ${LCMS_INCLUDE_DIRNAME} ) -ADD_EXECUTABLE(frames_to_mj2 +add_executable(frames_to_mj2 frames_to_mj2.c ${common_SRCS} ${OPJ_SRCS} ${MJ2_SRCS} ) -TARGET_LINK_LIBRARIES(frames_to_mj2 ${LCMS_LIBNAME}) +target_link_libraries(frames_to_mj2 ${LCMS_LIBNAME}) -IF(UNIX) - TARGET_LINK_LIBRARIES(frames_to_mj2 m) -ENDIF(UNIX) +if(UNIX) + target_link_libraries(frames_to_mj2 m) +endif(UNIX) -ADD_EXECUTABLE(mj2_to_frames +add_executable(mj2_to_frames mj2_to_frames.c ${common_SRCS} ${OPJ_SRCS} ${MJ2_SRCS} ${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) - TARGET_LINK_LIBRARIES(mj2_to_frames m) -ENDIF(UNIX) +if(UNIX) + target_link_libraries(mj2_to_frames m) +endif(UNIX) -ADD_EXECUTABLE(extract_j2k_from_mj2 +add_executable(extract_j2k_from_mj2 extract_j2k_from_mj2.c ${OPJ_SRCS} ${MJ2_SRCS} ) -TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 ${LCMS_LIBNAME}) +target_link_libraries(extract_j2k_from_mj2 ${LCMS_LIBNAME}) -IF(UNIX) - TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 m) -ENDIF(UNIX) +if(UNIX) + target_link_libraries(extract_j2k_from_mj2 m) +endif(UNIX) -ADD_EXECUTABLE(wrap_j2k_in_mj2 +add_executable(wrap_j2k_in_mj2 wrap_j2k_in_mj2.c ${OPJ_SRCS} ${MJ2_SRCS} ) -TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 ${LCMS_LIBNAME}) +target_link_libraries(wrap_j2k_in_mj2 ${LCMS_LIBNAME}) -IF(UNIX) - TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 m) -ENDIF(UNIX) +if(UNIX) + target_link_libraries(wrap_j2k_in_mj2 m) +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}) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index d30e384e..48f28813 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -3,24 +3,24 @@ # to generate the html documentation in the doc/html repository of the build folder. # 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_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) # Configure the html mainpage file of the doxygen documentation with variable # 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) # 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) -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) diff --git a/libopenjpeg/CMakeLists.txt b/libopenjpeg/CMakeLists.txt index cc9a23cd..9a408342 100644 --- a/libopenjpeg/CMakeLists.txt +++ b/libopenjpeg/CMakeLists.txt @@ -1,6 +1,6 @@ -INCLUDE_REGULAR_EXPRESSION("^.*$") +include_regular_expression("^.*$") # Defines the source code for the library -SET(OPENJPEG_SRCS +set(OPENJPEG_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/bio.c ${CMAKE_CURRENT_SOURCE_DIR}/cio.c ${CMAKE_CURRENT_SOURCE_DIR}/dwt.c @@ -28,26 +28,26 @@ SET(OPENJPEG_SRCS ) # Build the library -IF(WIN32) - IF(BUILD_SHARED_LIBS) - ADD_DEFINITIONS(-DOPJ_EXPORTS) - ELSE(BUILD_SHARED_LIBS) - ADD_DEFINITIONS(-DOPJ_STATIC) - ENDIF(BUILD_SHARED_LIBS) -ENDIF(WIN32) -ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS}) -IF(UNIX) - TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME} m) -ENDIF(UNIX) -SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES}) +if(WIN32) + if(BUILD_SHARED_LIBS) + add_definitions(-DOPJ_EXPORTS) + else(BUILD_SHARED_LIBS) + add_definitions(-DOPJ_STATIC) + endif(BUILD_SHARED_LIBS) +endif(WIN32) +add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS}) +if(UNIX) + target_link_libraries(${OPENJPEG_LIBRARY_NAME} m) +endif(UNIX) +set_target_properties(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES}) # Build the JPWL library ? -IF(BUILD_JPWL) - ADD_SUBDIRECTORY(jpwl) -ENDIF(BUILD_JPWL) +if(BUILD_JPWL) + add_subdirectory(jpwl) +endif(BUILD_JPWL) # Install library -INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME} +install(TARGETS ${OPENJPEG_LIBRARY_NAME} EXPORT OpenJPEGTargets RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries @@ -55,12 +55,12 @@ INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME} ) # Install includes files -INSTALL(FILES openjpeg.h opj_stdint.h +install(FILES openjpeg.h opj_stdint.h DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers ) # install man page of the library -INSTALL( +install( FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man3/libopenjpeg.3 DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3) diff --git a/libopenjpeg/jpwl/CMakeLists.txt b/libopenjpeg/jpwl/CMakeLists.txt index f8512cda..3bb5632d 100644 --- a/libopenjpeg/jpwl/CMakeLists.txt +++ b/libopenjpeg/jpwl/CMakeLists.txt @@ -1,33 +1,33 @@ # 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) -IF(APPLE) - SET_SOURCE_FILES_PROPERTIES( +set(JPWL_SRCS crc.c jpwl.c jpwl_lib.c rs.c) +if(APPLE) + set_source_files_properties( rs.c PROPERTIES COMPILE_FLAGS -fno-common) -ENDIF(APPLE) +endif(APPLE) -INCLUDE_DIRECTORIES( +include_directories( ${OPENJPEG_SOURCE_DIR}/libopenjpeg ) # Build the library -IF(WIN32) - IF(BUILD_SHARED_LIBS) - ADD_DEFINITIONS(-DOPJ_EXPORTS) - ELSE(BUILD_SHARED_LIBS) - ADD_DEFINITIONS(-DOPJ_STATIC) - ENDIF(BUILD_SHARED_LIBS) -ENDIF(WIN32) -ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME}_JPWL ${JPWL_SRCS} ${OPENJPEG_SRCS}) -SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME}_JPWL +if(WIN32) + if(BUILD_SHARED_LIBS) + add_definitions(-DOPJ_EXPORTS) + else(BUILD_SHARED_LIBS) + add_definitions(-DOPJ_STATIC) + endif(BUILD_SHARED_LIBS) +endif(WIN32) +add_library(${OPENJPEG_LIBRARY_NAME}_JPWL ${JPWL_SRCS} ${OPENJPEG_SRCS}) +set_target_properties(${OPENJPEG_LIBRARY_NAME}_JPWL PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES}) # Install library -INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}_JPWL +install(TARGETS ${OPENJPEG_LIBRARY_NAME}_JPWL EXPORT OpenJPEGTargets RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a5ada2f8..0b1ce71b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,5 @@ # Tests -INCLUDE_DIRECTORIES( +include_directories( ${OPENJPEG_SOURCE_DIR}/libopenjpeg ${OPENJPEG_SOURCE_DIR}/applications/codec ${OPENJPEG_SOURCE_DIR}/applications/common @@ -9,72 +9,72 @@ INCLUDE_DIRECTORIES( ) # 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/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) -SET(compareRAWimages_SRCS compareRAWimages.c +set(compareRAWimages_SRCS compareRAWimages.c ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c) -ADD_EXECUTABLE(comparePGXimages ${comparePGXimages_SRCS}) -TARGET_LINK_LIBRARIES(comparePGXimages +add_executable(comparePGXimages ${comparePGXimages_SRCS}) +target_link_libraries(comparePGXimages ${OPENJPEG_LIBRARY_NAME} ${PNG_LIBNAME} ${TIFF_LIBNAME} ) # To support universal exe: -IF(ZLIB_FOUND AND APPLE) - TARGET_LINK_LIBRARIES(comparePGXimages z) +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) + target_link_libraries(comparePGXimages ${Z_LIBNAME}) +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) -TARGET_LINK_LIBRARIES(j2k_random_tile_access ${OPENJPEG_LIBRARY_NAME}) +add_executable(j2k_random_tile_access j2k_random_tile_access.c) +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) -TARGET_LINK_LIBRARIES(test_tile_encoder ${OPENJPEG_LIBRARY_NAME}) +add_executable(test_tile_encoder test_tile_encoder.c) +target_link_libraries(test_tile_encoder ${OPENJPEG_LIBRARY_NAME}) # Let's try a couple of possibilities: -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(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(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(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(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(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_EXECUTABLE(test_tile_decoder test_tile_decoder.c) -TARGET_LINK_LIBRARIES(test_tile_decoder ${OPENJPEG_LIBRARY_NAME}) +add_executable(test_tile_decoder test_tile_decoder.c) +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) -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) -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) # 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) +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) -ADD_SUBDIRECTORY(conformance) -ADD_SUBDIRECTORY(nonregression) +add_subdirectory(conformance) +add_subdirectory(nonregression) -IF(BUILD_JPIP) - IF(JPIP_SERVER) - #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(p "${CMAKE_CURRENT_BINARY_DIR}/jpip.dat") - SET(md5 "62b00c620fb0a600c5ffd413cada4674") - ADD_TEST(TestJPIP1 ${CMAKE_COMMAND} -DD_URL:STRING=${s} -DD_FILE:PATH=${p} +if(BUILD_JPIP) + if(JPIP_SERVER) + #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(p "${CMAKE_CURRENT_BINARY_DIR}/jpip.dat") + 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(JPIP_SERVER) +endif(BUILD_JPIP) diff --git a/tests/conformance/CMakeLists.txt b/tests/conformance/CMakeLists.txt index d23cdb1d..9dba0dd2 100644 --- a/tests/conformance/CMakeLists.txt +++ b/tests/conformance/CMakeLists.txt @@ -1,19 +1,19 @@ # 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(BASELINE_CONF ${OPJ_DATA_ROOT}/baseline/conformance) -SET(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression) -SET(INPUT_CONF ${OPJ_DATA_ROOT}/input/conformance) +set(TEMP ${CMAKE_CURRENT_BINARY_DIR}/Temporary) +set(BASELINE_CONF ${OPJ_DATA_ROOT}/baseline/conformance) +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 #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") +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(COMMENTCODEVAR FALSE) +set(COMMENTCODEVAR FALSE) #-------------------------------------------------------------------------- @@ -23,20 +23,20 @@ SET(COMMENTCODEVAR FALSE) # non regression comparison # 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_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_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) - SET( filenameInput p0_${numFileC0P0}.j2k ) - SET( filenameRef c0p0_${numFileC0P0}.pgx ) - ENDIF(${numFileC0P0} LESS 10) + if(${numFileC0P0} LESS 10) + set( filenameInput p0_0${numFileC0P0}.j2k ) + set( filenameRef c0p0_0${numFileC0P0}.pgx ) + else(${numFileC0P0} LESS 10) + set( filenameInput p0_${numFileC0P0}.j2k ) + set( filenameRef c0p0_${numFileC0P0}.pgx ) + endif(${numFileC0P0} LESS 10) # Get corresponding tests parameters list(GET C0P0_ResFactor_list ${numFileC0P0} ResFactor) @@ -45,18 +45,18 @@ FOREACH(numFileC0P0 RANGE 1 16) 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) + if (numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15) get_filename_component(filenameRefSub ${filenameRef} NAME_WE) #r = 0 - ADD_TEST(ETS-C0P0-${filenameInput}-r0-decode + 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 + add_test(ETS-C0P0-${filenameInput}-r0-compare2ref ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_CONF}/${filenameRefSub}r0.pgx -t ${TEMP}/c0${filenameInput}-r0.pgx @@ -66,11 +66,11 @@ FOREACH(numFileC0P0 RANGE 1 16) -s t_ ) - SET_TESTS_PROPERTIES(ETS-C0P0-${filenameInput}-r0-compare2ref + set_tests_properties(ETS-C0P0-${filenameInput}-r0-compare2ref PROPERTIES DEPENDS ETS-C0P0-${filenameInput}-r0-decode) - ADD_TEST(NR-C0P0-${filenameInput}-r0-compare2base + add_test(NR-C0P0-${filenameInput}-r0-compare2base ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_NR}/opj_${filenameRefSub}-r0.pgx -t ${TEMP}/c0${filenameInput}-r0.pgx @@ -79,19 +79,19 @@ FOREACH(numFileC0P0 RANGE 1 16) -s b_t_ ) - SET_TESTS_PROPERTIES(NR-C0P0-${filenameInput}-r0-compare2base + set_tests_properties(NR-C0P0-${filenameInput}-r0-compare2base PROPERTIES DEPENDS ETS-C0P0-${filenameInput}-r0-decode) #r = 1 - ADD_TEST(ETS-C0P0-${filenameInput}-r1-decode + add_test(ETS-C0P0-${filenameInput}-r1-decode ${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 + add_test(ETS-C0P0-${filenameInput}-r1-compare2ref ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_CONF}/${filenameRefSub}r1.pgx -t ${TEMP}/c0${filenameInput}-r1.pgx @@ -101,11 +101,11 @@ FOREACH(numFileC0P0 RANGE 1 16) -s t_ ) - SET_TESTS_PROPERTIES(ETS-C0P0-${filenameInput}-r1-compare2ref + set_tests_properties(ETS-C0P0-${filenameInput}-r1-compare2ref PROPERTIES DEPENDS ETS-C0P0-${filenameInput}-r1-decode) - ADD_TEST(NR-C0P0-${filenameInput}-r1-compare2base + add_test(NR-C0P0-${filenameInput}-r1-compare2base ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_NR}/opj_${filenameRefSub}-r1.pgx -t ${TEMP}/c0${filenameInput}-r1.pgx @@ -114,20 +114,20 @@ FOREACH(numFileC0P0 RANGE 1 16) -s b_t_ ) - SET_TESTS_PROPERTIES(NR-C0P0-${filenameInput}-r1-compare2base + set_tests_properties(NR-C0P0-${filenameInput}-r1-compare2base PROPERTIES DEPENDS 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 -i ${INPUT_CONF}/${filenameInput} -o ${TEMP}/c0${filenameInput}.pgx -r ${ResFactor} ) - ADD_TEST(ETS-C0P0-${filenameInput}-compare2ref + add_test(ETS-C0P0-${filenameInput}-compare2ref ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_CONF}/${filenameRef} -t ${TEMP}/c0${filenameInput}.pgx @@ -137,11 +137,11 @@ FOREACH(numFileC0P0 RANGE 1 16) -s t_ ) - SET_TESTS_PROPERTIES(ETS-C0P0-${filenameInput}-compare2ref + set_tests_properties(ETS-C0P0-${filenameInput}-compare2ref PROPERTIES DEPENDS ETS-C0P0-${filenameInput}-decode) - ADD_TEST(NR-C0P0-${filenameInput}-compare2base + add_test(NR-C0P0-${filenameInput}-compare2base ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_NR}/opj_${filenameRef} -t ${TEMP}/c0${filenameInput}.pgx @@ -150,13 +150,13 @@ FOREACH(numFileC0P0 RANGE 1 16) -s b_t_ ) - SET_TESTS_PROPERTIES(NR-C0P0-${filenameInput}-compare2base + set_tests_properties(NR-C0P0-${filenameInput}-compare2base PROPERTIES DEPENDS 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 @@ -165,15 +165,15 @@ ENDFOREACH(numFileC0P0) # non regression comparison # Parameters and tolerances given by Table C.4 -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") +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 ) + set( filenameInput p1_0${numFileC0P1}.j2k ) + set( filenameRef c0p1_0${numFileC0P1}.pgx ) # Get corresponding tests parameters list(GET C0P1_ResFactor_list ${numFileC0P1} ResFactor) @@ -182,18 +182,18 @@ FOREACH(numFileC0P1 RANGE 1 7) list(GET C0P1_MSE_list ${numFileC0P1} MSE_limit) # Manage cases which need to try different resolution reduction - IF (numFileC0P1 EQUAL 4 ) + if (numFileC0P1 EQUAL 4 ) get_filename_component(filenameRefSub ${filenameRef} NAME_WE) #r = 0 - ADD_TEST(ETS-C0P1-${filenameInput}-r0-decode + 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 + add_test(ETS-C0P1-${filenameInput}-r0-compare2ref ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_CONF}/${filenameRefSub}r0.pgx -t ${TEMP}/c0${filenameInput}-r0.pgx @@ -203,11 +203,11 @@ FOREACH(numFileC0P1 RANGE 1 7) -s t_ ) - SET_TESTS_PROPERTIES(ETS-C0P1-${filenameInput}-r0-compare2ref + set_tests_properties(ETS-C0P1-${filenameInput}-r0-compare2ref PROPERTIES DEPENDS ETS-C0P1-${filenameInput}-r0-decode) - ADD_TEST(NR-C0P1-${filenameInput}-r0-compare2base + add_test(NR-C0P1-${filenameInput}-r0-compare2base ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_NR}/opj_${filenameRefSub}-r0.pgx -t ${TEMP}/c0${filenameInput}-r0.pgx @@ -216,19 +216,19 @@ FOREACH(numFileC0P1 RANGE 1 7) -s b_t_ ) - SET_TESTS_PROPERTIES(NR-C0P1-${filenameInput}-r0-compare2base + set_tests_properties(NR-C0P1-${filenameInput}-r0-compare2base PROPERTIES DEPENDS ETS-C0P1-${filenameInput}-r0-decode) #r = 3 - ADD_TEST(ETS-C0P1-${filenameInput}-r3-decode + add_test(ETS-C0P1-${filenameInput}-r3-decode ${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 + add_test(ETS-C0P1-${filenameInput}-r3-compare2ref ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_CONF}/${filenameRefSub}r3.pgx -t ${TEMP}/c0${filenameInput}-r3.pgx @@ -238,11 +238,11 @@ FOREACH(numFileC0P1 RANGE 1 7) -s t_ ) - SET_TESTS_PROPERTIES(ETS-C0P1-${filenameInput}-r3-compare2ref + set_tests_properties(ETS-C0P1-${filenameInput}-r3-compare2ref PROPERTIES DEPENDS ETS-C0P1-${filenameInput}-r3-decode) - ADD_TEST(NR-C0P1-${filenameInput}-r3-compare2base + add_test(NR-C0P1-${filenameInput}-r3-compare2base ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_NR}/opj_${filenameRefSub}-r3.pgx -t ${TEMP}/c0${filenameInput}-r3.pgx @@ -251,20 +251,20 @@ FOREACH(numFileC0P1 RANGE 1 7) -s b_t_ ) - SET_TESTS_PROPERTIES(NR-C0P1-${filenameInput}-r3-compare2base + set_tests_properties(NR-C0P1-${filenameInput}-r3-compare2base PROPERTIES DEPENDS 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 -i ${INPUT_CONF}/${filenameInput} -o ${TEMP}/c0${filenameInput}.pgx -r ${ResFactor} ) - ADD_TEST(ETS-C0P1-${filenameInput}-compare2ref + add_test(ETS-C0P1-${filenameInput}-compare2ref ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_CONF}/${filenameRef} -t ${TEMP}/c0${filenameInput}.pgx @@ -274,11 +274,11 @@ FOREACH(numFileC0P1 RANGE 1 7) -s t_ ) - SET_TESTS_PROPERTIES(ETS-C0P1-${filenameInput}-compare2ref + set_tests_properties(ETS-C0P1-${filenameInput}-compare2ref PROPERTIES DEPENDS ETS-C0P1-${filenameInput}-decode) - ADD_TEST(NR-C0P1-${filenameInput}-compare2base + add_test(NR-C0P1-${filenameInput}-compare2base ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_NR}/opj_${filenameRef} -t ${TEMP}/c0${filenameInput}.pgx @@ -287,13 +287,13 @@ FOREACH(numFileC0P1 RANGE 1 7) -s b_t_ ) - SET_TESTS_PROPERTIES(NR-C0P1-${filenameInput}-compare2base + set_tests_properties(NR-C0P1-${filenameInput}-compare2base PROPERTIES DEPENDS ETS-C0P1-${filenameInput}-decode) - ENDIF(numFileC0P1 EQUAL 4) + endif(numFileC0P1 EQUAL 4) -ENDFOREACH(numFileC0P1) +endforeach(numFileC0P1) #-------------------------------------------------------------------------- # Tests about class 1 profile 0 @@ -302,20 +302,20 @@ ENDFOREACH(numFileC0P1) # non regression comparison # 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_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_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) - SET( filenameInput p0_${numFileC1P0}.j2k ) - SET( filenameRef c1p0_${numFileC1P0}.pgx ) - ENDIF(${numFileC1P0} LESS 10) + if(${numFileC1P0} LESS 10) + set( filenameInput p0_0${numFileC1P0}.j2k ) + set( filenameRef c1p0_0${numFileC1P0}.pgx ) + else(${numFileC1P0} LESS 10) + set( filenameInput p0_${numFileC1P0}.j2k ) + set( filenameRef c1p0_${numFileC1P0}.pgx ) + endif(${numFileC1P0} LESS 10) # Get corresponding tests parameters 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_MSE_list ${numFileC1P0} MSE_limit) - ADD_TEST(ETS-C1P0-${filenameInput}-decode + add_test(ETS-C1P0-${filenameInput}-decode ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image -i ${INPUT_CONF}/${filenameInput} -o ${TEMP}/c1${filenameInput}.pgx -r ${ResFactor} ) - ADD_TEST(ETS-C1P0-${filenameInput}-compare2ref + add_test(ETS-C1P0-${filenameInput}-compare2ref ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_CONF}/${filenameRef} -t ${TEMP}/c1${filenameInput}.pgx @@ -340,11 +340,11 @@ FOREACH(numFileC1P0 RANGE 1 16) -s b_t_ ) - SET_TESTS_PROPERTIES(ETS-C1P0-${filenameInput}-compare2ref + set_tests_properties(ETS-C1P0-${filenameInput}-compare2ref PROPERTIES DEPENDS ETS-C1P0-${filenameInput}-decode) - ADD_TEST(NR-C1P0-${filenameInput}-compare2base + add_test(NR-C1P0-${filenameInput}-compare2base ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_NR}/opj_${filenameRef} -t ${TEMP}/c1${filenameInput}.pgx @@ -353,11 +353,11 @@ FOREACH(numFileC1P0 RANGE 1 16) -s b_t_ ) - SET_TESTS_PROPERTIES(NR-C1P0-${filenameInput}-compare2base + set_tests_properties(NR-C1P0-${filenameInput}-compare2base PROPERTIES DEPENDS ETS-C1P0-${filenameInput}-decode) -ENDFOREACH(numFileC1P0) +endforeach(numFileC1P0) #-------------------------------------------------------------------------- # Tests about class 1 profile 1 @@ -366,28 +366,28 @@ ENDFOREACH(numFileC1P0) # non regression comparison # 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_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_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 ) + 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 + add_test(ETS-C1P1-${filenameInput}-decode ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image -i ${INPUT_CONF}/${filenameInput} -o ${TEMP}/c1${filenameInput}.pgx -r 0 ) - ADD_TEST(ETS-C1P1-${filenameInput}-compare2ref + add_test(ETS-C1P1-${filenameInput}-compare2ref ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_CONF}/${filenameRef} -t ${TEMP}/c1${filenameInput}.pgx @@ -397,11 +397,11 @@ FOREACH(numFileC1P1 RANGE 1 7) -s b_t_ ) - SET_TESTS_PROPERTIES(ETS-C1P1-${filenameInput}-compare2ref + set_tests_properties(ETS-C1P1-${filenameInput}-compare2ref PROPERTIES DEPENDS ETS-C1P1-${filenameInput}-decode) - ADD_TEST(NR-C1P1-${filenameInput}-compare2base + add_test(NR-C1P1-${filenameInput}-compare2base ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages -b ${BASELINE_NR}/opj_${filenameRef} -t ${TEMP}/c1${filenameInput}.pgx @@ -410,11 +410,11 @@ FOREACH(numFileC1P1 RANGE 1 7) -s b_t_ ) - SET_TESTS_PROPERTIES(NR-C1P1-${filenameInput}-compare2base + set_tests_properties(NR-C1P1-${filenameInput}-compare2base PROPERTIES DEPENDS ETS-C1P1-${filenameInput}-decode) -ENDFOREACH(numFileC1P1) +endforeach(numFileC1P1) #-------------------------------------------------------------------------- # Tests about JP2 file @@ -424,16 +424,16 @@ 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 ) + 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 + add_test(ETS-JP2-${filenameInput}-decode ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image -i ${INPUT_CONF}/${filenameInput} -o ${TEMP}/${filenameInput}.tif @@ -441,29 +441,29 @@ FOREACH(numFileJP2 RANGE 1 9) # # 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 # -b ${BASELINE_CONF}/${filenameRef_tif} # -t ${TEMP}/${filenameInput}.pgx # -p 4 # ) # -# SET_TESTS_PROPERTIES(ETS-JP2-${filenameInput}-compare2ref +# set_tests_properties(ETS-JP2-${filenameInput}-compare2ref # PROPERTIES DEPENDS # ETS-JP2-${filenameInput}-decode) # -# ADD_TEST(NR-JP2-${filenameInput}-compare2base +# add_test(NR-JP2-${filenameInput}-compare2base # ${EXECUTABLE_OUTPUT_PATH}/compareTIFimages # -b ${BASELINE_NR}/opj_${filenameRef} # -t ${TEMP}/${filenameInput}.tif # -d # ) # -# SET_TESTS_PROPERTIES(NR-JP2-${filenameInput}-compare2base +# set_tests_properties(NR-JP2-${filenameInput}-compare2base # PROPERTIES DEPENDS # ETS-JP2-${filenameInput}-decode) -ENDFOREACH(numFileJP2) +endforeach(numFileJP2) #--------------------------------------------------------------------------# #--------------------------------------------------------------------------# @@ -474,89 +474,89 @@ 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) - SET( filenameInput p0_${numFileP0}.j2k ) - ENDIF(${numFileP0} LESS 10) + if(${numFileP0} LESS 10) + set( filenameInput p0_0${numFileP0}.j2k ) + else(${numFileP0} LESS 10) + set( filenameInput p0_${numFileP0}.j2k ) + endif(${numFileP0} LESS 10) get_filename_component(filenameRefSub ${filenameInput} NAME_WE) - ADD_TEST(NR-${filenameInput}-dump + add_test(NR-${filenameInput}-dump ${EXECUTABLE_OUTPUT_PATH}/j2k_dump -i ${INPUT_CONF}/${filenameInput} -o ${TEMP}/${filenameInput}.txt ) - ADD_TEST(NR-${filenameInput}-compare_dump2base + 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 + set_tests_properties(NR-${filenameInput}-compare_dump2base PROPERTIES DEPENDS NR-${filenameInput}-dump) -ENDFOREACH(numFileP0) +endforeach(numFileP0) #-------------------------------------------------------------------------- # 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 ) + set( filenameInput p1_0${numFileP1}.j2k ) get_filename_component(filenameInputSub ${filenameInput} NAME_WE) - ADD_TEST(NR-${filenameInput}-dump + add_test(NR-${filenameInput}-dump ${EXECUTABLE_OUTPUT_PATH}/j2k_dump -i ${INPUT_CONF}/${filenameInput} -o ${TEMP}/${filenameInput}.txt ) - ADD_TEST(NR-${filenameInput}-compare_dump2base + 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 + set_tests_properties(NR-${filenameInput}-compare_dump2base PROPERTIES DEPENDS NR-${filenameInput}-dump) -ENDFOREACH(numFileP1) +endforeach(numFileP1) #-------------------------------------------------------------------------- # 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" ) + set( filenameInput "file${numFileJP2}.jp2" ) get_filename_component(filenameInputSub ${filenameInput} NAME_WE) - ADD_TEST(NR-${filenameInput}-dump + add_test(NR-${filenameInput}-dump ${EXECUTABLE_OUTPUT_PATH}/j2k_dump -i ${INPUT_CONF}/${filenameInput} -o ${TEMP}/${filenameInput}.txt ) - ADD_TEST(NR-${filenameInput}-compare_dump2base + 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 + set_tests_properties(NR-${filenameInput}-compare_dump2base PROPERTIES DEPENDS NR-${filenameInput}-dump) -ENDFOREACH(numFileJP2) \ No newline at end of file +endforeach(numFileJP2) \ No newline at end of file diff --git a/tests/nonregression/CMakeLists.txt b/tests/nonregression/CMakeLists.txt index 8a743e7d..f3f859bc 100644 --- a/tests/nonregression/CMakeLists.txt +++ b/tests/nonregression/CMakeLists.txt @@ -1,15 +1,15 @@ # 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(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression) -SET(INPUT_NR ${OPJ_DATA_ROOT}/input/nonregression) +set(TEMP ${CMAKE_CURRENT_BINARY_DIR}/Temporary) +set(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression) +set(INPUT_NR ${OPJ_DATA_ROOT}/input/nonregression) -SET(INPUT_NR_PATH ${INPUT_NR}) -SET(TEMP_PATH ${TEMP}) -SET(INPUT_CONF_PATH ${OPJ_DATA_ROOT}/input/conformance) +set(INPUT_NR_PATH ${INPUT_NR}) +set(TEMP_PATH ${TEMP}) +set(INPUT_CONF_PATH ${OPJ_DATA_ROOT}/input/conformance) # need kdu_expand if possible find_package(KAKADU) @@ -19,49 +19,49 @@ 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 ) -FILE(GLOB_RECURSE OPJ_DATA_NR_LIST +file(GLOB_RECURSE OPJ_DATA_NR_LIST "${INPUT_NR}/*.j2k" "${INPUT_NR}/*.j2c" "${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}) +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 + add_test(NR-${INPUT_FILENAME_NAME}-dump ${EXECUTABLE_OUTPUT_PATH}/j2k_dump -i ${INPUT_FILENAME} -o ${TEMP}/${INPUT_FILENAME_NAME}.txt -v ) - IF(bad_jpeg2000) - SET_TESTS_PROPERTIES(NR-${INPUT_FILENAME_NAME}-dump + if(bad_jpeg2000) + set_tests_properties(NR-${INPUT_FILENAME_NAME}-dump PROPERTIES WILL_FAIL TRUE) - ELSE(bad_jpeg2000) + else(bad_jpeg2000) # 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 -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 + set_tests_properties(NR-${INPUT_FILENAME_NAME}-compare_dump2base PROPERTIES DEPENDS 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. # Configure the test suite file: -CONFIGURE_FILE("test_suite.ctest.in" +configure_file("test_suite.ctest.in" "${CMAKE_CURRENT_BINARY_DIR}/test_suite.ctest" @ONLY) # 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 -FILE(GLOB TEST_SUITE_FILES *.ctest.in) -IF (TEST_SUITE_FILES) - FOREACH(TEST_SUITE_FILE ${TEST_SUITE_FILES}) +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}) + 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}" + get_filename_component(TEST_SUITE_FILE_SUB ${TEST_SUITE_FILE} NAME_WE) + configure_file("${TEST_SUITE_FILE}" "${CMAKE_CURRENT_BINARY_DIR}/${TEST_SUITE_FILE_SUB}.ctest" @ONLY) # 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 - 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) -SET(IT_TEST_ENC 0) -SET(IT_TEST_DEC 0) -FOREACH(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST}) +set(IT_TEST_ENC 0) +set(IT_TEST_DEC 0) +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 - 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 - LIST(GET CMD_ARG_LIST 0 EXE_NAME) + list(GET CMD_ARG_LIST 0 EXE_NAME) - IF(EXE_NAME) - STRING(REGEX MATCH "^#" IGNORE_LINE_FOUND ${EXE_NAME}) - ENDIF(EXE_NAME) + if(EXE_NAME) + string(REGEX MATCH "^#" IGNORE_LINE_FOUND ${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 - SET(FAILED_TEST_FOUND 0) - STRING(REGEX MATCH "^!" FAILED_TEST_FOUND ${EXE_NAME}) + set(FAILED_TEST_FOUND 0) + 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 - SET(FAILED_TEST_FOUND_1 0) - STRING(REGEX MATCH "^!image_to_j2k$|^!j2k_to_image$" FAILED_TEST_FOUND_1 ${EXE_NAME}) + 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) + 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) - LIST(GET CMD_ARG_LIST 1 EXE_NAME) - STRING(REGEX MATCH "^image_to_j2k$|^j2k_to_image$" FAILED_TEST_FOUND_2 ${EXE_NAME}) + 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) + 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_1) + endif (FAILED_TEST_FOUND_2) + endif (FAILED_TEST_FOUND_1) - ELSE (FAILED_TEST_FOUND) + else (FAILED_TEST_FOUND) # 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 - SET(CMD_ARG_LIST_2 "") - SET(ARG_POS 0) - SET(INPUT_ARG_POS 0) - SET(OUTPUT_ARG_POS 0) + 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}) + foreach(CMD_ARG_ELT ${CMD_ARG_LIST}) 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) + 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) - 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) + 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) - 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) - 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) + 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) + 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 + 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) + 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 - 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 -i ${OUTPUT_FILENAME} -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 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 + 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 + set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dump2base 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 + if (KDU_EXPAND_EXECUTABLE) + add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref ${KDU_EXPAND_EXECUTABLE} -i ${OUTPUT_FILENAME} -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 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 + 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 + set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-compare_dec-ref-out2base PROPERTIES DEPENDS NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref) - ENDIF() - ENDIF(FAILED_TEST_FOUND) + endif() + endif(FAILED_TEST_FOUND) # DECODER TEST SUITE - ELSE(ENC_TEST_FOUND) + else(ENC_TEST_FOUND) math(EXPR IT_TEST_DEC "${IT_TEST_DEC}+1" ) # 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 ${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 # can output png diff files if necesary -# ADD_TEST(NR-${filename}-compare2base +# add_test(NR-${filename}-compare2base # ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages # -b ${BASELINE_NR}/opj_${filenameRef} # -t ${TEMP}/${filename}.pgx @@ -305,14 +305,14 @@ FOREACH(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST}) # -s b_t_ # ) # -# SET_TESTS_PROPERTIES(NR-${filename}-compare2base +# set_tests_properties(NR-${filename}-compare2base # PROPERTIES DEPENDS # 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)