modernize the way how to check/deal with OpenMP. This helps also on the macOS side.
This commit is contained in:
parent
6a7178b3a9
commit
45d87bc645
@ -110,13 +110,13 @@ find_package(FFTW3 REQUIRED)
|
||||
find_package(LibXml2 REQUIRED)
|
||||
|
||||
#--- check for OpenMP ---------------------------------------------------------
|
||||
if (try_OpenMP AND NOT APPLE)
|
||||
if (try_OpenMP)
|
||||
find_package(OpenMP)
|
||||
if (OpenMP_FOUND)
|
||||
if (OpenMP_CXX_FOUND)
|
||||
add_definitions(-DHAVE_GOMP)
|
||||
set(HAVE_GOMP 1 CACHE INTERNAL "Have GOMP")
|
||||
endif (OpenMP_FOUND)
|
||||
endif (try_OpenMP AND NOT APPLE)
|
||||
endif (OpenMP_CXX_FOUND)
|
||||
endif (try_OpenMP)
|
||||
|
||||
#--- check for CUDA and/or OpenCL followed by DKS -----------------------------
|
||||
if (dks)
|
||||
|
@ -171,11 +171,6 @@ if (ROOT_GRTEQ_24)
|
||||
target_compile_options(PMusr BEFORE PRIVATE "-DROOT_GRTEQ_24")
|
||||
endif(ROOT_GRTEQ_24)
|
||||
|
||||
#--- add OpenMP compile options if needed -------------------------------------
|
||||
if (OpenMP_FOUND)
|
||||
target_compile_options(PMusr PUBLIC ${OpenMP_CXX_FLAGS})
|
||||
endif (OpenMP_FOUND)
|
||||
|
||||
#--- add DKS compiler flags if enabled ----------------------------------------
|
||||
if (DKS_FOUND)
|
||||
if (CUDA_FOUND)
|
||||
@ -198,11 +193,7 @@ if (nexus)
|
||||
set(DependOnLibs ${DependOnLibs} PNeXus)
|
||||
endif (nexus)
|
||||
if (OpenMP_FOUND)
|
||||
if (OpenMP_CXX_LIBRARIES)
|
||||
set(DependOnLibs ${DependOnLibs} ${OpenMP_CXX_LIBRARIES})
|
||||
else (OpenMP_CXX_LIBRARIES)
|
||||
set(DependOnLibs ${DependOnLibs} ${OpenMP_CXX_FLAGS}) # for older cmake OpenMP_CXX_LIBRARIES is not defined
|
||||
endif (OpenMP_CXX_LIBRARIES)
|
||||
set(DependOnLibs ${DependOnLibs} OpenMP::OpenMP_CXX)
|
||||
endif (OpenMP_FOUND)
|
||||
if (DKS_FOUND)
|
||||
if (APPLE)
|
||||
|
10
src/external/libFitPofB/classes/CMakeLists.txt
vendored
10
src/external/libFitPofB/classes/CMakeLists.txt
vendored
@ -91,17 +91,9 @@ target_include_directories(
|
||||
)
|
||||
|
||||
#--- add library dependencies -------------------------------------------------
|
||||
if (OpenMP_FOUND)
|
||||
target_compile_options(FitPofB PUBLIC ${OpenMP_CXX_FLAGS})
|
||||
endif (OpenMP_FOUND)
|
||||
|
||||
set(gomp "")
|
||||
if (OpenMP_FOUND)
|
||||
if (OpenMP_CXX_LIBRARIES)
|
||||
set(gomp ${OpenMP_CXX_LIBRARIES})
|
||||
else (OpenMP_CXX_LIBRARIES)
|
||||
set(gomp ${OpenMP_CXX_FLAGS}) # for older cmake OpenMP_CXX_LIBRARIES is not defined
|
||||
endif (OpenMP_CXX_LIBRARIES)
|
||||
set(gomp OpenMP::OpenMP_CXX)
|
||||
endif (OpenMP_FOUND)
|
||||
target_link_libraries(FitPofB
|
||||
${gomp}
|
||||
|
10
src/external/libLFRelaxation/CMakeLists.txt
vendored
10
src/external/libLFRelaxation/CMakeLists.txt
vendored
@ -53,17 +53,9 @@ target_include_directories(
|
||||
)
|
||||
|
||||
#--- add library dependencies -------------------------------------------------
|
||||
if (OpenMP_FOUND)
|
||||
target_compile_options(LFRelaxation PUBLIC ${OpenMP_CXX_FLAGS})
|
||||
endif (OpenMP_FOUND)
|
||||
|
||||
set(gomp "")
|
||||
if (OpenMP_FOUND)
|
||||
if (OpenMP_CXX_LIBRARIES)
|
||||
set(gomp ${OpenMP_CXX_LIBRARIES})
|
||||
else (OpenMP_CXX_LIBRARIES)
|
||||
set(gomp ${OpenMP_CXX_FLAGS}) # for older cmake OpenMP_CXX_LIBRARIES is not defined
|
||||
endif (OpenMP_CXX_LIBRARIES)
|
||||
set(gomp OpenMP::OpenMP_CXX)
|
||||
endif (OpenMP_FOUND)
|
||||
target_link_libraries(LFRelaxation
|
||||
${gomp}
|
||||
|
Loading…
x
Reference in New Issue
Block a user