Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,8 @@ hunter_default_version(OpenBLAS VERSION 0.3.27)
hunter_default_version(OpenCL VERSION 2022.01.04-p1)
hunter_default_version(OpenCL-Headers VERSION 2022.01.04)
hunter_default_version(OpenCL-cpp VERSION 2.0.16-61a5c9a-p0)
if(MSVC)
hunter_default_version(OpenCV VERSION 4.10.0-p0)
hunter_default_version(OpenCV-Extra VERSION 4.10.0)
else()
# 4.10.0 has a build problem with TIFF header defines
hunter_default_version(OpenCV VERSION 4.8.1-p0)
hunter_default_version(OpenCV-Extra VERSION 4.8.1)
endif()
hunter_default_version(OpenCV VERSION 4.10.0-p0)
hunter_default_version(OpenCV-Extra VERSION 4.10.0)
hunter_default_version(OpenEXR VERSION 3.1.5-p0)
hunter_default_version(OpenGL-Registry VERSION 0.0.0-d15191e-p0)
hunter_default_version(OpenNMTTokenizer VERSION 1.11.0-p1)
Expand Down Expand Up @@ -157,7 +151,7 @@ hunter_default_version(Sober VERSION 0.1.3)
hunter_default_version(Sqlpp11 VERSION 0.57-p0)
hunter_default_version(SuiteSparse VERSION 7.5.1-1)
hunter_default_version(TCLAP VERSION 1.2.2-p1)
hunter_default_version(TIFF VERSION 4.0.2-p5)
hunter_default_version(TIFF VERSION 4.7.0-p0)
hunter_default_version(Tesseract VERSION 3.05.01-hunter-3)
hunter_default_version(Urho3D VERSION 1.7-p15)
hunter_default_version(Vulkan-Headers VERSION 1.2.182-p0)
Expand Down
62 changes: 0 additions & 62 deletions cmake/find/FindTIFF.cmake

This file was deleted.

32 changes: 32 additions & 0 deletions cmake/projects/TIFF/hunter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_cmake_args)
include(hunter_download)
include(hunter_pick_scheme)

Expand Down Expand Up @@ -74,6 +75,37 @@ hunter_add_version(
7bee2843b47c5f9865973b7235e58aa3fb26e1b0
)

hunter_add_version(
PACKAGE_NAME
TIFF
VERSION
"4.7.0-p0"
URL
"https://github.com/cpp-pm/libtiff/archive/v4.7.0-p0.tar.gz"
SHA1
a9289150caba29de303070275b57ea087a146c80
)

hunter_cmake_args(
TIFF
CMAKE_ARGS
tiff-tools=OFF
tiff-tests=OFF
tiff-docs=OFF
tiff-openGL=OFF
zlib=ON
libdeflate=ON # since 4.7.0-p0
#pixarlog=ON # don't set, available only with ZLIB=ON, no additional dependency
jpeg=OFF # available since 4.7.0-p0
#old-jpeg=ON # determined based on jpeg
#jpeg12=OFF # determined based on jpeg
jbig=OFF # not implemented in 4.7.0-p0
lerc=OFF # not implemented in 4.7.0-p0
lzma=OFF # available since 4.7.0-p0
zstd=OFF # not implemented in 4.7.0-p0
webp=OFF # not implemented in 4.7.0-p0
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(TIFF)
hunter_download(PACKAGE_NAME TIFF)
23 changes: 6 additions & 17 deletions examples/TIFF/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2014, Ruslan Baratov
# Copyright (c) 2025, NeroBurner
# All rights reserved.

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

project(download-tiff)

# download gtest
# download TIFF
hunter_add_package(TIFF)

# now gtest can be used
# now TIFF can be used
find_package(TIFF CONFIG REQUIRED)

add_executable(foo main.c)
target_link_libraries(foo TIFF::libtiff)
target_link_libraries(foo PRIVATE TIFF::libtiff)

# Compatibility mode
find_package(TIFF REQUIRED)

string(COMPARE EQUAL "${TIFF_INCLUDE_DIR}" "" is_empty)
if(is_empty)
message(FATAL_ERROR "Expected non-empty")
endif()

string(COMPARE EQUAL "${TIFF_LIBRARIES}" "TIFF::libtiff" is_good)
if(NOT is_good)
message(FATAL_ERROR "Expected TIFF::libtiff but got: ${TIFF_LIBRARIES}")
endif()

include_directories(${TIFF_INCLUDE_DIR})
target_link_libraries(foo ${TIFF_LIBRARIES})
# try to find another time to check if package is well behaved
find_package(TIFF CONFIG REQUIRED)
8 changes: 1 addition & 7 deletions examples/TIFF/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,9 @@
* Module to test ASCII tags read/write functions.
*/

#include "tif_config.h"

#include <stdio.h>
#include <string.h>

#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif

#include "tiffio.h"

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

/* All tests passed; delete file and exit with success status. */
unlink(filename);
remove(filename);
return 0;

failure:
Expand Down
Loading