1 # ----------------------------------------------------------------------------
2 # Detect other 3rd-party performance and math libraries
3 # ----------------------------------------------------------------------------
7 include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectTBB.cmake")
11 if(WITH_IPP OR WITH_ICV)
12 include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPP.cmake")
14 ocv_include_directories(${IPP_INCLUDE_DIRS})
15 list(APPEND OPENCV_LINKER_LIBS ${IPP_LIBRARIES})
22 include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPPAsync.cmake")
23 if(IPP_A_INCLUDE_DIR AND IPP_A_LIBRARIES)
24 ocv_include_directories(${IPP_A_INCLUDE_DIR})
25 link_directories(${IPP_A_LIBRARIES})
26 set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${IPP_A_LIBRARIES})
32 include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCUDA.cmake")
37 find_path(EIGEN_INCLUDE_PATH "Eigen/Core"
38 PATHS /usr/local /opt /usr $ENV{EIGEN_ROOT}/include ENV ProgramFiles ENV ProgramW6432
39 PATH_SUFFIXES include/eigen3 include/eigen2 Eigen/include/eigen3 Eigen/include/eigen2
40 DOC "The path to Eigen3/Eigen2 headers"
41 CMAKE_FIND_ROOT_PATH_BOTH)
43 if(EIGEN_INCLUDE_PATH)
44 ocv_include_directories(${EIGEN_INCLUDE_PATH})
45 ocv_parse_header("${EIGEN_INCLUDE_PATH}/Eigen/src/Core/util/Macros.h" EIGEN_VERSION_LINES EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION)
51 # Ubuntu: sudo apt-get install coinor-libclp-dev coinor-libcoinutils-dev
52 ocv_clear_vars(HAVE_CLP)
55 PKG_CHECK_MODULES(CLP clp)
58 if(NOT ${CLP_INCLUDE_DIRS} STREQUAL "")
59 ocv_include_directories(${CLP_INCLUDE_DIRS})
61 link_directories(${CLP_LIBRARY_DIRS})
62 set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CLP_LIBRARIES})
67 find_path(CLP_INCLUDE_PATH "coin"
68 PATHS "/usr/local/include" "/usr/include" "/opt/include"
69 DOC "The path to Clp headers")
71 ocv_include_directories(${CLP_INCLUDE_PATH} "${CLP_INCLUDE_PATH}/coin")
72 get_filename_component(_CLP_LIBRARY_DIR "${CLP_INCLUDE_PATH}/../lib" ABSOLUTE)
73 set(CLP_LIBRARY_DIR "${_CLP_LIBRARY_DIR}" CACHE PATH "Full path of Clp library directory")
74 link_directories(${CLP_LIBRARY_DIR})
76 set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} Clp CoinUtils m)
79 set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} Clp CoinUtils)
81 set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} libClp libCoinUtils)
90 if(WITH_CSTRIPES AND NOT HAVE_TBB)
91 include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCStripes.cmake")
97 if(WITH_OPENMP AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
100 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
101 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
103 set(HAVE_OPENMP "${OPENMP_FOUND}")
107 if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
113 # --- Concurrency ---
114 if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
115 set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp")
116 file(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n")
117 try_compile(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}" "${_fname}")
118 file(REMOVE "${_fname}")
120 set(HAVE_CONCURRENCY 0)