Skip to content

Commit b923b7d

Browse files
authored
TIFF: update to v4.7.0-p0 (#813)
Unpinn OpenCV 4.10 because TIFF 4.7.0 fixes build issues on Linux. Fixes: #765 Remove old `FindTIFF.cmake` module. Not needed anymore (and probably wasn't needed for a long time). Update to use https://github.com/cpp-pm/libtiff/releases/tag/v4.7.0-p0 hunterized dependencies: - `zlib`: default ON, only dependency available in previous 4.0.2 hunterized version) - `libdeflate`: default: ON, available in Hunter starting with `v0.26.3` #804 - `jpeg`: default OFF, newly hunterized - `lzma`: default OFF, newly hunterized - `zstd`: default OFF, newly hunterized Not hunterized dependencies: - `jbig=OFF` - `lerc=OFF` - `webp=OFF` Update the TIFF example to use use `stdio.h` `remove()` instead of `unlink()`. Fixes: #789
1 parent 2af7b4f commit b923b7d

File tree

5 files changed

+42
-95
lines changed

5 files changed

+42
-95
lines changed

cmake/configs/default.cmake

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,8 @@ hunter_default_version(OpenBLAS VERSION 0.3.27)
103103
hunter_default_version(OpenCL VERSION 2022.01.04-p1)
104104
hunter_default_version(OpenCL-Headers VERSION 2022.01.04)
105105
hunter_default_version(OpenCL-cpp VERSION 2.0.16-61a5c9a-p0)
106-
if(MSVC)
107-
hunter_default_version(OpenCV VERSION 4.10.0-p0)
108-
hunter_default_version(OpenCV-Extra VERSION 4.10.0)
109-
else()
110-
# 4.10.0 has a build problem with TIFF header defines
111-
hunter_default_version(OpenCV VERSION 4.8.1-p0)
112-
hunter_default_version(OpenCV-Extra VERSION 4.8.1)
113-
endif()
106+
hunter_default_version(OpenCV VERSION 4.10.0-p0)
107+
hunter_default_version(OpenCV-Extra VERSION 4.10.0)
114108
hunter_default_version(OpenEXR VERSION 3.1.5-p0)
115109
hunter_default_version(OpenGL-Registry VERSION 0.0.0-d15191e-p0)
116110
hunter_default_version(OpenNMTTokenizer VERSION 1.11.0-p1)
@@ -157,7 +151,7 @@ hunter_default_version(Sober VERSION 0.1.3)
157151
hunter_default_version(Sqlpp11 VERSION 0.57-p0)
158152
hunter_default_version(SuiteSparse VERSION 7.5.1-1)
159153
hunter_default_version(TCLAP VERSION 1.2.2-p1)
160-
hunter_default_version(TIFF VERSION 4.0.2-p5)
154+
hunter_default_version(TIFF VERSION 4.7.0-p0)
161155
hunter_default_version(Tesseract VERSION 3.05.01-hunter-3)
162156
hunter_default_version(Urho3D VERSION 1.7-p15)
163157
hunter_default_version(Vulkan-Headers VERSION 1.2.182-p0)

cmake/find/FindTIFF.cmake

Lines changed: 0 additions & 62 deletions
This file was deleted.

cmake/projects/TIFF/hunter.cmake

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
include(hunter_add_version)
77
include(hunter_cacheable)
8+
include(hunter_cmake_args)
89
include(hunter_download)
910
include(hunter_pick_scheme)
1011

@@ -74,6 +75,37 @@ hunter_add_version(
7475
7bee2843b47c5f9865973b7235e58aa3fb26e1b0
7576
)
7677

78+
hunter_add_version(
79+
PACKAGE_NAME
80+
TIFF
81+
VERSION
82+
"4.7.0-p0"
83+
URL
84+
"https://github.com/cpp-pm/libtiff/archive/v4.7.0-p0.tar.gz"
85+
SHA1
86+
a9289150caba29de303070275b57ea087a146c80
87+
)
88+
89+
hunter_cmake_args(
90+
TIFF
91+
CMAKE_ARGS
92+
tiff-tools=OFF
93+
tiff-tests=OFF
94+
tiff-docs=OFF
95+
tiff-openGL=OFF
96+
zlib=ON
97+
libdeflate=ON # since 4.7.0-p0
98+
#pixarlog=ON # don't set, available only with ZLIB=ON, no additional dependency
99+
jpeg=OFF # available since 4.7.0-p0
100+
#old-jpeg=ON # determined based on jpeg
101+
#jpeg12=OFF # determined based on jpeg
102+
jbig=OFF # not implemented in 4.7.0-p0
103+
lerc=OFF # not implemented in 4.7.0-p0
104+
lzma=OFF # available since 4.7.0-p0
105+
zstd=OFF # not implemented in 4.7.0-p0
106+
webp=OFF # not implemented in 4.7.0-p0
107+
)
108+
77109
hunter_pick_scheme(DEFAULT url_sha1_cmake)
78110
hunter_cacheable(TIFF)
79111
hunter_download(PACKAGE_NAME TIFF)

examples/TIFF/CMakeLists.txt

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) 2014, Ruslan Baratov
2+
# Copyright (c) 2025, NeroBurner
23
# All rights reserved.
34

45
cmake_minimum_required(VERSION 3.10)
@@ -9,27 +10,15 @@ include("../common.cmake")
910

1011
project(download-tiff)
1112

12-
# download gtest
13+
# download TIFF
1314
hunter_add_package(TIFF)
1415

15-
# now gtest can be used
16+
# now TIFF can be used
1617
find_package(TIFF CONFIG REQUIRED)
1718

1819
add_executable(foo main.c)
19-
target_link_libraries(foo TIFF::libtiff)
20+
target_link_libraries(foo PRIVATE TIFF::libtiff)
2021

2122
# Compatibility mode
22-
find_package(TIFF REQUIRED)
23-
24-
string(COMPARE EQUAL "${TIFF_INCLUDE_DIR}" "" is_empty)
25-
if(is_empty)
26-
message(FATAL_ERROR "Expected non-empty")
27-
endif()
28-
29-
string(COMPARE EQUAL "${TIFF_LIBRARIES}" "TIFF::libtiff" is_good)
30-
if(NOT is_good)
31-
message(FATAL_ERROR "Expected TIFF::libtiff but got: ${TIFF_LIBRARIES}")
32-
endif()
33-
34-
include_directories(${TIFF_INCLUDE_DIR})
35-
target_link_libraries(foo ${TIFF_LIBRARIES})
23+
# try to find another time to check if package is well behaved
24+
find_package(TIFF CONFIG REQUIRED)

examples/TIFF/main.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,9 @@
2929
* Module to test ASCII tags read/write functions.
3030
*/
3131

32-
#include "tif_config.h"
33-
3432
#include <stdio.h>
3533
#include <string.h>
3634

37-
#ifdef HAVE_UNISTD_H
38-
# include <unistd.h>
39-
#endif
40-
4135
#include "tiffio.h"
4236

4337
static const char filename[] = "ascii_test.tiff";
@@ -162,7 +156,7 @@ main()
162156
TIFFClose(tif);
163157

164158
/* All tests passed; delete file and exit with success status. */
165-
unlink(filename);
159+
remove(filename);
166160
return 0;
167161

168162
failure:

0 commit comments

Comments
 (0)