Warning, /maui/buho/cmake/FindLeptonica.cmake is written in an unsupported language. File is not indexed.
0001 # 0002 # Find Leptonica 0003 # 0004 # Exported variables: 0005 # Leptonica_FOUND 0006 # Leptonica_INCLUDE_DIRS 0007 # Leptonica_LIBRARIES 0008 # 0009 # Leptonica_VERSION 0010 # Leptonica_MAJOR_VERSION 0011 # Leptonica_MINOR_VERSION 0012 # 0013 0014 find_path(Leptonica_INCLUDE_DIR leptonica/allheaders.h 0015 HINTS 0016 /usr/include 0017 /usr/local/include 0018 /opt/include 0019 /opt/local/include 0020 ${Leptonica_DIR}/include 0021 ) 0022 if(NOT "${Leptonica_INCLUDE_DIR}" EQUAL "Leptonica_INCLUDE_DIR-NOTFOUND") 0023 set(Leptonica_INCLUDE_DIRS ${Leptonica_INCLUDE_DIR}/leptonica) 0024 file(STRINGS ${Leptonica_INCLUDE_DIRS}/allheaders.h Leptonica_MAJOR_VERSION REGEX "LIBLEPT_MAJOR_VERSION") 0025 file(STRINGS ${Leptonica_INCLUDE_DIRS}/allheaders.h Leptonica_MINOR_VERSION REGEX "LIBLEPT_MINOR_VERSION") 0026 string(REGEX MATCH "[0-9]+" Leptonica_MAJOR_VERSION ${Leptonica_MAJOR_VERSION}) 0027 string(REGEX MATCH "[0-9]+" Leptonica_MINOR_VERSION ${Leptonica_MINOR_VERSION}) 0028 set(Leptonica_VERSION ${Leptonica_MAJOR_VERSION}.${Leptonica_MINOR_VERSION}) 0029 endif() 0030 0031 find_library(Leptonica_LIBRARY NAMES lept liblept 0032 HINTS 0033 /usr/lib 0034 /usr/local/lib 0035 /opt/lib 0036 /opt/local/lib 0037 ${Leptonica_DIR}/lib 0038 ) 0039 set(Leptonica_LIBRARIES ${Leptonica_LIBRARY}) 0040 0041 include(FindPackageHandleStandardArgs) 0042 0043 find_package_handle_standard_args(Leptonica 0044 REQUIRED_VARS 0045 Leptonica_INCLUDE_DIRS 0046 Leptonica_LIBRARIES 0047 VERSION_VAR Leptonica_VERSION 0048 FAIL_MESSAGE "Try to set Leptonica_DIR or Leptonica_ROOT" 0049 ) 0050 0051 mark_as_advanced(Leptonica_INCLUDE_DIRS Leptonica_LIBRARIES)