2020.12.26 19:47 "[Tiff] Wrong information about request and avalability of external codecs", by Miguel Medalha

2020.12.27 18:28 "Re: [Tiff] Wrong information about request and avalability of external codecs", by Miguel Medalha

We are not unconditionally checking with find_package unless support is specifically requested. That’s why the (availability) was unset.

I edited the pertinent section of CMAkeLists.txt, keeping the original operations but changing the order between checking the availability of the library and requesting it. This way, the summary presents the correct information. If a library is available but not requested, it will be shown as available; if it is requested but not available it will be shown as unavailable; if it depends on another library which is not available or requested, or both, it will be shown as unavailable. In the case of 'zlib' (quoted above), it became the following:

# ZLIB
option(zlib "use zlib (required for Deflate compression)" ON)
set(ZLIB_SUPPORT 0)
set(ZLIB_FOUND FALSE)
find_package(ZLIB)
if(ZLIB_FOUND)
   set(ZLIB_FOUND TRUE)
endif()
if (zlib)
   set(ZLIB_SUPPORT 1)
endif()
set(ZIP_SUPPORT ${ZLIB_SUPPORT})

The outputmessages were modified accordingly:

if(ZLIB_SUPPORT AND ZLIB_FOUND)
  message(STATUS "  libdeflate support:                 ${libdeflate} (requested) ${DEFLATE_FOUND} (availability)")
  message(STATUS "  Pixar log-format algorithm:         ${pixarlog} (requested) ${PIXARLOG_FOUND} (availability)")
else()
  message(STATUS "  libdeflate support:                 ${libdeflate} (requested) "FALSE" (availability depends on zlib)")
  message(STATUS "  Pixar log-format algorithm:         ${pixarlog} (requested) "FALSE" (availability depends on zlib)")
endif()

Would someone here be willing to verify the code (about 150 lines in total) for the other libraries before presenting this to gitlab?