Title: Automatically download/build liblerc dependency if missing during build
Problem
libtiff includes support for [LERC](https://github.com/Esri/lerc) compression. However, if liblerc (or Lerc.dll / libLerc.so) is not installed on the host system, the build process fails or fails to link properly.
Manually downloading and building liblerc as a prerequisite introduces extra setup overhead for automated build pipelines and CI workflows.
Proposed Solution
Add an automated fallback mechanism in the CMake build system to automatically fetch and compile liblerc if it is not detected on the system.
This can be achieved via CMake's FetchContent module:
# Check for system LERC library first
find_package(LERC QUIET)
if(NOT LERC_FOUND)
message(STATUS "LERC dynamic library not found locally. Fetching and building automatically...")
include(FetchContent)
FetchContent_Declare(
lerc
GIT_REPOSITORY https://github.com/Esri/lerc.git
GIT_TAG v4.0.0 # Or appropriate release tag
)
FetchContent_MakeAvailable(lerc)
endif()
Benefits
- Simplifies automated CI/CD build scripts by removing the need to pre-install
liblerc.
- Ensures seamless builds across environments without requiring manual dependency management.
Title: Automatically download/build
liblercdependency if missing during buildProblem
libtiffincludes support for [LERC](https://github.com/Esri/lerc) compression. However, ifliblerc(orLerc.dll/libLerc.so) is not installed on the host system, the build process fails or fails to link properly.Manually downloading and building
liblercas a prerequisite introduces extra setup overhead for automated build pipelines and CI workflows.Proposed Solution
Add an automated fallback mechanism in the CMake build system to automatically fetch and compile
liblercif it is not detected on the system.This can be achieved via CMake's
FetchContentmodule:Benefits
liblerc.