<commit_before>#####################################################
#
#   This is the root SoftwareGuide CMakeLists file.
#
#####################################################
#
# Documentation on how to build the Software Guide
# is available on OTB Wiki at:
# http://wiki.orfeo-toolbox.org/index.php/Compiling_documentation

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# TODO Check if OTB cmake is compatible with CMP0050 NEW policy
# CMP0054 : New policy introduce in CMake 3.0, keep old behaviour for now
if(POLICY CMP0050)
  cmake_policy(SET CMP0050 OLD)
endif()

PROJECT(SoftwareGuide C)



#
# File that defines the path to .cxx examples in OTB sources
#
CONFIGURE_FILE(
${SoftwareGuide_SOURCE_DIR}/SoftwareGuideConfiguration.tex.in
${SoftwareGuide_BINARY_DIR}/SoftwareGuideConfiguration.tex
IMMEDIATE
)

# Find OTB Sources
#FIND_PATH(OTB_SOURCE_DIR UseOTB.cmake.in
#   /ORFEO/thomas/ORFEO-TOOLBOX/otb/OTB
#  )

FIND_PACKAGE(OTB)
IF(OTB_FOUND)
  INCLUDE(${OTB_USE_FILE})
ELSE(OTB_FOUND)
  MESSAGE(FATAL_ERROR
          "Cannot build OTB-Documents without OTB.  Please set OTB_DIR.")
ENDIF(OTB_FOUND)
IF(DEFINED OTB_INSTALL_PREFIX)
  SET(OTB_PREFIX ${OTB_INSTALL_PREFIX})
ELSE()
  SET(OTB_PREFIX ${OTB_DIR})
ENDIF()


IF( NOT OTB_SOURCE_DIR )
  MESSAGE(FATAL_ERROR "OTB source directory is not set. Please add OTB_SOURCE_DIR to your cmake cache.")
ENDIF( NOT OTB_SOURCE_DIR )

set(OTB_VERSION_STRING_FULL "${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_PATCH}")

#OPTION(GENERATE_MONTEVERDI_DOC "Generate Monteverdi user guide as well" OFF)

# Configure the default OTB_DATA_ROOT for the location of OTB Data.
FIND_PATH(OTB_DATA_ROOT README-OTB-Data PATHS $ENV{OTB_DATA_ROOT} ${OTB_SOURCE_DIR}/../OTB-Data)

# OTB_DATA_PATHS is searched recursively.. you need not enter sub-directories
SET(OTB_DATA_PATHS "${OTB_DATA_ROOT}/Examples::${OTB_DATA_ROOT}/Input" CACHE STRING "Where the OTB data is. Enter a double colon separated list.")

#
# Rebuild the Software Guide figures or not ?
SET(BUILD_FIGURES ON CACHE BOOL "Build Software Guide figures")

IF( BUILD_FIGURES )
  SET(OTB_EXECUTABLES_DIR "${OTB_LIBRARY_DIRS}" CACHE PATH "Where the OTB examples executables are")
  SET(RUN_EXAMPLES_SCRIPT "${SoftwareGuide_SOURCE_DIR}/Examples/RunExamples.pl" CACHE FILEPATH "Where the RunExamples Script is")
ENDIF( BUILD_FIGURES )


#
# Find ImageMagick tools
# This is used to convert image formats
#
find_program(IMAGEMAGICK_CONVERT_EXECUTABLE convert)
IF(NOT IMAGEMAGICK_CONVERT_EXECUTABLE)
  MESSAGE(FATAL_ERROR "ImageMagick convert utility was not found. Please pass to advanced mode and provide its full path")
ENDIF(NOT IMAGEMAGICK_CONVERT_EXECUTABLE)


