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

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

View File

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

View File

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

View File

@ -28,4 +28,4 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLU
if(LCMS2_FOUND) if(LCMS2_FOUND)
set( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR}) set( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
set( LCMS2_LIBRARIES ${LCMS2_LIBRARY} ) set( LCMS2_LIBRARIES ${LCMS2_LIBRARY} )
endif(LCMS2_FOUND) endif()

View File

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

View File

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

View File

@ -30,7 +30,7 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
"${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c") "${PROJECT_SOURCE_DIR}/CMake/TestFileOffsetBits.c")
if(FILE64_OK) if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present") message(STATUS "Checking for 64-bit off_t - present")
endif(FILE64_OK) endif()
if(NOT FILE64_OK) if(NOT FILE64_OK)
# Test with _FILE_OFFSET_BITS=64 # Test with _FILE_OFFSET_BITS=64
@ -40,8 +40,8 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
if(FILE64_OK) if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64") message(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64")
set(_FILE_OFFSET_BITS 64) set(_FILE_OFFSET_BITS 64)
endif(FILE64_OK) endif()
endif(NOT FILE64_OK) endif()
if(NOT FILE64_OK) if(NOT FILE64_OK)
# Test with _LARGE_FILES # Test with _LARGE_FILES
@ -51,8 +51,8 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
if(FILE64_OK) if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES") message(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES")
set(_LARGE_FILES 1) set(_LARGE_FILES 1)
endif(FILE64_OK) endif()
endif(NOT FILE64_OK) endif()
if(NOT FILE64_OK) if(NOT FILE64_OK)
# Test with _LARGEFILE_SOURCE # Test with _LARGEFILE_SOURCE
@ -62,8 +62,8 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
if(FILE64_OK) if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE") message(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE 1) set(_LARGEFILE_SOURCE 1)
endif(FILE64_OK) endif()
endif(NOT FILE64_OK) endif()
#if(NOT FILE64_OK) #if(NOT FILE64_OK)
@ -73,12 +73,12 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
# if(FILE64_OK) # if(FILE64_OK)
# message(STATUS "Checking for 64-bit off_t - present with _fseeki64") # message(STATUS "Checking for 64-bit off_t - present with _fseeki64")
# set(HAVE__FSEEKI64 1) # set(HAVE__FSEEKI64 1)
# endif(FILE64_OK) # endif()
#endif(NOT FILE64_OK) #endif()
if(NOT FILE64_OK) if(NOT FILE64_OK)
message(STATUS "Checking for 64-bit off_t - not present") message(STATUS "Checking for 64-bit off_t - not present")
endif(NOT FILE64_OK) endif()
set(_FILE_OFFSET_BITS ${_FILE_OFFSET_BITS} CACHE INTERNAL "Result of test for needed _FILE_OFFSET_BITS=64") set(_FILE_OFFSET_BITS ${_FILE_OFFSET_BITS} CACHE INTERNAL "Result of test for needed _FILE_OFFSET_BITS=64")
set(_LARGE_FILES ${_LARGE_FILES} CACHE INTERNAL "Result of test for needed _LARGE_FILES") set(_LARGE_FILES ${_LARGE_FILES} CACHE INTERNAL "Result of test for needed _LARGE_FILES")
@ -97,7 +97,7 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
if(FSEEKO_COMPILE_OK) if(FSEEKO_COMPILE_OK)
message(STATUS "Checking for fseeko/ftello - present") message(STATUS "Checking for fseeko/ftello - present")
endif(FSEEKO_COMPILE_OK) endif()
if(NOT FSEEKO_COMPILE_OK) if(NOT FSEEKO_COMPILE_OK)
# glibc 2.2 needs _LARGEFILE_SOURCE for fseeko (but not for 64-bit off_t...) # glibc 2.2 needs _LARGEFILE_SOURCE for fseeko (but not for 64-bit off_t...)
@ -109,26 +109,26 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
if(FSEEKO_COMPILE_OK) if(FSEEKO_COMPILE_OK)
message(STATUS "Checking for fseeko/ftello - present with _LARGEFILE_SOURCE") message(STATUS "Checking for fseeko/ftello - present with _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE") set(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE")
endif(FSEEKO_COMPILE_OK) endif()
endif(NOT FSEEKO_COMPILE_OK) endif()
if(FSEEKO_COMPILE_OK) if(FSEEKO_COMPILE_OK)
set(HAVE_FSEEKO ON CACHE INTERNAL "Result of test for fseeko/ftello") set(HAVE_FSEEKO ON CACHE INTERNAL "Result of test for fseeko/ftello")
else(FSEEKO_COMPILE_OK) else()
message(STATUS "Checking for fseeko/ftello - not found") message(STATUS "Checking for fseeko/ftello - not found")
set(HAVE_FSEEKO OFF CACHE INTERNAL "Result of test for fseeko/ftello") set(HAVE_FSEEKO OFF CACHE INTERNAL "Result of test for fseeko/ftello")
endif(FSEEKO_COMPILE_OK) endif()
if(FILE64_OK AND FSEEKO_COMPILE_OK) if(FILE64_OK AND FSEEKO_COMPILE_OK)
message(STATUS "Large File support - found") message(STATUS "Large File support - found")
set(${VARIABLE} ON CACHE INTERNAL "Result of test for large file support") set(${VARIABLE} ON CACHE INTERNAL "Result of test for large file support")
else(FILE64_OK AND FSEEKO_COMPILE_OK) else()
message(STATUS "Large File support - not found") message(STATUS "Large File support - not found")
set(${VARIABLE} OFF CACHE INTERNAL "Result of test for large file support") set(${VARIABLE} OFF CACHE INTERNAL "Result of test for large file support")
endif(FILE64_OK AND FSEEKO_COMPILE_OK) endif()
endif("${VARIABLE}" MATCHES "^${VARIABLE}$") endif()
endmacro(OPJ_TEST_LARGE_FILES VARIABLE) endmacro()

View File

@ -11,12 +11,12 @@ cmake_minimum_required(VERSION 2.6)
if(COMMAND CMAKE_POLICY) if(COMMAND CMAKE_POLICY)
cmake_policy(SET CMP0003 NEW) cmake_policy(SET CMP0003 NEW)
endif(COMMAND CMAKE_POLICY) endif()
if(NOT OPENJPEG_NAMESPACE) if(NOT OPENJPEG_NAMESPACE)
set(OPENJPEG_NAMESPACE "OPENJPEG") set(OPENJPEG_NAMESPACE "OPENJPEG")
set(OPENJPEG_STANDALONE 1) set(OPENJPEG_STANDALONE 1)
endif(NOT OPENJPEG_NAMESPACE) endif()
# In all cases: # In all cases:
string(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME) string(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME)
@ -65,11 +65,11 @@ if(WIN32)
-D_CRT_VCCLRIT_NO_DEPRECATE -D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE
) )
endif(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS) endif()
endif(NOT MINGW) endif()
endif(NOT CYGWIN) endif()
endif(NOT BORLAND) endif()
endif(WIN32) endif()
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
@ -80,38 +80,38 @@ set(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG
if(NOT OPENJPEG_INSTALL_BIN_DIR) if(NOT OPENJPEG_INSTALL_BIN_DIR)
set(OPENJPEG_INSTALL_BIN_DIR "bin") set(OPENJPEG_INSTALL_BIN_DIR "bin")
endif(NOT OPENJPEG_INSTALL_BIN_DIR) endif()
if(NOT OPENJPEG_INSTALL_LIB_DIR) if(NOT OPENJPEG_INSTALL_LIB_DIR)
set(OPENJPEG_INSTALL_LIB_DIR "lib") set(OPENJPEG_INSTALL_LIB_DIR "lib")
endif(NOT OPENJPEG_INSTALL_LIB_DIR) endif()
if(NOT OPENJPEG_INSTALL_SHARE_DIR) if(NOT OPENJPEG_INSTALL_SHARE_DIR)
set(OPENJPEG_INSTALL_SHARE_DIR "share") set(OPENJPEG_INSTALL_SHARE_DIR "share")
endif(NOT OPENJPEG_INSTALL_SHARE_DIR) endif()
if(NOT OPENJPEG_INSTALL_DATA_DIR) if(NOT OPENJPEG_INSTALL_DATA_DIR)
set(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}") set(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
endif(NOT OPENJPEG_INSTALL_DATA_DIR) endif()
if(NOT OPENJPEG_INSTALL_INCLUDE_DIR) if(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
set(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}") set(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}")
endif(NOT OPENJPEG_INSTALL_INCLUDE_DIR) endif()
if(NOT OPENJPEG_INSTALL_MAN_DIR) if(NOT OPENJPEG_INSTALL_MAN_DIR)
set(OPENJPEG_INSTALL_MAN_DIR "share/man/") set(OPENJPEG_INSTALL_MAN_DIR "share/man/")
endif(NOT OPENJPEG_INSTALL_MAN_DIR) endif()
if(NOT OPENJPEG_INSTALL_DOC_DIR) if(NOT OPENJPEG_INSTALL_DOC_DIR)
set(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}") set(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}")
endif(NOT OPENJPEG_INSTALL_DOC_DIR) endif()
if(NOT OPENJPEG_INSTALL_PACKAGE_DIR) if(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
# We could install *.cmake files in share/ however those files contains # We could install *.cmake files in share/ however those files contains
# hardcoded path to libraries on a multi-arch system (fedora/debian) those # hardcoded path to libraries on a multi-arch system (fedora/debian) those
# path will be different (lib/i386-linux-gnu vs lib/x86_64-linux-gnu) # path will be different (lib/i386-linux-gnu vs lib/x86_64-linux-gnu)
set(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}") set(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
endif(NOT OPENJPEG_INSTALL_PACKAGE_DIR) endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Big endian test: # Big endian test:
@ -141,7 +141,7 @@ set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in
${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h ${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h
@ONLY) @ONLY)
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# pkgconfig support # pkgconfig support
@ -154,7 +154,7 @@ if(UNIX)
install( CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink install( CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
\"libopenjpeg1.pc\" \"libopenjpeg1.pc\"
\"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_SHARE_DIR}/pkgconfig/libopenjpeg.pc\")") \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_SHARE_DIR}/pkgconfig/libopenjpeg.pc\")")
endif(UNIX) endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Compiler specific flags: # Compiler specific flags:
@ -163,7 +163,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
# set(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build. # set(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
# Do not use ffast-math for all build, it would produce incorrect results, only set for release: # Do not use ffast-math for all build, it would produce incorrect results, only set for release:
set(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}")
endif(CMAKE_COMPILER_IS_GNUCC) endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# opj_config.h generation (1/2) # opj_config.h generation (1/2)
@ -195,7 +195,7 @@ option(BUILD_JPWL "Build the JPWL library and executables" OFF)
option(BUILD_JPIP "Build the JPIP library and executables." OFF) option(BUILD_JPIP "Build the JPIP library and executables." OFF)
if(BUILD_JPIP) if(BUILD_JPIP)
option(BUILD_JPIP_SERVER "Build the JPIP server." OFF) option(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
endif(BUILD_JPIP) endif()
option(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF) option(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF)
option(BUILD_JAVA "Build the openjpeg jar (Java)" OFF) option(BUILD_JAVA "Build the openjpeg jar (Java)" OFF)
mark_as_advanced(BUILD_VIEWER) mark_as_advanced(BUILD_VIEWER)
@ -207,7 +207,7 @@ if(BUILD_CODEC OR BUILD_MJ2)
option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF) option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
add_subdirectory(thirdparty) add_subdirectory(thirdparty)
add_subdirectory(applications) add_subdirectory(applications)
endif (BUILD_CODEC OR BUILD_MJ2) endif ()
include(CheckTypeSize) include(CheckTypeSize)
CHECK_TYPE_SIZE(ssize_t SSIZE_T) CHECK_TYPE_SIZE(ssize_t SSIZE_T)
@ -226,7 +226,7 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/opj_config.h
option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF) option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
if(BUILD_DOC) if(BUILD_DOC)
add_subdirectory(doc) add_subdirectory(doc)
endif(BUILD_DOC) endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Buld Testing # Buld Testing
@ -248,10 +248,10 @@ if(BUILD_TESTING)
# Add repository where to find tests # Add repository where to find tests
add_subdirectory(tests) add_subdirectory(tests)
else(BUILD_CODEC) else()
message(FATAL_ERROR "You need build codec to run the tests") message(FATAL_ERROR "You need build codec to run the tests")
endif(BUILD_CODEC) endif()
endif(BUILD_TESTING) endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# install all targets referenced as OPENJPEGTargets # install all targets referenced as OPENJPEGTargets
@ -268,7 +268,7 @@ install( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
# install CHANGES and LICENSE # install CHANGES and LICENSE
if(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES) if(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
install(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR}) install(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
endif(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES) endif()
install(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR}) install(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
include (CMake/OpenJPEGCPack.cmake) include (CMake/OpenJPEGCPack.cmake)

View File

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

View File

@ -21,10 +21,10 @@ include_directories(
if(WIN32) if(WIN32)
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS) add_definitions(-DOPJ_EXPORTS)
else(BUILD_SHARED_LIBS) else()
add_definitions(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
endif(BUILD_SHARED_LIBS) endif()
endif(WIN32) endif()
# Loop over all executables: # Loop over all executables:
foreach(exe j2k_to_image image_to_j2k j2k_dump) foreach(exe j2k_to_image image_to_j2k j2k_dump)
@ -37,18 +37,18 @@ foreach(exe j2k_to_image image_to_j2k j2k_dump)
target_link_libraries(${exe} z) target_link_libraries(${exe} z)
ELSe(ZLIB_FOUND AND APPLE) ELSe(ZLIB_FOUND AND APPLE)
target_link_libraries(${exe} ${Z_LIBNAME}) target_link_libraries(${exe} ${Z_LIBNAME})
endif(ZLIB_FOUND AND APPLE) endif()
# On unix you need to link to the math library: # On unix you need to link to the math library:
if(UNIX) if(UNIX)
target_link_libraries(${exe} m) target_link_libraries(${exe} m)
endif(UNIX) endif()
# Install exe # Install exe
install(TARGETS ${exe} install(TARGETS ${exe}
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )
endforeach(exe) endforeach()
# Install man pages # Install man pages
install( install(
@ -77,11 +77,11 @@ if(BUILD_JPWL)
target_link_libraries(JPWL_j2k_to_image z) target_link_libraries(JPWL_j2k_to_image z)
ELSe(ZLIB_FOUND AND APPLE) ELSe(ZLIB_FOUND AND APPLE)
target_link_libraries(JPWL_j2k_to_image ${Z_LIBNAME}) target_link_libraries(JPWL_j2k_to_image ${Z_LIBNAME})
endif(ZLIB_FOUND AND APPLE) endif()
if(UNIX) if(UNIX)
target_link_libraries(JPWL_j2k_to_image m) target_link_libraries(JPWL_j2k_to_image m)
endif(UNIX) endif()
add_executable(JPWL_image_to_j2k add_executable(JPWL_image_to_j2k
image_to_j2k.c image_to_j2k.c
@ -101,13 +101,13 @@ if(BUILD_JPWL)
target_link_libraries(JPWL_image_to_j2k z) target_link_libraries(JPWL_image_to_j2k z)
ELSe(ZLIB_FOUND AND APPLE) ELSe(ZLIB_FOUND AND APPLE)
target_link_libraries(JPWL_image_to_j2k ${Z_LIBNAME}) target_link_libraries(JPWL_image_to_j2k ${Z_LIBNAME})
endif(ZLIB_FOUND AND APPLE) endif()
if(UNIX) if(UNIX)
target_link_libraries(JPWL_image_to_j2k m) target_link_libraries(JPWL_image_to_j2k m)
endif(UNIX) endif()
install(TARGETS JPWL_image_to_j2k JPWL_j2k_to_image install(TARGETS JPWL_image_to_j2k JPWL_j2k_to_image
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )
endif(BUILD_JPWL) endif()

View File

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

View File

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

View File

@ -31,14 +31,14 @@ if(BUILD_JPIP_SERVER)
# On unix you need to link to the math library: # On unix you need to link to the math library:
if(UNIX) if(UNIX)
target_link_libraries(opj_server m) target_link_libraries(opj_server m)
endif(UNIX) endif()
# Install exe # Install exe
install(TARGETS opj_server install(TARGETS opj_server
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )
endif(BUILD_JPIP_SERVER) endif()
set(EXES set(EXES
opj_dec_server opj_dec_server
@ -53,7 +53,7 @@ foreach(exe ${EXES})
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )
endforeach(exe) endforeach()
# Build the two java clients: # Build the two java clients:
find_package(Java 1.5 COMPONENTS Development) # javac, jar find_package(Java 1.5 COMPONENTS Development) # javac, jar
@ -145,6 +145,6 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
) )
endif() endif()
else(Java_Development_FOUND) else()
message(WARNING "No java compiler found. Wont be able to build java viewer") message(WARNING "No java compiler found. Wont be able to build java viewer")
endif() endif()

View File

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

View File

@ -19,8 +19,8 @@ if(DOXYGEN_FOUND)
add_custom_target(doc ALL add_custom_target(doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox) ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox)
else(DOXYGEN_FOUND) else()
message(STATUS "Doxygen not found, we cannot generate the documentation") message(STATUS "Doxygen not found, we cannot generate the documentation")
endif(DOXYGEN_FOUND) endif()

View File

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

View File

@ -8,7 +8,7 @@ if(APPLE)
rs.c rs.c
PROPERTIES PROPERTIES
COMPILE_FLAGS -fno-common) COMPILE_FLAGS -fno-common)
endif(APPLE) endif()
include_directories( include_directories(
${OPENJPEG_SOURCE_DIR}/libopenjpeg ${OPENJPEG_SOURCE_DIR}/libopenjpeg
@ -18,10 +18,10 @@ include_directories(
if(WIN32) if(WIN32)
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS) add_definitions(-DOPJ_EXPORTS)
else(BUILD_SHARED_LIBS) else()
add_definitions(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
endif(BUILD_SHARED_LIBS) endif()
endif(WIN32) endif()
add_library(${OPENJPEG_LIBRARY_NAME}_JPWL ${JPWL_SRCS} ${OPENJPEG_SRCS}) add_library(${OPENJPEG_LIBRARY_NAME}_JPWL ${JPWL_SRCS} ${OPENJPEG_SRCS})
set_target_properties(${OPENJPEG_LIBRARY_NAME}_JPWL set_target_properties(${OPENJPEG_LIBRARY_NAME}_JPWL
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES}) PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})

View File

@ -30,7 +30,7 @@ if(ZLIB_FOUND AND APPLE)
target_link_libraries(comparePGXimages z) target_link_libraries(comparePGXimages z)
ELSe(ZLIB_FOUND AND APPLE) ELSe(ZLIB_FOUND AND APPLE)
target_link_libraries(comparePGXimages ${Z_LIBNAME}) target_link_libraries(comparePGXimages ${Z_LIBNAME})
endif(ZLIB_FOUND AND APPLE) endif()
add_executable(compare_dump_files ${compare_dump_files_SRCS}) add_executable(compare_dump_files ${compare_dump_files_SRCS})
@ -63,7 +63,7 @@ set_property(TEST ttd2 APPEND PROPERTY DEPENDS tte2)
# No image send to the dashboard if lib PNG is not available. # No image send to the dashboard if lib PNG is not available.
if(NOT HAVE_LIBPNG) if(NOT HAVE_LIBPNG)
message(WARNING "Lib PNG seems to be not available: if you want run the non-regression tests with images reported to the dashboard, you need it (try BUILD_THIRDPARTY)") message(WARNING "Lib PNG seems to be not available: if you want run the non-regression tests with images reported to the dashboard, you need it (try BUILD_THIRDPARTY)")
endif(NOT HAVE_LIBPNG) endif()
add_subdirectory(conformance) add_subdirectory(conformance)
add_subdirectory(nonregression) add_subdirectory(nonregression)
@ -76,5 +76,5 @@ if(BUILD_JPIP)
set(md5 "62b00c620fb0a600c5ffd413cada4674") set(md5 "62b00c620fb0a600c5ffd413cada4674")
add_test(TestJPIP1 ${CMAKE_COMMAND} -DD_URL:STRING=${s} -DD_FILE:PATH=${p} add_test(TestJPIP1 ${CMAKE_COMMAND} -DD_URL:STRING=${s} -DD_FILE:PATH=${p}
-DEXPECTED_MD5=${md5} -P ${PROJECT_SOURCE_DIR}/CMake/JPIPTestDriver.cmake) -DEXPECTED_MD5=${md5} -P ${PROJECT_SOURCE_DIR}/CMake/JPIPTestDriver.cmake)
endif(JPIP_SERVER) endif()
endif(BUILD_JPIP) endif()

View File

@ -33,10 +33,10 @@ foreach(numFileC0P0 RANGE 1 16)
if(${numFileC0P0} LESS 10) if(${numFileC0P0} LESS 10)
set( filenameInput p0_0${numFileC0P0}.j2k ) set( filenameInput p0_0${numFileC0P0}.j2k )
set( filenameRef c0p0_0${numFileC0P0}.pgx ) set( filenameRef c0p0_0${numFileC0P0}.pgx )
else(${numFileC0P0} LESS 10) else()
set( filenameInput p0_${numFileC0P0}.j2k ) set( filenameInput p0_${numFileC0P0}.j2k )
set( filenameRef c0p0_${numFileC0P0}.pgx ) set( filenameRef c0p0_${numFileC0P0}.pgx )
endif(${numFileC0P0} LESS 10) endif()
# Get corresponding tests parameters # Get corresponding tests parameters
list(GET C0P0_ResFactor_list ${numFileC0P0} ResFactor) list(GET C0P0_ResFactor_list ${numFileC0P0} ResFactor)
@ -118,7 +118,7 @@ foreach(numFileC0P0 RANGE 1 16)
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-r1-decode) ETS-C0P0-${filenameInput}-r1-decode)
else(numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15) else()
add_test(ETS-C0P0-${filenameInput}-decode add_test(ETS-C0P0-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
@ -154,9 +154,9 @@ foreach(numFileC0P0 RANGE 1 16)
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P0-${filenameInput}-decode) ETS-C0P0-${filenameInput}-decode)
endif(numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15) endif()
endforeach(numFileC0P0) endforeach()
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about class 0 profile 1 # Tests about class 0 profile 1
@ -255,7 +255,7 @@ foreach(numFileC0P1 RANGE 1 7)
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-r3-decode) ETS-C0P1-${filenameInput}-r3-decode)
else(numFileC0P1 EQUAL 4) else()
add_test(ETS-C0P1-${filenameInput}-decode add_test(ETS-C0P1-${filenameInput}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
@ -291,9 +291,9 @@ foreach(numFileC0P1 RANGE 1 7)
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C0P1-${filenameInput}-decode) ETS-C0P1-${filenameInput}-decode)
endif(numFileC0P1 EQUAL 4) endif()
endforeach(numFileC0P1) endforeach()
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about class 1 profile 0 # Tests about class 1 profile 0
@ -312,10 +312,10 @@ foreach(numFileC1P0 RANGE 1 16)
if(${numFileC1P0} LESS 10) if(${numFileC1P0} LESS 10)
set( filenameInput p0_0${numFileC1P0}.j2k ) set( filenameInput p0_0${numFileC1P0}.j2k )
set( filenameRef c1p0_0${numFileC1P0}.pgx ) set( filenameRef c1p0_0${numFileC1P0}.pgx )
else(${numFileC1P0} LESS 10) else()
set( filenameInput p0_${numFileC1P0}.j2k ) set( filenameInput p0_${numFileC1P0}.j2k )
set( filenameRef c1p0_${numFileC1P0}.pgx ) set( filenameRef c1p0_${numFileC1P0}.pgx )
endif(${numFileC1P0} LESS 10) endif()
# Get corresponding tests parameters # Get corresponding tests parameters
list(GET CP0_nbC_list ${numFileC1P0} nbComponents) list(GET CP0_nbC_list ${numFileC1P0} nbComponents)
@ -357,7 +357,7 @@ foreach(numFileC1P0 RANGE 1 16)
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C1P0-${filenameInput}-decode) ETS-C1P0-${filenameInput}-decode)
endforeach(numFileC1P0) endforeach()
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about class 1 profile 1 # Tests about class 1 profile 1
@ -414,7 +414,7 @@ foreach(numFileC1P1 RANGE 1 7)
PROPERTIES DEPENDS PROPERTIES DEPENDS
ETS-C1P1-${filenameInput}-decode) ETS-C1P1-${filenameInput}-decode)
endforeach(numFileC1P1) endforeach()
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about JP2 file # Tests about JP2 file
@ -463,7 +463,7 @@ foreach(numFileJP2 RANGE 1 9)
# PROPERTIES DEPENDS # PROPERTIES DEPENDS
# ETS-JP2-${filenameInput}-decode) # ETS-JP2-${filenameInput}-decode)
endforeach(numFileJP2) endforeach()
#--------------------------------------------------------------------------# #--------------------------------------------------------------------------#
#--------------------------------------------------------------------------# #--------------------------------------------------------------------------#
@ -479,9 +479,9 @@ foreach(numFileP0 RANGE 1 16)
# Build filenames # Build filenames
if(${numFileP0} LESS 10) if(${numFileP0} LESS 10)
set( filenameInput p0_0${numFileP0}.j2k ) set( filenameInput p0_0${numFileP0}.j2k )
else(${numFileP0} LESS 10) else()
set( filenameInput p0_${numFileP0}.j2k ) set( filenameInput p0_${numFileP0}.j2k )
endif(${numFileP0} LESS 10) endif()
get_filename_component(filenameRefSub ${filenameInput} NAME_WE) get_filename_component(filenameRefSub ${filenameInput} NAME_WE)
@ -501,7 +501,7 @@ foreach(numFileP0 RANGE 1 16)
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-${filenameInput}-dump) NR-${filenameInput}-dump)
endforeach(numFileP0) endforeach()
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about dump of profile 1 file # Tests about dump of profile 1 file
@ -530,7 +530,7 @@ foreach(numFileP1 RANGE 1 7)
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-${filenameInput}-dump) NR-${filenameInput}-dump)
endforeach(numFileP1) endforeach()
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Tests about dump of JP2 file # Tests about dump of JP2 file
@ -559,4 +559,4 @@ foreach(numFileJP2 RANGE 1 9)
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-${filenameInput}-dump) NR-${filenameInput}-dump)
endforeach(numFileJP2) endforeach()

