2424# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
2525# OF THIS SOFTWARE.
2626
27- cmake_minimum_required (VERSION 3.9.0 )
27+ cmake_minimum_required (VERSION 3.10 )
2828
29- # Default policy is from 3.9.0
30- cmake_policy (VERSION 3.9.0)
29+ # Default policy is from 3.10
30+ cmake_policy (VERSION 3.10)
31+
32+ if (POLICY CMP0074)
33+ # Allow find_package() to use the ZLIB_ROOT variable, if available.
34+ cmake_policy (SET CMP0074 NEW)
35+ endif ()
3136
3237# Find CMake modules in cmake/
3338list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR} /cmake" )
@@ -50,14 +55,26 @@ else()
5055 option (BUILD_SHARED_LIBS "Build shared libraries" ON )
5156endif ()
5257
58+ if (BUILD_SHARED_LIBS )
59+ set (TIFF_STATIC_LIBS_DEFAULT FALSE )
60+ else ()
61+ set (TIFF_STATIC_LIBS_DEFAULT TRUE )
62+ endif ()
63+
64+ option (tiff-static "build TIFF static libraries" ${TIFF_STATIC_LIBS_DEFAULT} )
5365option (tiff-tools "build TIFF tools" ON )
54- option (tiff-tools-unsupported "build unsupported TIFF tools" OFF )
5566option (tiff-tests "build TIFF tests" ON )
5667option (tiff-contrib "build TIFF contrib" ON )
5768option (tiff-docs "build TIFF documentation" ON )
5869option (tiff-deprecated "build TIFF deprecated features" OFF )
5970option (tiff-install "install TIFF targets" ${TIFF_INSTALL_DEFAULT} )
6071
72+ if (tiff-static )
73+ set (TIFF_BUILD_LIB_VALUE STATIC )
74+ else ()
75+ set (TIFF_BUILD_LIB_VALUE SHARED)
76+ endif ()
77+
6178# Disable deprecated features to ensure clean build
6279if (tiff-deprecated)
6380 add_definitions (-DTIFF_DISABLE_DEPRECATED)
@@ -125,6 +142,9 @@ include(WebPCodec)
125142# Option for C++ libtiffxx library
126143include (CXXLibrary)
127144
145+ # Checks for OpenGL support
146+ include (OpenGLChecks)
147+
128148# Windows support
129149include (WindowsSupport)
130150
@@ -144,9 +164,6 @@ add_subdirectory(libtiff)
144164if (tiff-tools)
145165 add_subdirectory (tools)
146166endif ()
147- if (tiff-tools-unsupported)
148- add_subdirectory (tools/unsupported)
149- endif ()
150167if (tiff-tests)
151168 add_subdirectory (test )
152169endif ()
@@ -177,7 +194,6 @@ message(STATUS " C compiler: ${CMAKE_C_COMPILER}")
177194message (STATUS " C++ compiler: ${CMAKE_CXX_COMPILER} " )
178195message (STATUS " Build shared libraries: ${BUILD_SHARED_LIBS} " )
179196message (STATUS " Build tools: ${tiff-tools}" )
180- message (STATUS " Build tools-unsupported: ${tiff-tools-unsupported}" )
181197message (STATUS " Build tests: ${tiff-tests}" )
182198message (STATUS " Build contrib: ${tiff-contrib}" )
183199message (STATUS " Build docs: ${tiff-docs}" )
@@ -213,7 +229,7 @@ else()
213229 message (STATUS " Old JPEG support: Requested:${old-jpeg} Availability:${JPEG_SUPPORT} Support:${OJPEG_SUPPORT} (Depends on JPEG Support)" )
214230endif ()
215231if (JPEG_SUPPORT AND HAVE_JPEGTURBO_DUAL_MODE_8_12)
216- message (STATUS " JPEG 8/12 bit dual mode: Support: yes (libjpeg turbo >= 2.2 dual mode)" )
232+ message (STATUS " JPEG 8/12 bit dual mode: Support: yes (libjpeg turbo >= 3.0 dual mode)" )
217233else ()
218234 message (STATUS " JPEG 8/12 bit dual mode: Requested:${jpeg12} Availability:${JPEG12_FOUND} Support:${JPEG_DUAL_MODE_8_12} " )
219235endif ()
@@ -227,6 +243,8 @@ message(STATUS " LZMA2 support: Requested:${lzma} Availabi
227243message (STATUS " ZSTD support: Requested:${zstd} Availability:${ZSTD_USABLE} Support:${ZSTD_SUPPORT} " )
228244message (STATUS " WEBP support: Requested:${webp} Availability:${WebP_FOUND} Support:${WEBP_SUPPORT} " )
229245message (STATUS "" )
230- message (STATUS " C++ support: ${cxx} (requested) ${CXX_SUPPORT} (availability)" )
246+ message (STATUS " C++ support: ${tiff-cxx} (requested) ${CXX_SUPPORT} (availability)" )
247+ message (STATUS "" )
231248# message(STATUS " X Athena Widgets support: ${HAVE_XAW}")
249+ message (STATUS " OpenGL support: Requested:${tiff-opengl} Availability:${HAVE_OPENGL} Support:${OPENGL_SUPPORT} " )
232250message (STATUS "" )
0 commit comments