Skip to content

Commit 0ec011d

Browse files
authored
Merge pull request #551 from mm2/copilot/add-tiffdiff-utility-to-cmake
Add tiffdiff to CMake build system
2 parents d81d1bf + a2086e1 commit 0ec011d

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

cmake/Lcms2Options.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function(lcms2_setup_options)
99
# Tool-specific toggles (only meaningful when LCMS2_BUILD_TOOLS=ON).
1010
option(LCMS2_BUILD_JPGICC "Build jpgicc tool (requires JPEG)" ON)
1111
option(LCMS2_BUILD_TIFICC "Build tificc tool (requires TIFF, optionally ZLIB)" ON)
12+
option(LCMS2_BUILD_TIFFDIFF "Build tiffdiff tool (requires TIFF)" ON)
1213

1314
# Dependency toggles (only consulted when the dependent tool is enabled).
1415
option(LCMS2_WITH_JPEG "Enable JPEG support for tools (find_package only when needed)" ON)

cmake/Lcms2Tools.cmake

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,30 @@ function(lcms2_add_tools)
141141
endif()
142142
endif()
143143

144+
# Optional tiffdiff (requires TIFF).
145+
if(LCMS2_BUILD_TIFFDIFF)
146+
if(LCMS2_WITH_TIFF)
147+
find_package(TIFF)
148+
endif()
149+
150+
if(TIFF_FOUND)
151+
_lcms2_add_tool(tiffdiff
152+
SOURCES
153+
"${PROJECT_SOURCE_DIR}/utils/tificc/tifdiff.c"
154+
${_common_sources}
155+
)
156+
if(TARGET TIFF::TIFF)
157+
target_link_libraries(tiffdiff PRIVATE TIFF::TIFF)
158+
else()
159+
# Do not quote list variables: they may contain debug/optimized keywords.
160+
target_include_directories(tiffdiff PRIVATE ${TIFF_INCLUDE_DIR})
161+
target_link_libraries(tiffdiff PRIVATE ${TIFF_LIBRARIES})
162+
endif()
163+
else()
164+
message(STATUS "TIFF not found or disabled; skipping tiffdiff")
165+
endif()
166+
endif()
167+
144168
# Manpages (install handled by packaging module).
145169
set(_manpages
146170
"${PROJECT_SOURCE_DIR}/utils/jpgicc/jpgicc.1"

0 commit comments

Comments
 (0)