Remove cppan build.

Browse Source
Egor Pugin 1 year ago
parent
commit
2bcc9d8093
3 changed files with 16 additions and 312 deletions
  1. 6
    25
      CMakeLists.txt
  2. 0
    273
      cppan.yml
  3. 10
    14
      src/training/CMakeLists.txt

+ 6
- 25
CMakeLists.txt

@@ -66,10 +66,10 @@ set(MINIMUM_LEPTONICA_VERSION 1.74)
 # options
 #
 ###############################################################################
+
 message( "Configuring tesseract version ${PACKAGE_VERSION}...")
 
-option(CPPAN_BUILD "Build with cppan" ON)
-option(SW_BUILD "Build with sw" OFF)
+option(SW_BUILD "Build with sw" ON)
 option(OPENMP_BUILD "Build with openmp support" OFF)  # see issue #1662
 option(AUTO_OPTIMIZE "Usage of cmake auto optimize macros (not suitable for portable build)" ON)
 option(GRAPHICS_DISABLED "Disable disable graphics (ScrollView)" OFF)
@@ -78,10 +78,6 @@ option(BUILD_TRAINING_TOOLS "Build training tools" ON)
 option(BUILD_TESTS "Build tests" OFF)
 option(USE_SYSTEM_ICU "Use system ICU" OFF)
 
-if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.cppan OR SW_BUILD)
-    set(CPPAN_BUILD OFF)
-endif()
-
 ###############################################################################
 #
 # compiler and linker
@@ -174,14 +170,7 @@ endif()
 #
 ###############################################################################
 
-if(CPPAN_BUILD)
-    if (STATIC)
-        set(CPPAN_BUILD_SHARED_LIBS 0)
-    else()
-        set(CPPAN_BUILD_SHARED_LIBS 1)
-    endif()
-    add_subdirectory(.cppan)
-elseif (SW_BUILD)
+if (SW_BUILD)
     find_package(SW REQUIRED)
     if (STATIC)
         set(SW_BUILD_SHARED_LIBS 0)
@@ -189,7 +178,7 @@ elseif (SW_BUILD)
         set(SW_BUILD_SHARED_LIBS 1)
     endif()
     sw_add_package(
-        org.sw.demo.danbloomberg.leptonica-master
+        org.sw.demo.danbloomberg.leptonica
         org.sw.demo.libarchive.libarchive
     )
     if (BUILD_TRAINING_TOOLS)
@@ -308,7 +297,6 @@ message( STATUS "SSE41_OPT: ${SSE41_OPT}")
 message( STATUS "MARCH_NATIVE_OPT: ${MARCH_NATIVE_OPT}")
 message( STATUS "sim_flags: ${sim_flags}")
 message( STATUS "--------------------------------------------------------")
-message( STATUS "Build with cppan [CPPAN_BUILD]: ${CPPAN_BUILD}")
 message( STATUS "Build with sw [SW_BUILD]: ${SW_BUILD}")
 message( STATUS "Build with openmp support [OPENMP_BUILD]: ${OPENMP_BUILD}")
 message( STATUS "Disable disable graphics (ScrollView) [GRAPHICS_DISABLED]: ${GRAPHICS_DISABLED}")
@@ -453,16 +441,9 @@ else()
 set_target_properties           (libtesseract PROPERTIES OUTPUT_NAME tesseract)
 endif()
 
-if (CPPAN_BUILD)
-    target_link_libraries       (libtesseract PUBLIC
-        pvt.cppan.demo.danbloomberg.leptonica
-        pvt.cppan.demo.libarchive.libarchive
-    )
-    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake "include(${CMAKE_CURRENT_BINARY_DIR}/cppan.cmake)\n")
-    export(TARGETS libtesseract APPEND FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake)
-elseif (SW_BUILD)
+if (SW_BUILD)
     target_link_libraries       (libtesseract PUBLIC
-        org.sw.demo.danbloomberg.leptonica-master
+        org.sw.demo.danbloomberg.leptonica
         org.sw.demo.libarchive.libarchive
     )
     file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake "include(${CMAKE_CURRENT_BINARY_DIR}/cppan.cmake)\n")

