From 04be7be06b4d7a472df70196c2f5272ff07f7d96 Mon Sep 17 00:00:00 2001 From: canihavesomecoffee Date: Wed, 8 Jun 2016 02:25:13 +0200 Subject: [PATCH] Add OCR build support Adds OCR build support by creating two new build configs (one debug, one release) and some instructions about what VS expects on those configs. --- .gitignore | 12 +- windows/ccextractor.sln | 6 + windows/ccextractor.vcproj | 744 ---------------------------------- windows/ccextractor.vcxproj | 78 ++++ windows/libs/installation.txt | 21 + 5 files changed, 114 insertions(+), 747 deletions(-) delete mode 100644 windows/ccextractor.vcproj create mode 100644 windows/libs/installation.txt diff --git a/.gitignore b/.gitignore index d638cf14..52f5bf9e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,8 @@ CVS *.o linux/ccextractor linux/depend -windows/debug/** -windows/release/** +windows/Debug/** +windows/Release/** build/ #### @@ -24,4 +24,10 @@ build/ #### # Ignore the header file that is updated upon build -src/lib_ccx/compile_info.h \ No newline at end of file +src/lib_ccx/compile_info.h + +#### Ignore windows OCR libraries and folders +windows/libs/leptonica/** +windows/libs/tesseract/** +windows/Release-OCR/** +windows/Debug-OCR/** \ No newline at end of file diff --git a/windows/ccextractor.sln b/windows/ccextractor.sln index 99c22292..123a4c8a 100644 --- a/windows/ccextractor.sln +++ b/windows/ccextractor.sln @@ -8,13 +8,19 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug-OCR|Win32 = Debug-OCR|Win32 Release|Win32 = Release|Win32 + Release-OCR|Win32 = Release-OCR|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Debug|Win32.ActiveCfg = Debug|Win32 {0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Debug|Win32.Build.0 = Debug|Win32 + {0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Debug-OCR|Win32.ActiveCfg = Debug-OCR|Win32 + {0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Debug-OCR|Win32.Build.0 = Debug-OCR|Win32 {0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Release|Win32.ActiveCfg = Release|Win32 {0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Release|Win32.Build.0 = Release|Win32 + {0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Release-OCR|Win32.ActiveCfg = Release-OCR|Win32 + {0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Release-OCR|Win32.Build.0 = Release-OCR|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/windows/ccextractor.vcproj b/windows/ccextractor.vcproj deleted file mode 100644 index 948da6c0..00000000 --- a/windows/ccextractor.vcproj +++ /dev/null @@ -1,744 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/windows/ccextractor.vcxproj b/windows/ccextractor.vcxproj index dc4ec7af..8dc35d08 100644 --- a/windows/ccextractor.vcxproj +++ b/windows/ccextractor.vcxproj @@ -1,10 +1,18 @@  + + Debug-OCR + Win32 + Debug Win32 + + Release-OCR + Win32 + Release Win32 @@ -232,6 +240,14 @@ Application v120 + + Application + v120 + + + Application + v120 + @@ -241,6 +257,12 @@ + + + + + + <_ProjectFileVersion>12.0.21005.1 @@ -251,6 +273,22 @@ true ccextractorwin + + Debug-OCR\ + Debug-OCR\ + true + ccextractorwin + $(ProjectDir)libs\tesseract\include\tesseract;$(ProjectDir)libs\leptonica\include\leptonica;$(IncludePath) + $(ProjectDir)libs\tesseract\lib;$(ProjectDir)libs\leptonica\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86) + + + Release-OCR\ + Release-OCR\ + false + ccextractorwin + $(ProjectDir)libs\tesseract\include\tesseract;$(ProjectDir)libs\leptonica\include\leptonica;$(IncludePath) + $(ProjectDir)libs\tesseract\lib;$(ProjectDir)libs\leptonica\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86) + Release\ Release\ @@ -277,6 +315,46 @@ MachineX86 + + + Disabled + ../src/win_spec_incld;../src/gpacmp4;../src/libpng;../src/zlib;../src;../src/lib_ccx;../src/zvbi;%(AdditionalIncludeDirectories) + ENABLE_OCR;WIN32;_DEBUG;_CONSOLE;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + WS2_32.Lib;libtesseract302.lib;liblept168.lib;%(AdditionalDependencies) + NotSet + true + Console + MachineX86 + + + + + Disabled + ../src/win_spec_incld;../src/gpacmp4;../src/libpng;../src/zlib;../src;../src/lib_ccx;../src/zvbi;%(AdditionalIncludeDirectories) + ENABLE_OCR;WIN32;NDEBUG;_CONSOLE;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + Level3 + ProgramDatabase + + + WS2_32.Lib;libtesseract302.lib;liblept168.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX86 + + ../src/win_spec_incld;../src/lib_ccx;../src/lib_hash;../src/gpacmp4;../src/libpng;../src/zlib;../src/zvbi;%(AdditionalIncludeDirectories) diff --git a/windows/libs/installation.txt b/windows/libs/installation.txt new file mode 100644 index 00000000..a855ec7e --- /dev/null +++ b/windows/libs/installation.txt @@ -0,0 +1,21 @@ +In order to compile CCExtractor with OCR support (the (Release|Debug)-OCR configurations), +we need the header files and .lib files for two libraries: Tesseract and Leptonica. + +The project expects the following directory structure: + +leptonica + -> include + * library header files which leptonica depends on (gif_lib, zlib, png, ...) + -> leptonica + * leptonica headers (most importantly allheaders.h) + -> lib + * the .lib & .dll generated by compiling Leptonica +tesseract + -> include + -> tesseract + * tesseract headers (most importantly capi.h) + -> lib + * the .lib & .dll generated by compiling Tesseract + + +Currently CCExtractor makes use of liblept168 (Leptonica 1.68) and libtesseract302 (Tesseract 3.02). \ No newline at end of file