mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 12:40:05 +08:00
Merge pull request #23095 from fengyuentau:fix_omp_macos
* fix openmp include and link issue on macos * turn off have_openmp if OpenMP_CXX_INCLUDE_DIRS is empty * test commit * use condition HAVE_OPENMP and OpenMP_CXX_LIBRARIES for linking * remove trailing whitespace * remove notes * update conditions * use OpenMP_CXX_LIBRARIES for linking
This commit is contained in:
parent
a9d02f096e
commit
c63d79c5b1
@ -32,6 +32,9 @@ if(WITH_OPENMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
if(DEFINED OpenMP_CXX_INCLUDE_DIRS AND OpenMP_CXX_INCLUDE_DIRS)
|
||||
ocv_include_directories(${OpenMP_CXX_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
set(HAVE_OPENMP "${OPENMP_FOUND}")
|
||||
endif()
|
||||
|
@ -168,6 +168,10 @@ if(HAVE_HPX)
|
||||
ocv_target_link_libraries(${the_module} LINK_PRIVATE "${HPX_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
if(HAVE_OPENMP AND DEFINED OpenMP_CXX_LIBRARIES AND OpenMP_CXX_LIBRARIES)
|
||||
ocv_target_link_libraries(${the_module} LINK_PRIVATE "${OpenMP_CXX_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
ocv_add_accuracy_tests()
|
||||
ocv_add_perf_tests()
|
||||
|
||||
|
@ -10,3 +10,7 @@ ocv_define_module(video
|
||||
python
|
||||
js
|
||||
)
|
||||
|
||||
if(HAVE_OPENMP AND DEFINED OpenMP_CXX_LIBRARIES AND OpenMP_CXX_LIBRARIES)
|
||||
ocv_target_link_libraries(${the_module} LINK_PRIVATE "${OpenMP_CXX_LIBRARIES}")
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user