local_settings:
    #use_shared_libs: true
    #generator: Visual Studio 14 2015 Win64
    silent: false
    #copy_import_libs: true
    build:
        c_flags: /W0
        cxx_flags: /W0

    dependencies:
        pvt.cppan.demo.danbloomberg.leptonica: 1
        pvt.cppan.demo.unicode.icu.i18n: "*"

root_project: pvt.cppan.demo.google.tesseract

common_settings:
    c++: 11

projects:
    libtesseract:
        type: lib
        export_all_symbols: true
        files:
          - api/.*\.cpp
          - ccmain/.*\.cpp
          - ccstruct/.*\.cpp
          - ccutil/.*\.cpp
          - classify/.*\.cpp
          - cube/.*\.cpp
          - cutil/.*\.cpp
          - dict/.*\.cpp
          - neural_networks/runtime/.*\.cpp
          - opencl/.*\.cpp
          - textord/.*\.cpp
          - viewer/.*\.cpp
          - wordrec/.*\.cpp

          - api/.*\.h
          - ccmain/.*\.h
          - ccstruct/.*\.h
          - ccutil/.*\.h
          - classify/.*\.h
          - cube/.*\.h
          - cutil/.*\.h
          - dict/.*\.h
          - neural_networks/runtime/.*\.h
          - opencl/.*\.h
          - textord/.*\.h
          - viewer/.*\.h
          - wordrec/.*\.h

          - vs2010/port/.*

        exclude_from_build:
          - api/tesseractmain.cpp
          - viewer/svpaint.cpp

        include_directories:
          public:
          #private:
            - classify
            - cube
            - cutil
            - dict
            - neural_networks/runtime
            - opencl
            - textord
            - vs2010/port
            - viewer
            - wordrec
          #public:
            - api
            - ccmain
            - ccstruct
            - ccutil

        check_function_exists:
          - getline

        check_symbol_exists:
          snprintf: stdio.h

        check_include_exists:
          - dlfcn.h
          - inttypes.h
          - limits.h
          - malloc.h
          - memory.h
          - stdbool.h
          - stdint.h
          - stdlib.h
          - strings.h
          - string.h
          - sys/ipc.h
          - sys/shm.h
          - sys/stat.h
          - sys/types.h
          - sys/wait.h
          - tiffio.h
          - unistd.h
          - cairo/cairo-version.h
          - CL/cl.h
          - OpenCL/cl.h
          - pango-1.0/pango/pango-features.h
          - unicode/uchar.h

        check_type_size:
          - long long int
          - off_t
          - mbstate_t
          - wchar_t
          - _Bool


        post_sources: |
            file_write_once(${BDIR}/config_auto.h "")
            if (NOT WIN32)
                remove_src_dir(vs2010/port/*)
            endif()

        options:
            any:
                definitions:
                    public:
                      - HAVE_CONFIG_H
                      - _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS=1
                      - USE_STD_NAMESPACE=1
                      - WINDLLNAME="tesseract"
            shared:
                definitions:
                    private:
                        - TESS_EXPORTS
                    interface:
                        - TESS_IMPORTS

        dependencies:
            pvt.cppan.demo.danbloomberg.leptonica: 1.74

    tesseract:
        files: api/tesseractmain.cpp
        dependencies:
            - libtesseract

    tessopt:
        type: lib
        static_only: true
        files: training/tessopt.*
        include_directories: training
        dependencies: libtesseract

    common_training:
        type: lib
        static_only: true
        files:
            - training/commandlineflags.cpp
            - training/commandlineflags.h
            - training/commontraining.cpp
            - training/commontraining.h
        include_directories: training
        dependencies:
            - tessopt

    ambiguous_words:
        files: training/ambiguous_words.cpp
        dependencies: libtesseract

    classifier_tester:
        files: training/classifier_tester.cpp
        dependencies: common_training

    combine_tessdata:
        files: training/combine_tessdata.cpp
        dependencies: libtesseract

    cntraining:
        files: training/cntraining.cpp
        dependencies: common_training

    dawg2wordlist:
        files: training/dawg2wordlist.cpp
        dependencies: libtesseract

    mftraining:
        files:
            - training/mftraining.cpp
            - training/mergenf.*
        dependencies: common_training

    shapeclustering:
        files: training/shapeclustering.cpp
        dependencies: common_training

    unicharset_extractor:
        files: training/unicharset_extractor.cpp
        dependencies: tessopt

    wordlist2dawg:
        files: training/wordlist2dawg.cpp
        dependencies: libtesseract

    unicharset_training:
        type: lib
        static_only: true
        files:
            - training/fileio.*
            - training/icuerrorcode.h
            - training/lstmtester.*
            - training/normstrngs.*
            - training/unicharset_training_utils.*
        include_directories: training
        dependencies:
            - common_training
            - pvt.cppan.demo.unicode.icu.i18n

    set_unicharset_properties:
        files: training/set_unicharset_properties.cpp
        dependencies: unicharset_training

    text2image:
        files:
            - training/text2image.cpp
            - training/boxchar.cpp
            - training/boxchar.h
            - training/degradeimage.cpp
            - training/degradeimage.h
            - training/ligature_table.cpp
            - training/ligature_table.h
            - training/normstrngs.cpp
            - training/normstrngs.h
            - training/pango_font_info.cpp
            - training/pango_font_info.h
            - training/stringrenderer.cpp
            - training/stringrenderer.h
            - training/tlog.cpp
            - training/tlog.h
            - training/util.h
            - training/icuerrorcode.h

        dependencies:
            - unicharset_training
            - pvt.cppan.demo.gnome.pango.pangocairo: 1