#
# Find bmeps tools
# This is used to convert image formats from png to eps
#<commit_msg>REFAC: remove example from OTB_DATA_PATHS<commit_after>#####################################################
#
#   This is the root SoftwareGuide CMakeLists file.
#
#####################################################
#
# Documentation on how to build the Software Guide
# is available on OTB Wiki at:
# http://wiki.orfeo-toolbox.org/index.php/Compiling_documentation

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# TODO Check if OTB cmake is compatible with CMP0050 NEW policy
# CMP0054 : New policy introduce in CMake 3.0, keep old behaviour for now
if(POLICY CMP0050)
  cmake_policy(SET CMP0050 OLD)
endif()

PROJECT(SoftwareGuide C)



#
# File that defines the path to .cxx examples in OTB sources
#
CONFIGURE_FILE(
${SoftwareGuide_SOURCE_DIR}/SoftwareGuideConfiguration.tex.in
${SoftwareGuide_BINARY_DIR}/SoftwareGuideConfiguration.tex
IMMEDIATE
)

# Find OTB Sources
#FIND_PATH(OTB_SOURCE_DIR UseOTB.cmake.in
#   /ORFEO/thomas/ORFEO-TOOLBOX/otb/OTB
#  )

FIND_PACKAGE(OTB)
IF(OTB_FOUND)
  INCLUDE(${OTB_USE_FILE})
ELSE(OTB_FOUND)
  MESSAGE(FATAL_ERROR
          "Cannot build OTB-Documents without OTB.  Please set OTB_DIR.")
ENDIF(OTB_FOUND)
IF(DEFINED OTB_INSTALL_PREFIX)
  SET(OTB_PREFIX ${OTB_INSTALL_PREFIX})
ELSE()
  SET(OTB_PREFIX ${OTB_DIR})
ENDIF()


IF( NOT OTB_SOURCE_DIR )
  MESSAGE(FATAL_ERROR "OTB source directory is not set. Please add OTB_SOURCE_DIR to your cmake cache.")
ENDIF( NOT OTB_SOURCE_DIR )

set(OTB_VERSION_STRING_FULL "${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_PATCH}")

#OPTION(GENERATE_MONTEVERDI_DOC "Generate Monteverdi user guide as well" OFF)

# Configure the default OTB_DATA_ROOT for the location of OTB Data.
FIND_PATH(OTB_DATA_ROOT README-OTB-Data PATHS $ENV{OTB_DATA_ROOT} ${OTB_SOURCE_DIR}/../OTB-Data)

# OTB_DATA_PATHS is searched recursively.. you need not enter sub-directories
SET(OTB_DATA_PATHS "${OTB_DATA_ROOT}/Input" CACHE STRING "Where the OTB data is. Enter a double colon separated list.")

#
# Rebuild the Software Guide figures or not ?
SET(BUILD_FIGURES ON CACHE BOOL "Build Software Guide figures")

IF( BUILD_FIGURES )
  SET(OTB_EXECUTABLES_DIR "${OTB_LIBRARY_DIRS}" CACHE PATH "Where the OTB examples executables are")
  SET(RUN_EXAMPLES_SCRIPT "${SoftwareGuide_SOURCE_DIR}/Examples/RunExamples.pl" CACHE FILEPATH "Where the RunExamples Script is")
ENDIF( BUILD_FIGURES )


#
# Find ImageMagick tools
# This is used to convert image formats
#
find_program(IMAGEMAGICK_CONVERT_EXECUTABLE convert)
IF(NOT IMAGEMAGICK_CONVERT_EXECUTABLE)
  MESSAGE(FATAL_ERROR "ImageMagick convert utility was not found. Please pass to advanced mode and provide its full path")
ENDIF(NOT IMAGEMAGICK_CONVERT_EXECUTABLE)


#
# Find bmeps tools
# This is used to convert image formats from png to eps
#
{'fraction_non_alphanumeric': 0.11898274296094459, 'fraction_numerical': 0.007266121707538601, 'mean_word_length': 5.969620253164557, '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': '1874899', 'n_tokens_mistral': 2051, 'n_tokens_neox': 1892, 'n_words': 512}