<commit_before>find_package(JPEG QUIET)
find_package(PNG QUIET)
find_package(TIFF QUIET)
find_package(ZLIB QUIET)

set(DO_ImageIO_THIRD_PARTY_LIBRARIES "")

# Add the third-party image I/O libraries.
if (JPEG_FOUND)
  include_directories(${JPEG_INCLUDE_DIR})
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES ${JPEG_LIBRARY})
else ()
  include_directories(${DO_ThirdParty_DIR}/libjpeg)
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES jpeg)
endif ()

if (PNG_FOUND)
  include_directories(${PNG_PNG_INCLUDE_DIR})
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES ${PNG_LIBRARY_RELEASE})
else ()
  include_directories(${DO_ThirdParty_DIR}/libpng)
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES png)
endif ()

if (TIFF_FOUND)
  include_directories(${TIFF_INCLUDE_DIR})
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES ${TIFF_LIBRARY})
else ()
  include_directories(${DO_ThirdParty_DIR}/libtiff)
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES tiff)
endif ()

if (ZLIB_FOUND)
  include_directories(${ZLIB_INCLUDE_DIR})
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES ${ZLIB_LIBRARY})
else ()
  include_directories(${DO_ThirdParty_DIR}/zlib)
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES zlib)
endif ()

# Add the other necessary third-party libraries.
include_directories(
  ${DO_INCLUDE_DIR}
  ${DO_ThirdParty_DIR}
  ${DO_ThirdParty_DIR}/eigen
)


if (DO_USE_FROM_SOURCE)
  get_property(DO_ImageIO_ADDED GLOBAL PROPERTY _DO_ImageIO_INCLUDED)
  if (NOT DO_ImageIO_ADDED)
    do_glob_directory(${DO_SOURCE_DIR}/ImageIO)
    do_create_common_variables("ImageIO")<commit_msg>MAINT: fix CMake scripts.<commit_after>find_package(JPEG QUIET)
find_package(PNG QUIET)
find_package(TIFF QUIET)
find_package(ZLIB QUIET)

set(DO_ImageIO_THIRD_PARTY_LIBRARIES "")

# Add the third-party image I/O libraries.
if (JPEG_FOUND)
  include_directories(${JPEG_INCLUDE_DIR})
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES ${JPEG_LIBRARIES})
else ()
  include_directories(${DO_ThirdParty_DIR}/libjpeg)
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES jpeg)
endif ()

if (PNG_FOUND)
  add_definitions(${PNG_DEFINITIONS})
  include_directories(${PNG_INCLUDE_DIRS})
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES ${PNG_LIBRARIES})
else ()
  include_directories(${DO_ThirdParty_DIR}/libpng)
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES png)
endif ()

if (TIFF_FOUND)
  include_directories(${TIFF_INCLUDE_DIR})
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES ${TIFF_LIBRARIES})
else ()
  include_directories(${DO_ThirdParty_DIR}/libtiff)
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES tiff)
endif ()

if (ZLIB_FOUND)
  include_directories(${ZLIB_INCLUDE_DIRS})
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES ${ZLIB_LIBRARIES})
else ()
  include_directories(${DO_ThirdParty_DIR}/zlib)
  list(APPEND DO_ImageIO_THIRD_PARTY_LIBRARIES zlib)
endif ()

# Add the other necessary third-party libraries.
include_directories(
  ${DO_INCLUDE_DIR}
  ${DO_ThirdParty_DIR}
  ${DO_ThirdParty_DIR}/eigen
)


if (DO_USE_FROM_SOURCE)
  get_property(DO_ImageIO_ADDED GLOBAL PROPERTY _DO_ImageIO_INCLUDED)
  if (NOT DO_ImageIO_ADDED)
    do_glob_directory(${DO_SOURCE_DIR}/ImageIO)
    do_create_common_variables("ImageIO")
{'fraction_non_alphanumeric': 0.09456040480708412, 'fraction_numerical': 0.0, 'mean_word_length': 8.413690476190476, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1325068', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1260, 'n_words': 171}