"checkit_tiff" is an incredibly fast conformance checker for baseline TIFFs (with various extensions), see http://andreas-romeyke.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 lines
2.7 KiB

  1. cmake_minimum_required (VERSION 2.6)
  2. project (checkit_tiff)
  3. include_directories("${PROJECT_SOURCE_DIR}/headers")
  4. file( GLOB checkit_tiff_SOURCES
  5. "${PROJECT_SOURCE_DIR}/tagrules/*.c"
  6. "${PROJECT_SOURCE_DIR}/ifdrules/*.c"
  7. "${PROJECT_SOURCE_DIR}/helper/*.c"
  8. "${PROJECT_SOURCE_DIR}/parser/*parser.c"
  9. )
  10. #
  11. # Make a version file containing the current version from git.
  12. #
  13. execute_process( COMMAND git rev-list HEAD --count OUTPUT_VARIABLE REPO_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE )
  14. execute_process( COMMAND git rev-parse --abbrev-ref HEAD OUTPUT_VARIABLE BUILD_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE)
  15. execute_process( COMMAND git rev-parse HEAD OUTPUT_VARIABLE BUILD_REV_ID OUTPUT_STRIP_TRAILING_WHITESPACE)
  16. execute_process( COMMAND git describe --long --tags --dirty --always OUTPUT_VARIABLE BUILD_REV_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)
  17. add_definitions(-DVERSION="${BUILD_BRANCH}")
  18. add_definitions(-DREPO_REVISION="${REPO_REVISION}")
  19. if(WIN32)
  20. SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
  21. SET(BUILD_SHARED_LIBRARIES OFF)
  22. SET(CMAKE_EXE_LINKER_FLAGS "-static")
  23. add_definitions(-DPCRE_STATIC)
  24. add_definitions(-D_POSIX_C_SOURCE=200809L)
  25. # FIXME: needed for MingW only
  26. add_definitions(-D_GNU_SOURCE=1)
  27. endif(WIN32)
  28. add_executable(checkit_tiff checkit_tiff.c ${checkit_tiff_SOURCES})
  29. ## libtiff 4
  30. find_package(TIFF REQUIRED)
  31. if(TIFF_FOUND)
  32. # Confirm required API is available
  33. #INCLUDE(CheckFunctionExists)
  34. SET(CMAKE_REQUIRED_LIBRARIES ${TIFF_LIBRARIES})
  35. #CHECK_FUNCTION_EXISTS(TIFFOpen HAVE_TIFFOPEN)
  36. #IF(NOT HAVE_TIFFOPEN)
  37. # SET(TIFF_FOUND) # ReSET to NOT found for TIFF library
  38. # MESSAGE(FATAL_ERROR "Failed to link with libtiff - TIFFOpen function not found")
  39. #ENDIF()
  40. # CHECK_FUNCTION_EXISTS(TIFFMergeFieldInfo HAVE_TIFFMERGEFIELDINFO)
  41. #IF(NOT HAVE_TIFFMERGEFIELDINFO)
  42. # SET(TIFF_FOUND) # ReSET to NOT found for TIFF library
  43. # MESSAGE(FATAL_ERROR "Failed to link with libtiff - TIFFMergeFieldInfo function not found. libtiff 3.6.0 Beta or later required. Please upgrade or use an older version of libgeotiff")
  44. #ENDIF()
  45. INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
  46. ADD_DEFINITIONS(-DHAVE_TIFF=1)
  47. else(TIFF_FOUND)
  48. MESSAGE(FATAL_ERROR "No TIFF library found, add $TIFF_INCLUDE_DIR manually")
  49. endif(TIFF_FOUND)
  50. #libpcre
  51. #find_package(LIBPCRE REQUIRED)
  52. FIND_PATH(PCRE_INCLUDE_DIR NAMES pcre.h)
  53. FIND_LIBRARY(PCRE_LIBRARY NAMES pcre)
  54. INCLUDE(FindPackageHandleStandardArgs)
  55. FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_INCLUDE_DIR)
  56. if (PCRE_FOUND)
  57. SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
  58. SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
  59. INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR})
  60. endif(PCRE_FOUND)
  61. TARGET_LINK_LIBRARIES(checkit_tiff ${TIFF_LIBRARIES} ${PCRE_LIBRARIES})