Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4 from xsacha/hunter-3.05.01
Browse files Browse the repository at this point in the history
Use Threads target. Fixes Android.
  • Loading branch information
ruslo authored Jun 25, 2017
2 parents 205a2a1 + 97f0650 commit 91db1f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ endif()
if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")

set(LIB_pthread pthread)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
set(LIB_pthread Threads::Threads)
endif()

###############################################################################
Expand Down
7 changes: 6 additions & 1 deletion cmake/templates/TesseractConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@
include(${CMAKE_CURRENT_LIST_DIR}/TesseractTargets.cmake)

find_package(Leptonica CONFIG REQUIRED)
if(UNIX)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
endif()
if(@Tesseract_USE_OPENCL@)
if (APPLE)
if(APPLE)
find_package(OpenCL REQUIRED)
else()
find_package(OpenCL CONFIG REQUIRED)
Expand Down

0 comments on commit 91db1f9

Please sign in to comment.