2012-05-25 21:12:02 +08:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Detect other 3rd-party performance and math libraries
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# --- TBB ---
|
|
|
|
if(WITH_TBB)
|
2012-09-15 19:45:27 +08:00
|
|
|
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectTBB.cmake")
|
2012-05-25 21:12:02 +08:00
|
|
|
endif(WITH_TBB)
|
|
|
|
|
|
|
|
# --- IPP ---
|
2014-04-08 18:01:44 +08:00
|
|
|
if(WITH_IPP)
|
2012-05-25 21:12:02 +08:00
|
|
|
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPP.cmake")
|
2014-04-02 22:32:19 +08:00
|
|
|
if(HAVE_IPP)
|
2017-04-13 20:50:23 +08:00
|
|
|
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPPIW.cmake")
|
|
|
|
if(HAVE_IPP_IW)
|
|
|
|
ocv_include_directories(${IPP_IW_INCLUDES})
|
|
|
|
list(APPEND OPENCV_LINKER_LIBS ${IPP_IW_LIBRARIES})
|
|
|
|
endif()
|
2012-05-25 21:12:02 +08:00
|
|
|
ocv_include_directories(${IPP_INCLUDE_DIRS})
|
2014-04-02 22:32:19 +08:00
|
|
|
list(APPEND OPENCV_LINKER_LIBS ${IPP_LIBRARIES})
|
2018-01-05 08:24:02 +08:00
|
|
|
|
|
|
|
# Details: #10229
|
|
|
|
if(ANDROID AND NOT OPENCV_SKIP_ANDROID_IPP_FIX_1)
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a ${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
elseif(ANDROID AND NOT OPENCV_SKIP_ANDROID_IPP_FIX_2)
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bsymbolic ${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
endif()
|
2012-05-25 21:12:02 +08:00
|
|
|
endif()
|
2014-04-02 22:32:19 +08:00
|
|
|
endif()
|
2012-05-25 21:12:02 +08:00
|
|
|
|
2014-02-24 14:44:54 +08:00
|
|
|
# --- IPP Async ---
|
|
|
|
|
|
|
|
if(WITH_IPP_A)
|
|
|
|
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPPAsync.cmake")
|
|
|
|
if(IPP_A_INCLUDE_DIR AND IPP_A_LIBRARIES)
|
|
|
|
ocv_include_directories(${IPP_A_INCLUDE_DIR})
|
|
|
|
link_directories(${IPP_A_LIBRARIES})
|
|
|
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${IPP_A_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
endif(WITH_IPP_A)
|
|
|
|
|
2012-05-25 21:12:02 +08:00
|
|
|
# --- CUDA ---
|
|
|
|
if(WITH_CUDA)
|
2012-09-15 19:45:27 +08:00
|
|
|
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCUDA.cmake")
|
2018-04-06 03:23:58 +08:00
|
|
|
if(NOT HAVE_CUDA)
|
2018-06-03 07:21:08 +08:00
|
|
|
message(WARNING "OpenCV is not able to find/configure CUDA SDK (required by WITH_CUDA).
|
2018-04-06 03:23:58 +08:00
|
|
|
CUDA support will be disabled in OpenCV build.
|
|
|
|
To eliminate this warning remove WITH_CUDA=ON CMake configuration option.
|
|
|
|
")
|
|
|
|
endif()
|
2012-05-25 21:12:02 +08:00
|
|
|
endif(WITH_CUDA)
|
|
|
|
|
|
|
|
# --- Eigen ---
|
|
|
|
if(WITH_EIGEN)
|
|
|
|
find_path(EIGEN_INCLUDE_PATH "Eigen/Core"
|
2013-08-27 17:57:24 +08:00
|
|
|
PATHS /usr/local /opt /usr $ENV{EIGEN_ROOT}/include ENV ProgramFiles ENV ProgramW6432
|
2012-05-25 21:12:02 +08:00
|
|
|
PATH_SUFFIXES include/eigen3 include/eigen2 Eigen/include/eigen3 Eigen/include/eigen2
|
2012-09-10 22:14:32 +08:00
|
|
|
DOC "The path to Eigen3/Eigen2 headers"
|
|
|
|
CMAKE_FIND_ROOT_PATH_BOTH)
|
2012-05-25 21:12:02 +08:00
|
|
|
|
|
|
|
if(EIGEN_INCLUDE_PATH)
|
|
|
|
ocv_include_directories(${EIGEN_INCLUDE_PATH})
|
|
|
|
ocv_parse_header("${EIGEN_INCLUDE_PATH}/Eigen/src/Core/util/Macros.h" EIGEN_VERSION_LINES EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION)
|
|
|
|
set(HAVE_EIGEN 1)
|
|
|
|
endif()
|
|
|
|
endif(WITH_EIGEN)
|
|
|
|
|
|
|
|
# --- Clp ---
|
|
|
|
# Ubuntu: sudo apt-get install coinor-libclp-dev coinor-libcoinutils-dev
|
|
|
|
ocv_clear_vars(HAVE_CLP)
|
|
|
|
if(WITH_CLP)
|
|
|
|
if(UNIX)
|
|
|
|
PKG_CHECK_MODULES(CLP clp)
|
|
|
|
if(CLP_FOUND)
|
|
|
|
set(HAVE_CLP TRUE)
|
|
|
|
if(NOT ${CLP_INCLUDE_DIRS} STREQUAL "")
|
|
|
|
ocv_include_directories(${CLP_INCLUDE_DIRS})
|
|
|
|
endif()
|
|
|
|
link_directories(${CLP_LIBRARY_DIRS})
|
|
|
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CLP_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT CLP_FOUND)
|
|
|
|
find_path(CLP_INCLUDE_PATH "coin"
|
|
|
|
PATHS "/usr/local/include" "/usr/include" "/opt/include"
|
|
|
|
DOC "The path to Clp headers")
|
|
|
|
if(CLP_INCLUDE_PATH)
|
|
|
|
ocv_include_directories(${CLP_INCLUDE_PATH} "${CLP_INCLUDE_PATH}/coin")
|
|
|
|
get_filename_component(_CLP_LIBRARY_DIR "${CLP_INCLUDE_PATH}/../lib" ABSOLUTE)
|
|
|
|
set(CLP_LIBRARY_DIR "${_CLP_LIBRARY_DIR}" CACHE PATH "Full path of Clp library directory")
|
|
|
|
link_directories(${CLP_LIBRARY_DIR})
|
|
|
|
if(UNIX)
|
|
|
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} Clp CoinUtils m)
|
|
|
|
else()
|
2012-10-09 02:24:38 +08:00
|
|
|
if(MINGW)
|
|
|
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} Clp CoinUtils)
|
|
|
|
else()
|
|
|
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} libClp libCoinUtils)
|
|
|
|
endif()
|
2012-05-25 21:12:02 +08:00
|
|
|
endif()
|
|
|
|
set(HAVE_CLP TRUE)
|
|
|
|
endif()
|
|
|
|
endif()
|
2013-02-18 19:35:42 +08:00
|
|
|
endif(WITH_CLP)
|
|
|
|
|
2013-02-13 19:09:30 +08:00
|
|
|
# --- C= ---
|
|
|
|
if(WITH_CSTRIPES AND NOT HAVE_TBB)
|
|
|
|
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCStripes.cmake")
|
|
|
|
else()
|
|
|
|
set(HAVE_CSTRIPES 0)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# --- GCD ---
|
2014-12-03 19:59:51 +08:00
|
|
|
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
2013-02-13 19:09:30 +08:00
|
|
|
set(HAVE_GCD 1)
|
|
|
|
else()
|
|
|
|
set(HAVE_GCD 0)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# --- Concurrency ---
|
2014-12-03 19:59:51 +08:00
|
|
|
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
2013-02-13 19:09:30 +08:00
|
|
|
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp")
|
2013-04-04 19:43:49 +08:00
|
|
|
file(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n")
|
|
|
|
try_compile(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}" "${_fname}")
|
|
|
|
file(REMOVE "${_fname}")
|
2013-02-13 19:09:30 +08:00
|
|
|
else()
|
|
|
|
set(HAVE_CONCURRENCY 0)
|
|
|
|
endif()
|
2014-12-03 19:59:51 +08:00
|
|
|
|
|
|
|
# --- OpenMP ---
|
|
|
|
if(WITH_OPENMP)
|
|
|
|
find_package(OpenMP)
|
|
|
|
if(OPENMP_FOUND)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
|
|
|
endif()
|
|
|
|
set(HAVE_OPENMP "${OPENMP_FOUND}")
|
|
|
|
endif()
|
2015-05-30 02:58:45 +08:00
|
|
|
|
2015-06-11 21:53:07 +08:00
|
|
|
ocv_clear_vars(HAVE_PTHREADS_PF)
|
2017-08-14 15:59:38 +08:00
|
|
|
if(WITH_PTHREADS_PF AND HAVE_PTHREAD)
|
|
|
|
set(HAVE_PTHREADS_PF 1)
|
2015-05-30 02:58:45 +08:00
|
|
|
else()
|
|
|
|
set(HAVE_PTHREADS_PF 0)
|
|
|
|
endif()
|