build: HAVE_LIBPTHREAD, HAVE_PTHREAD(S) => HAVE_PTHREAD

pull/9364/head
Alexander Alekhin 8 years ago
parent ef2b73043d
commit 6ff9fc67bb
  1. 7
      3rdparty/protobuf/CMakeLists.txt
  2. 2
      3rdparty/tbb/CMakeLists.txt
  3. 4
      CMakeLists.txt
  4. 11
      cmake/OpenCVFindLibsPerf.cmake
  5. 2
      cmake/templates/cvconfig.h.in

@ -2,11 +2,8 @@ project(libprotobuf)
include(CheckIncludeFiles)
if(NOT MSVC)
check_include_files("pthread.h" HAVE_PTHREAD)
if(HAVE_PTHREAD)
add_definitions(-DHAVE_PTHREAD=1)
endif()
if(HAVE_PTHREAD)
add_definitions(-DHAVE_PTHREAD=1)
endif()
if(MSVC)

@ -67,7 +67,7 @@ else()
)
endif()
if (HAVE_LIBPTHREAD)
if(HAVE_PTHREAD)
add_definitions(-DUSE_PTHREAD) #required for Unix
endif()

@ -554,7 +554,7 @@ if(UNIX)
include(CheckSymbolExists)
if(NOT APPLE)
CHECK_INCLUDE_FILE(pthread.h HAVE_LIBPTHREAD)
CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD)
if(ANDROID)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|DragonFly|OpenBSD")
@ -565,7 +565,7 @@ if(UNIX)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
endif()
else()
set(HAVE_LIBPTHREAD YES)
set(HAVE_PTHREAD 1)
endif()
CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN)

@ -125,16 +125,9 @@ if(WITH_OPENMP)
set(HAVE_OPENMP "${OPENMP_FOUND}")
endif()
if(NOT MSVC AND NOT DEFINED HAVE_PTHREADS)
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/pthread_test.cpp")
file(WRITE "${_fname}" "#include <pthread.h>\nint main() { (void)pthread_self(); return 0; }\n")
try_compile(HAVE_PTHREADS "${CMAKE_BINARY_DIR}" "${_fname}")
file(REMOVE "${_fname}")
endif()
ocv_clear_vars(HAVE_PTHREADS_PF)
if(WITH_PTHREADS_PF)
set(HAVE_PTHREADS_PF ${HAVE_PTHREADS})
if(WITH_PTHREADS_PF AND HAVE_PTHREAD)
set(HAVE_PTHREADS_PF 1)
else()
set(HAVE_PTHREADS_PF 0)
endif()

@ -154,7 +154,7 @@
#cmakedefine HAVE_PNG
/* Posix threads (pthreads) */
#cmakedefine HAVE_PTHREADS
#cmakedefine HAVE_PTHREAD
/* parallel_for with pthreads */
#cmakedefine HAVE_PTHREADS_PF

Loading…
Cancel
Save