Browse Source

- added cmake checks to handle with old libtiff (for example used in Debian Wheezy)

- updated FAQ
pull/1/head
Andreas Romeyke 5 years ago
parent
commit
502044551b
2 changed files with 40 additions and 6 deletions
  1. +12
    -6
      FAQ
  2. +28
    -0
      src/CMakeLists.txt

+ 12
- 6
FAQ View File

@ -15,25 +15,31 @@ Q: My C-compiler reports error-messages like "cc: error: unrecognized command
line option '-fsanitze=undefined'"
A: You use an older GCC variant. Try 'SANITIZE="" make'
Q: The compiler reports, that the function TIFFFiledName does not exists. What
is the reason?
Q: The compiler reports, that the TIFFTAG_IMAGELAYER is undeclared, why?
A: You use an older version of the libtiff. If you cannot update, try this:
'CFLAGS="-DOLDTIFF" make', this enables an alternative in check_helper.c
'CFLAGS="-DTIFFTAG_IMAGELAYER=34732" make', alternatively use the cmake.
Q: How can I compile a windows version of your program?
A: I have only tested creating Windows executables using the crosscompiler
minGW under Debian Jessie, please see the instructions in
the ../README.windows file.
Q: I tried to compile with 'SANITIZE="-DOLDTIFF" make' under Debian Wheezy,
Q: I tried to compile with 'CFLAGS="-DOLDTIFF" make' under Debian Wheezy,
but I got the message "error: expected specifier-qualifier-list before
'uint64'", why?
A: You are using the Debian-package libtiff4-dev, but at least libtiff5-dev is
expected. The reason for the error was that the uint64 type is only defined
in newer tiff.h files.
in newer tiff.h files. Alternatively, use cmake.
Q: Where are older TIFF specs?
A: take a look to:
A: take a look to:
TIFF 4: https://web.archive.org/web/20050323073243/http://palimpsest.stanford.edu/bytopic/imaging/std/tiff4.html
TIFF 5: https://web.archive.org/web/20050323073243/http://palimpsest.stanford.edu/bytopic/imaging/std/tiff5.html
Q: I am using cmake, but it fails with "CMake Error: your CXX compiler:
"CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER
to a valid compiler path or name". But your program is C only, why I need a
C++compiler then?
A: cmake uses C++-compiler for its checks. Sorry, you need a C++ then.

+ 28
- 0
src/CMakeLists.txt View File

@ -1,6 +1,8 @@
cmake_minimum_required (VERSION 2.6)
project (checkit_tiff)
include_directories("${PROJECT_SOURCE_DIR}/headers")
include (CheckSymbolExists)
include (CheckTypeSize)
file( GLOB checkit_tiff_SOURCES
"${PROJECT_SOURCE_DIR}/tagrules/*.c"
@ -29,6 +31,26 @@ if(WIN32)
endif(WIN32)
add_executable(checkit_tiff checkit_tiff.c ${checkit_tiff_SOURCES})
set(CMAKE_EXTRA_INCLUDE_FILES stdint.h)
check_type_size(uint64 SIZEOF_UINT64)
set(CMAKE_EXTRA_INCLUDE_FILES)
if (SIZEOF_UINT64)
message(STATUS "size of 'uint64' is ${SIZEOF_UINT64}")
else ()
message(STATUS "size of 'uint64' NOT FOUND, setting -Duint64='unsigned long long'")
add_definitions(-Duint64=unsigned\ long\ long)
endif()
check_type_size(int64 SIZEOF_INT64)
set(CMAKE_EXTRA_INCLUDE_FILES)
if (SIZEOF_INT64)
message(STATUS "size of 'int64' is ${SIZEOF_INT64}")
else ()
message(STATUS "size of 'int64' NOT FOUND, setting -Dint64='long long'")
add_definitions(-Dint64=long\ long)
endif()
## libtiff 4
find_package(TIFF REQUIRED)
@ -49,6 +71,12 @@ if(TIFF_FOUND)
#ENDIF()
INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
ADD_DEFINITIONS(-DHAVE_TIFF=1)
CHECK_SYMBOL_EXISTS(TIFFTAG_IMAGELAYER "tiff.h" HAVE_TIFFTAG_IMAGE_LAYER)
IF(NOT HAVE_TIFFTAG_IMAGE_LAYER)
MESSAGE(STATUS "old tiff library detected, -DTIFFTAG_IMAGELAYER=34732 added")
ADD_DEFINITIONS(-DTIFFTAG_IMAGELAYER=34732)
ENDIF()
else(TIFF_FOUND)
MESSAGE(FATAL_ERROR "No TIFF library found, add $TIFF_INCLUDE_DIR manually")
endif(TIFF_FOUND)


Loading…
Cancel
Save