Skip to content

Commit

Permalink
Merge pull request #1983 from openMVG/develop_modernize_openmp_usage
Browse files Browse the repository at this point in the history
Develop modernize openmp usage
  • Loading branch information
pmoulon committed Dec 9, 2021
2 parents 292568e + a78b941 commit 3819c86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ endif (CXX11_COMPILER)
if (OpenMVG_USE_OPENMP)
find_package(OpenMP)
if (OPENMP_FOUND)
register_definitions(-DOPENMVG_USE_OPENMP)
if(NOT TARGET OpenMP::OpenMP_CXX)
find_package(Threads REQUIRED)
add_library(OpenMP::OpenMP_CXX IMPORTED INTERFACE)
Expand All @@ -147,8 +148,8 @@ if (OpenMVG_USE_OPENMP)
# Only works if the same flag is passed to the linker; use CMake 3.9+ otherwise (Intel, AppleClang)
set_property(TARGET OpenMP::OpenMP_CXX
PROPERTY INTERFACE_LINK_LIBRARIES ${OpenMP_CXX_FLAGS} Threads::Threads)
list(APPEND OPENMVG_LIBRARY_DEPENDENCIES ${OpenMP_CXX_FLAGS})
endif()
list(APPEND OPENMVG_LIBRARY_DEPENDENCIES OpenMP::OpenMP_CXX)
endif (OPENMP_FOUND)
else (OpenMVG_USE_OPENMP)
option(OpenMVG_USE_OPENMP "Use OpenMP for parallelization" OFF)
Expand Down

0 comments on commit 3819c86

Please sign in to comment.