mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-24 02:59:07 +08:00
cmake: add option to build with libcurl support
This commit is contained in:
parent
ff5f59cf24
commit
eafbb2b22a
@ -89,6 +89,8 @@ option(FAST_FLOAT "Enable float for LSTM" OFF)
|
||||
option(BUILD_TRAINING_TOOLS "Build training tools" ON)
|
||||
option(BUILD_TESTS "Build tests" OFF)
|
||||
option(USE_SYSTEM_ICU "Use system ICU" OFF)
|
||||
option(DISABLE_CURL "Disable build with libcurl (if available)" OFF)
|
||||
|
||||
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.15.0")
|
||||
if(WIN32 AND MSVC)
|
||||
option(WIN32_MT_BUILD "Build with MT flag for MSVC" OFF)
|
||||
@ -359,6 +361,19 @@ else()
|
||||
if(LibArchive_FOUND)
|
||||
set(HAVE_LIBARCHIVE ON)
|
||||
endif()
|
||||
if (DISABLE_CURL)
|
||||
set(HAVE_LIBCURL OFF)
|
||||
else(DISABLE_CURL)
|
||||
find_package(CURL)
|
||||
if(NOT CURL_FOUND AND PKG_CONFIG_EXECUTABLE)
|
||||
# try PKG_CONFIG to find libcurl if cmake failed
|
||||
pkg_check_modules(CURL libcurl)
|
||||
endif()
|
||||
if(CURL_FOUND)
|
||||
set(HAVE_LIBCURL ON)
|
||||
include_directories(${CURL_INCLUDE_DIRS})
|
||||
endif(CURL_FOUND)
|
||||
endif(DISABLE_CURL)
|
||||
endif()
|
||||
|
||||
find_package(OpenCL QUIET)
|
||||
@ -438,6 +453,7 @@ message( STATUS "Link-time optimization: ${CMAKE_INTERPROCEDURAL_OPTIMIZATION}")
|
||||
message( STATUS "--------------------------------------------------------")
|
||||
message( STATUS "Build with sw [SW_BUILD]: ${SW_BUILD}")
|
||||
message( STATUS "Build with openmp support [OPENMP_BUILD]: ${OPENMP_BUILD}")
|
||||
message( STATUS "Build with libcurl support [HAVE_LIBCURL]: ${HAVE_LIBCURL}")
|
||||
message( STATUS "Enable float for LSTM [FAST_FLOAT]: ${FAST_FLOAT}")
|
||||
message( STATUS "Disable disable graphics (ScrollView) [GRAPHICS_DISABLED]: ${GRAPHICS_DISABLED}")
|
||||
message( STATUS "Disable the legacy OCR engine [DISABLED_LEGACY_ENGINE]: ${DISABLED_LEGACY_ENGINE}")
|
||||
@ -662,6 +678,9 @@ target_link_libraries (libtesseract PRIVATE ${LIB_Ws2_32} ${LIB_pthrea
|
||||
if(OpenMP_CXX_FOUND)
|
||||
target_link_libraries(libtesseract PUBLIC OpenMP::OpenMP_CXX)
|
||||
endif()
|
||||
if(CURL_FOUND)
|
||||
target_link_libraries(libtesseract PUBLIC ${CURL_LIBRARIES})
|
||||
endif(CURL_FOUND)
|
||||
set_target_properties (libtesseract PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
|
||||
set_target_properties (libtesseract PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
|
||||
if (WIN32)
|
||||
|
@ -112,6 +112,7 @@ file(APPEND ${AUTOCONFIG_SRC} "
|
||||
#cmakedefine FAST_FLOAT ${FAST_FLOAT}
|
||||
#cmakedefine DISABLED_LEGACY_ENGINE ${DISABLED_LEGACY_ENGINE}
|
||||
#cmakedefine HAVE_LIBARCHIVE ${HAVE_LIBARCHIVE}
|
||||
#cmakedefine HAVE_LIBCURL ${HAVE_LIBCURL}
|
||||
")
|
||||
|
||||
if(TESSDATA_PREFIX)
|
||||
|
Loading…
Reference in New Issue
Block a user