+ 0
- 273
cppan.yml

@@ -1,273 +0,0 @@
-local_settings:
-    #use_shared_libs: true
-    #short_local_names: true
-    #use_cache: false
-    #generator: Visual Studio 14 2015 Win64
-    silent: false
-    #copy_import_libs: true
-    #build:
-        #c_flags: /W0
-        #cxx_flags: /W0
-    builds:
-        vs2017:
-            generator: Visual Studio 15 2017
-        vs2017_64:
-            generator: Visual Studio 15 2017 Win64
-
-    dependencies:
-        pvt.cppan.demo.danbloomberg.leptonica: 1
-        pvt.cppan.demo.libarchive.libarchive: 3
-        pvt.cppan.demo.unicode.icu.i18n: "*"
-
-root_project: pvt.cppan.demo.google.tesseract
-
-common_settings:
-    c++: 11
-
-    options:
-        any:
-            compile_options:
-                msvc:
-                    private:
-                        - /openmp
-
-projects:
-    libtesseract:
-        type: lib
-        export_all_symbols: true
-        files:
-          - include/tesseract/version.h.in
-          - src/api/.*\.cpp
-          - src/arch/.*\.cpp
-          - src/ccmain/.*\.cpp
-          - src/ccstruct/.*\.cpp
-          - src/ccutil/.*\.cpp
-          - src/classify/.*\.cpp
-          - src/cutil/.*\.cpp
-          - src/dict/.*\.cpp
-          - src/lstm/.*\.cpp
-          - src/opencl/.*\.cpp
-          - src/textord/.*\.cpp
-          - src/viewer/.*\.cpp
-          - src/wordrec/.*\.cpp
-
-          - src/arch/.*\.h
-          - src/ccmain/.*\.h
-          - src/ccstruct/.*\.h
-          - src/ccutil/.*\.h
-          - src/classify/.*\.h
-          - src/cutil/.*\.h
-          - src/dict/.*\.h
-          - src/lstm/.*\.h
-          - src/opencl/.*\.h
-          - src/textord/.*\.h
-          - src/viewer/.*\.h
-          - src/wordrec/.*\.h
-
-        exclude_from_build:
-          - src/api/tesseractmain.cpp
-          - src/viewer/svpaint.cpp
-
-        include_directories:
-          public:
-          #private:
-            - src/arch
-            - src/classify
-            - src/cutil
-            - src/ccutil
-            - src/dict
-            - src/lstm
-            - src/opencl
-            - src/textord
-            - src/viewer
-            - src/wordrec
-          #public:
-            - include
-            - src/ccmain
-            - src/ccstruct
-            - src/ccutil
-
-        check_include_exists:
-          - dlfcn.h
-          - inttypes.h
-          - limits.h
-          - malloc.h
-          - memory.h
-          - stdbool.h
-          - stdint.h
-          - stdlib.h
-          - string.h
-          - sys/ipc.h
-          - sys/shm.h
-          - sys/stat.h
-          - sys/types.h
-          - sys/wait.h
-          - tiffio.h
-          - unistd.h
-
-        check_type_size:
-          - long long int
-          - off_t
-          - mbstate_t
-          - wchar_t
-          - _Bool
-
-        pre_sources: |
-            file_write_once(${BDIR}/config_auto.h "")
-
-        post_sources: |
-            configure_file(
-                ${SDIR}/include/tesseract/version.h.in
-                ${BDIR}/version.h @ONLY)
-            if (WIN32)
-                if (MSVC)
-                    set_source_files_properties(
-                        ${SDIR}/src/arch/dotproductsse.cpp
-                        PROPERTIES COMPILE_DEFINITIONS __SSE4_1__)
-                    set_source_files_properties(
-                        ${SDIR}/src/arch/intsimdmatrixsse.cpp
-                        PROPERTIES COMPILE_DEFINITIONS __SSE4_1__)
-                    set_source_files_properties(
-                        ${SDIR}/src/arch/dotproductavx.cpp
-                        PROPERTIES COMPILE_FLAGS "/arch:AVX")
-                    set_source_files_properties(
-                        ${SDIR}/src/arch/intsimdmatrixavx2.cpp
-                        PROPERTIES COMPILE_FLAGS "/arch:AVX2")
-                endif()
-            endif()
-
-        options:
-            any:
-                definitions:
-                    public:
-                      - HAVE_CONFIG_H
-                      - HAVE_LIBARCHIVE
-                      - _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS=1
-            shared:
-                definitions:
-                    private:
-                        - TESS_EXPORTS
-                    interface:
-                        - TESS_IMPORTS
-
-        dependencies:
-            pvt.cppan.demo.danbloomberg.leptonica: 1
-            pvt.cppan.demo.libarchive.libarchive: 3
-
-    tesseract:
-        files: src/api/tesseractmain.cpp
-        dependencies:
-            - libtesseract
-
-    tessopt:
-        type: lib
-        static_only: true
-        files: src/training/tessopt.*
-        include_directories: training
-        dependencies: libtesseract
-
-    common_training:
-        type: lib
-        static_only: true
-        files:
-            - src/training/commandlineflags.cpp
-            - src/training/commandlineflags.h
-            - src/training/commontraining.cpp
-            - src/training/commontraining.h
-        include_directories: training
-        dependencies:
-            - tessopt
-
-    ambiguous_words:
-        files: src/training/ambiguous_words.cpp
-        dependencies:
-            - libtesseract
-
-    classifier_tester:
-        files: src/training/classifier_tester.cpp
-        dependencies: common_training
-
-    combine_lang_model:
-        files: src/training/combine_lang_model.cpp
-        dependencies: unicharset_training
-
-    combine_tessdata:
-        files: src/training/combine_tessdata.cpp
-        dependencies: libtesseract
-
-    cntraining:
-        files: src/training/cntraining.cpp
-        dependencies: common_training
-
-    dawg2wordlist:
-        files: src/training/dawg2wordlist.cpp
-        dependencies: libtesseract
-
-    mftraining:
-        files:
-            - src/training/mftraining.cpp
-            - src/training/mergenf.*
-        dependencies: common_training
-
-    shapeclustering:
-        files: src/training/shapeclustering.cpp
-        dependencies: common_training
-
-    unicharset_extractor:
-        files: src/training/unicharset_extractor.cpp
-        dependencies: unicharset_training
-
-    wordlist2dawg:
-        files: src/training/wordlist2dawg.cpp
-        dependencies: libtesseract
-
-    unicharset_training:
-        type: lib
-        static_only: true
-        files:
-            - src/training/fileio.*
-            - src/training/icuerrorcode.*
-            - src/training/lang_model_helpers.*
-            - src/training/lstmtester.*
-            - src/training/normstrngs.*
-            - src/training/unicharset_training_utils.*
-            - src/training/validat.*
-        include_directories: training
-        dependencies:
-            - common_training
-            - pvt.cppan.demo.unicode.icu.i18n
-
-    lstmeval:
-        files: src/training/lstmeval.cpp
-        dependencies: unicharset_training
-
-    lstmtraining:
-        files: src/training/lstmtraining.cpp
-        dependencies: unicharset_training
-
-    set_unicharset_properties:
-        files: src/training/set_unicharset_properties.cpp
-        dependencies: unicharset_training
-
-    text2image:
-        files:
-            - src/training/text2image.cpp
-            - src/training/boxchar.cpp
-            - src/training/boxchar.h
-            - src/training/degradeimage.cpp
-            - src/training/degradeimage.h
-            - src/training/ligature_table.cpp
-            - src/training/ligature_table.h
-            - src/training/normstrngs.cpp
-            - src/training/normstrngs.h
-            - src/training/pango_font_info.cpp
-            - src/training/pango_font_info.h
-            - src/training/stringrenderer.cpp
-            - src/training/stringrenderer.h
-            - src/training/tlog.cpp
-            - src/training/tlog.h
-            - src/training/util.h
-
-        dependencies:
-            - unicharset_training
-            - pvt.cppan.demo.gnome.pango.pangocairo: 1

