libtiff >= 4.5.1: fix case sensitiity issue for discovery of jbig, lzma and zstd #26209
+31
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Changes to recipe: libtiff >= 4.5.1
Motivation
lzma may not be enabled during CMake configuration due to case sensitivity issue (in the CMake config file name and
NAME_FOUND
variable) coming from the logic of the recipe since libtiff 4.5.1. jbig and zstd may suffer from the same issue.Details
Since 4.5.1, this recipe renames target name of several dependencies (and config file name for few of them) instead of using a more intrusive patch. But it's partially broken, several dependencies are discovered upstream with a name in find_package() whose casing is slightly different from official one, so it has to be changed as well (well technically find_package() also try to find
<lowercaseName>-config.cmake
whennameConfig.cmake
is not found, but I prefer to be conservative here, it's quite easy to make a mistake).In the specific case of lzma, we have to be careful since upstream calls
find_package(liblzma)
, therefore we setcmake_file_name
ofxz_utils
toliblzma
, but afterwards upstream relies on aLIBLZMA_FOUND
variable expected to be set to TRUE by lzma config file, but CMakeDeps definesliblzma_FOUND
(<cmake_file_name>_FOUND
) in generated config file, therefore a patch is needed.See:
https://gitlab.com/libtiff/libtiff/-/blob/v4.5.1/cmake/JBIGCodec.cmake#L30
https://gitlab.com/libtiff/libtiff/-/blob/v4.5.1/cmake/LZMACodec.cmake#L29-32
https://gitlab.com/libtiff/libtiff/-/blob/v4.5.1/cmake/ZSTDCodec.cmake#L31
closes #26197