mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-24 02:59:07 +08:00
fix #2847 cmake with OPENMP_BUILD=ON
This commit is contained in:
parent
faf54e08f7
commit
8ba14a655d
@ -151,8 +151,10 @@ if (OPENMP_BUILD)
|
||||
if (OpenMP_FOUND)
|
||||
message(">> ${OpenMP_FOUND} ${OpenMP_VERSION}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.9.0")
|
||||
add_library(OpenMP::OpenMP_CXX IMPORTED INTERFACE)
|
||||
endif()
|
||||
endif()
|
||||
# https://stackoverflow.com/questions/12399422/how-to-set-linker-flags-for-openmp-in-cmakes-try-compile-function
|
||||
if (NOT OpenMP_FOUND AND CLANG AND WIN32)
|
||||
# workaroung because find_package(OpenMP) does not work for clang-cl
|
||||
@ -448,6 +450,9 @@ target_compile_definitions (libtesseract
|
||||
set_target_properties (libtesseract PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS True)
|
||||
endif()
|
||||
target_link_libraries (libtesseract PRIVATE ${LIB_Ws2_32} ${LIB_pthread})
|
||||
if(OpenMP_CXX_FOUND)
|
||||
target_link_libraries(libtesseract PUBLIC OpenMP::OpenMP_CXX)
|
||||
endif()
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user