+ 10
- 14
src/training/CMakeLists.txt

@@ -6,12 +6,12 @@ if (UNIX AND NOT ANDROID)
     set(LIB_pthread pthread)
 endif()
 
-if (CPPAN_BUILD OR SW_BUILD)
+if (SW_BUILD)
     set(ICU_FOUND 1)
 endif()
 
 # experimental
-if (MSVC AND NOT CPPAN_BUILD AND NOT SW_BUILD AND NOT USE_SYSTEM_ICU)
+if (MSVC AND NOT SW_BUILD AND NOT USE_SYSTEM_ICU)
     include(CheckTypeSize)
     check_type_size("void *" SIZEOF_VOID_P)
 
@@ -55,7 +55,7 @@ if (MSVC AND NOT CPPAN_BUILD AND NOT SW_BUILD AND NOT USE_SYSTEM_ICU)
 endif()
 # experimental
 
-if (NOT CPPAN_BUILD AND NOT SW_BUILD)
+if (NOT SW_BUILD)
     find_package(ICU 52.1 COMPONENTS uc i18n)
 endif()
 
@@ -180,8 +180,8 @@ install                     (TARGETS wordlist2dawg RUNTIME DESTINATION bin LIBRA
 
 if (ICU_FOUND)
 
-if (NOT CPPAN_BUILD AND NOT SW_BUILD)
-include_directories(${ICU_INCLUDE_DIRS})
+if (NOT SW_BUILD)
+    include_directories(${ICU_INCLUDE_DIRS})
 endif()
 
 ########################################
@@ -211,9 +211,7 @@ set(unicharset_training_src
 
 )
 add_library                 (unicharset_training ${unicharset_training_src})
-if (CPPAN_BUILD)
-target_link_libraries       (unicharset_training common_training pvt.cppan.demo.unicode.icu.i18n)
-elseif (SW_BUILD)
+if (SW_BUILD)
 target_link_libraries       (unicharset_training common_training org.sw.demo.unicode.icu.i18n)
 else()
 target_link_libraries       (unicharset_training common_training ${ICU_LIBRARIES})
@@ -275,11 +273,11 @@ install                     (TARGETS unicharset_extractor RUNTIME DESTINATION bi
 # EXECUTABLE text2image
 ########################################
 
-if (NOT CPPAN_BUILD AND NOT SW_BUILD)
-find_package(PkgConfig)
+if (NOT SW_BUILD)
+    find_package(PkgConfig)
 endif()
 
-if (PKG_CONFIG_FOUND OR CPPAN_BUILD OR SW_BUILD)
+if (PKG_CONFIG_FOUND OR SW_BUILD)
 
 if (PKG_CONFIG_FOUND)
 pkg_check_modules(Pango REQUIRED pango>=1.22.0)
@@ -324,9 +322,7 @@ target_link_libraries       (text2image
     ${FontConfig_LIBRARIES}
 )
 endif()
-if (CPPAN_BUILD)
-target_link_libraries       (text2image pvt.cppan.demo.gnome.pango.pangocairo)
-elseif (SW_BUILD)
+if (SW_BUILD)
 target_link_libraries       (text2image org.sw.demo.gnome.pango.pangocairo)
 endif()
 project_group               (text2image "Training Tools")