summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt56
-rw-r--r--cmake/WindowsSupport.cmake (renamed from cmake/WindowsIOFeature.cmake)8
2 files changed, 54 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53ecdb42..a6bcb180 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,7 @@
# Run "cmake" to generate the build files for your platform
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Permission to use, copy, modify, distribute, and sell this software and
@@ -38,19 +39,36 @@ message(STATUS "libtiff library version ${SO_VERSION}")
string(TIMESTAMP BUILD_DATE "%Y%m%d")
message(STATUS "libtiff build date: ${BUILD_DATE}")
+
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
+
+# Disable deprecated features to ensure clean build
+add_definitions(-DTIFF_DISABLE_DEPRECATED)
+
+
# Project definition
set(CMAKE_C_STANDARD 99)
project(tiff
VERSION "${LIBTIFF_VERSION}"
LANGUAGES C CXX)
+# Autotools compatibility
include(AutotoolsCompat)
+
+# Compiler checks (warning flags, etc.)
include(CompilerChecks)
+
+# Linker checks (version script, etc.)
include(LinkerChecks)
+
+# Processor checks (endianness, fill order, floating point, etc.)
include(ProcessorChecks)
+
+# Checks for headers
include(IncludeChecks)
+
+# Checks for functions and other symbols
include(SymbolChecks)
# Standard installation paths
@@ -61,34 +79,55 @@ set(LIBTIFF_DOCDIR "${CMAKE_INSTALL_FULL_DOCDIR}")
# CTest testing
enable_testing()
-if(MSVC)
- set(CMAKE_DEBUG_POSTFIX "d")
-endif()
-
-# Disable deprecated features to ensure clean build
-add_definitions(-DTIFF_DISABLE_DEPRECATED)
-
+# Checks for type presence and size
include(TypeSizeChecks)
+
+# Check for POSIX Large File Support (LFS)
include(LargeFileSupport)
+
+# Options for internal codec support
include(InternalCodecs)
+
+# Check for Deflate codec
include(DeflateCodec)
+
+# Check for PixarLog codec
include(PixarLogCodec)
+
+# Check for JPEG codec
include(JPEGCodec)
+
+# Check for JBIG codec
include(JBIGCodec)
+
+# Check for LZMA codec
include(LZMACodec)
+
+# Check for ZSTD codec
include(ZSTDCodec)
+
+# Check for WebP codec
include(WebPCodec)
+
+# Option for C++ libtiffxx library
include(CXXLibrary)
+
+# Checks for OpenGL support
include(OpenGLChecks)
-include(WindowsIOFeature)
+
+# Windows support
+include(WindowsSupport)
# Orthogonal features
include(LibraryFeatures)
+# pkg-config support
include(PkgConfig)
+# math.h/libm portability
find_package(CMath REQUIRED)
+
# Process subdirectories
add_subdirectory(port)
add_subdirectory(libtiff)
@@ -99,7 +138,6 @@ add_subdirectory(build)
add_subdirectory(man)
add_subdirectory(html)
-#message(STATUS "EXTRA_DIST: ${EXTRA_DIST}")
message(STATUS "")
message(STATUS "Libtiff is now configured for ${CMAKE_SYSTEM}")
diff --git a/cmake/WindowsIOFeature.cmake b/cmake/WindowsSupport.cmake
index 252f064b..93c13094 100644
--- a/cmake/WindowsIOFeature.cmake
+++ b/cmake/WindowsSupport.cmake
@@ -1,4 +1,4 @@
-# Windows Win32 IO
+# Windows support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
@@ -23,6 +23,12 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
+# Debug postfix
+if(MSVC)
+ set(CMAKE_DEBUG_POSTFIX "d")
+endif()
+
+# Win32 file I/O
set(win32_io_default OFF)
if(WIN32)
set(win32_io_default ON)