Browse Source

- adapted README.windows to compile it with cmake

- added improved missed TIFF_INT64 workaround
- added compatibility flag for MingW
tags/v0.1.2
Andreas Romeyke 2 years ago
parent
commit
fce86f65f9
2 changed files with 29 additions and 4 deletions
  1. +4
    -1
      README.windows
  2. +25
    -3
      src/CMakeLists.txt

+ 4
- 1
README.windows View File

@@ -19,5 +19,8 @@ Crosscompiling to Windows
== fixit_tiff ==
* now compile fixit-tool
** cd to fixit-tool directory
** CC="i686-w64-mingw32-gcc" INC="-I ../tiff-4.0.6/libtiff/ -L ../tiff-4.0.6/libtiff/.libs/ -static" make
** mkdir build_windows
** cd build_windows
** cmake -DCMAKE_TOOLCHAIN_FILE=../src/toolchain-mingw32.cmake -DTIFF_LIBRARY=~/Downloads/tiff-4.0.6/libtiff/.libs/libtiff.a -DTIFF_INCLUDE_DIR=~/Downloads/tiff-4.0.6/libtiff/ ../src/
** make


+ 25
- 3
src/CMakeLists.txt View File

@@ -15,7 +15,7 @@ execute_process( COMMAND git rev-parse HEAD OUTPUT_VARIABLE BUILD_REV_ID OUTPUT_
execute_process( COMMAND git describe --long --tags --dirty --always OUTPUT_VARIABLE BUILD_REV_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)
add_definitions(-DVERSION="${BUILD_BRANCH}")
add_definitions(-DREPO_REVISION="${REPO_REVISION}")
add_definitions(-std=gnu11)
if(WIN32)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(BUILD_SHARED_LIBRARIES OFF)
@@ -59,13 +59,35 @@ if(TIFF_FOUND)
CHECK_SYMBOL_EXISTS(TIFF_UINT64_T "tiff.h" HAVE_TIFF_UINT64_T)
IF(NOT HAVE_TIFF_UINT64_T)
MESSAGE(STATUS "old tiff library detected, -Duint64='unsigned long long' added")
ADD_DEFINITIONS(-Duint64=unsigned\ long\ long)

if(SIZEOF_UNSIGNED_LONG EQUAL 8)
set(TIFF_UINT64_T "unsigned long")
set(TIFF_UINT64_FORMAT "%lu")
elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL 8)
set(TIFF_UINT64_T "unsigned long long")
if (MINGW)
set(TIFF_UINT64_FORMAT "%I64u")
else()
set(TIFF_UINT64_FORMAT "%llu")
endif()
endif()
ENDIF()

CHECK_SYMBOL_EXISTS(TIFF_INT64_T "tiff.h" HAVE_TIFF_INT64_T)
IF(NOT HAVE_TIFF_INT64_T)
MESSAGE(STATUS "old tiff library detected, -Dint64='long long' added")
ADD_DEFINITIONS(-Dint64=long\ long)
if(SIZEOF_SIGNED_LONG EQUAL 8)
set(TIFF_INT64_T "signed long")
set(TIFF_INT64_FORMAT "%ld")
elseif(SIZEOF_SIGNED_LONG_LONG EQUAL 8)
set(TIFF_INT64_T "signed long long")
if (MINGW)
set(TIFF_INT64_FORMAT "%I64d")
else()
set(TIFF_INT64_FORMAT "%lld")
endif()
endif()

ENDIF()

else(TIFF_FOUND)

Loading…
Cancel
Save