<commit_before>project(OTBOpenJPEG)
  
  set(OTBOpenJPEG_SYSTEM_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIRS})
  set(OTBOpenJPEG_LIBRARIES "${OPENJPEG_LIBRARIES}")
  set(OTBOpenJPEG_INCLUDE_DIRS ${OTBOpenJPEG_BINARY_DIR}/src)
  set(OTBOpenJPEG_EXPORT_CODE_BUILD "
if(NOT OpenJPEG_FOUND)
find_package(OpenJPEG REQUIRED HINTS ${OpenJPEG_DIR})
endif()")
  set(OTBOpenJPEG_EXPORT_CODE_INSTALL ${OTBOpenJPEG_EXPORT_CODE_BUILD})
  
  if(OpenJPEG_FOUND)
    math(EXPR OTBOpenJPEG_VERSION_NUMBER
      "((${OPENJPEG_MAJOR_VERSION})*100+${OPENJPEG_MINOR_VERSION})*100+${OPENJPEG_BUILD_VERSION}")
    configure_file( src/otb_openjpeg.h.in src/otb_openjpeg.h )
  endif()

  message(STATUS "Found OpenJPEG : ${OPENJPEG_LIBRARIES} (version ${OPENJPEG_MAJOR_VERSION}.${OPENJPEG_MINOR_VERSION}.${OPENJPEG_BUILD_VERSION})")

  otb_module_impl()

install(FILES ${OTBOpenJPEG_BINARY_DIR}/src/otb_openjpeg.h
  DESTINATION ${OTBOpenJPEG_INSTALL_INCLUDE_DIR}
  COMPONENT Development
  )<commit_msg>DOC: warn user about the OpenJPEG/ITK issue<commit_after>project(OTBOpenJPEG)
  
  set(OTBOpenJPEG_SYSTEM_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIRS})
  set(OTBOpenJPEG_LIBRARIES "${OPENJPEG_LIBRARIES}")
  set(OTBOpenJPEG_INCLUDE_DIRS ${OTBOpenJPEG_BINARY_DIR}/src)
  set(OTBOpenJPEG_EXPORT_CODE_BUILD "
if(NOT OpenJPEG_FOUND)
find_package(OpenJPEG REQUIRED HINTS ${OpenJPEG_DIR})
endif()")
  set(OTBOpenJPEG_EXPORT_CODE_INSTALL ${OTBOpenJPEG_EXPORT_CODE_BUILD})
  
  if(OpenJPEG_FOUND)
    math(EXPR OTBOpenJPEG_VERSION_NUMBER
      "((${OPENJPEG_MAJOR_VERSION})*100+${OPENJPEG_MINOR_VERSION})*100+${OPENJPEG_BUILD_VERSION}")
    configure_file( src/otb_openjpeg.h.in src/otb_openjpeg.h )
  endif()

  message(STATUS "Found OpenJPEG : ${OPENJPEG_LIBRARIES} (version ${OPENJPEG_MAJOR_VERSION}.${OPENJPEG_MINOR_VERSION}.${OPENJPEG_BUILD_VERSION})")
  message(WARNING "There could be a version conflict if ITK also contains an OpenJPEG version. "
                  "Depending on ITK version and enabled modules, the OpenJPEG headers can be "
                  "present in ITK include folder. Since the include order between modules is "
                  "deterministic, the OpenJPEG header from ITK may be included first. To avoid "
                  "version conflicts, try to use an ITK installed without GDCM nor ITKReview. "
                  "An alternative fix is to simply hide the header openjpeg.h in the ITK "
                  "include directory.")

  otb_module_impl()

install(FILES ${OTBOpenJPEG_BINARY_DIR}/src/otb_openjpeg.h
  DESTINATION ${OTBOpenJPEG_INSTALL_INCLUDE_DIR}
  COMPONENT Development
  )
{'fraction_non_alphanumeric': 0.0934470725087243, 'fraction_numerical': 0.0046529662659945716, 'mean_word_length': 5.37037037037037, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1447453', 'n_tokens_mistral': 994, 'n_tokens_neox': 928, 'n_words': 159}