View File

@ -47,7 +47,7 @@ foreach(INPUT_FILENAME ${OPJ_DATA_NR_LIST})
set_tests_properties(NR-${INPUT_FILENAME_NAME}-dump set_tests_properties(NR-${INPUT_FILENAME_NAME}-dump
PROPERTIES WILL_FAIL TRUE) PROPERTIES WILL_FAIL TRUE)
else(bad_jpeg2000) else()
# Compare the dump output with the baseline # Compare the dump output with the baseline
add_test(NR-${INPUT_FILENAME_NAME}-compare_dump2base add_test(NR-${INPUT_FILENAME_NAME}-compare_dump2base
@ -59,9 +59,9 @@ foreach(INPUT_FILENAME ${OPJ_DATA_NR_LIST})
set_tests_properties(NR-${INPUT_FILENAME_NAME}-compare_dump2base set_tests_properties(NR-${INPUT_FILENAME_NAME}-compare_dump2base
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-${INPUT_FILENAME_NAME}-dump) NR-${INPUT_FILENAME_NAME}-dump)
endif(bad_jpeg2000) endif()
endforeach(INPUT_FILENAME) endforeach()
######################################################################### #########################################################################
@ -98,15 +98,15 @@ if (TEST_SUITE_FILES)
# Append the list of command # Append the list of command
set(OPJ_TEST_CMD_LINE_LIST ${OPJ_TEST_CMD_LINE_LIST} ${OPJ_TEST_CMD_LINE_LIST_TEMP}) set(OPJ_TEST_CMD_LINE_LIST ${OPJ_TEST_CMD_LINE_LIST} ${OPJ_TEST_CMD_LINE_LIST_TEMP})
endif(NOT FILE_ALREADY_READ) endif()
endforeach(TEST_SUITE_FILE) endforeach()
else(TEST_SUITE_FILES) else()
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()
# Parse the command line found in the file(s) # Parse the command line found in the file(s)
@ -124,13 +124,13 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
if(EXE_NAME) if(EXE_NAME)
string(REGEX MATCH "^#" IGNORE_LINE_FOUND ${EXE_NAME}) string(REGEX MATCH "^#" IGNORE_LINE_FOUND ${EXE_NAME})
endif(EXE_NAME) endif()
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()
# Check if the first argument begin by the failed sign # Check if the first argument begin by the failed sign
set(FAILED_TEST_FOUND 0) set(FAILED_TEST_FOUND 0)
@ -145,7 +145,7 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
list(REMOVE_AT CMD_ARG_LIST 0) list(REMOVE_AT CMD_ARG_LIST 0)
else (FAILED_TEST_FOUND_1) else ()
set(FAILED_TEST_FOUND_2 0) set(FAILED_TEST_FOUND_2 0)
list(GET CMD_ARG_LIST 1 EXE_NAME) list(GET CMD_ARG_LIST 1 EXE_NAME)
@ -156,14 +156,14 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
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 ()
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 ()
endif (FAILED_TEST_FOUND_1) endif ()
else (FAILED_TEST_FOUND) else ()
# Check if the first argument is equal to image_to_j2k # Check if the first argument is equal to image_to_j2k
string(REGEX MATCH "^image_to_j2k$|^j2k_to_image$" EXE_NAME_FOUND ${EXE_NAME}) string(REGEX MATCH "^image_to_j2k$|^j2k_to_image$" EXE_NAME_FOUND ${EXE_NAME})
@ -171,15 +171,15 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
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()
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()
list(REMOVE_AT CMD_ARG_LIST 0) list(REMOVE_AT CMD_ARG_LIST 0)
endif (FAILED_TEST_FOUND) endif ()
# Parse the argument list to find the input filename and output filename # Parse the argument list to find the input filename and output filename
set(CMD_ARG_LIST_2 "") set(CMD_ARG_LIST_2 "")
@ -195,17 +195,17 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
if(INPUT_ARG_FOUND) if(INPUT_ARG_FOUND)
set(INPUT_ARG_POS ${ARG_POS}) set(INPUT_ARG_POS ${ARG_POS})
set(INPUT_ARG_FOUND 0) set(INPUT_ARG_FOUND 0)
endif(INPUT_ARG_FOUND) endif()
string(COMPARE EQUAL ${CMD_ARG_ELT} "-o" OUTPUT_ARG_FOUND) string(COMPARE EQUAL ${CMD_ARG_ELT} "-o" OUTPUT_ARG_FOUND)
if(OUTPUT_ARG_FOUND) if(OUTPUT_ARG_FOUND)
set(OUTPUT_ARG_POS ${ARG_POS}) set(OUTPUT_ARG_POS ${ARG_POS})
set(OUTPUT_ARG_FOUND 0) set(OUTPUT_ARG_FOUND 0)
endif(OUTPUT_ARG_FOUND) endif()
list (APPEND CMD_ARG_LIST_2 ${CMD_ARG_ELT}) list (APPEND CMD_ARG_LIST_2 ${CMD_ARG_ELT})
endforeach(CMD_ARG_ELT) endforeach()
list(GET CMD_ARG_LIST_2 ${INPUT_ARG_POS} INPUT_FILENAME) list(GET CMD_ARG_LIST_2 ${INPUT_ARG_POS} INPUT_FILENAME)
get_filename_component(INPUT_FILENAME_NAME ${INPUT_FILENAME} NAME) get_filename_component(INPUT_FILENAME_NAME ${INPUT_FILENAME} NAME)
@ -229,7 +229,7 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
if(FAILED_TEST_FOUND) if(FAILED_TEST_FOUND)
set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode PROPERTIES WILL_FAIL TRUE) set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode PROPERTIES WILL_FAIL TRUE)
else(FAILED_TEST_FOUND) else()
# Dump the encoding file # Dump the encoding file
add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump add_test(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump
@ -276,10 +276,10 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref) NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref)
endif() endif()
endif(FAILED_TEST_FOUND) endif()
# DECODER TEST SUITE # DECODER TEST SUITE
else(ENC_TEST_FOUND) else()
math(EXPR IT_TEST_DEC "${IT_TEST_DEC}+1" ) math(EXPR IT_TEST_DEC "${IT_TEST_DEC}+1" )
# Decode the input image # Decode the input image
@ -292,7 +292,7 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
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()
# FIXME: add a compare2base function base on raw which # FIXME: add a compare2base function base on raw which
# can output png diff files if necesary # can output png diff files if necesary
@ -309,10 +309,10 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
# PROPERTIES DEPENDS # PROPERTIES DEPENDS
# NR-${filename}-decode) # NR-${filename}-decode)
endif(FAILED_TEST_FOUND) endif()
endif(ENC_TEST_FOUND) endif()
endif(IGNORE_LINE_FOUND OR NOT EXE_NAME) endif()
endforeach(OPJ_TEST_CMD_LINE) endforeach()