modernize the way how to check/deal with OpenMP. This helps also on the macOS side.

This commit is contained in:
2024-06-07 12:44:59 +02:00
parent 418adfde67
commit ccaba41868
4 changed files with 7 additions and 32 deletions

View File

@@ -170,11 +170,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 library dependencies -------------------------------------------------
set(DependOnLibs ${ROOT_LIBARIES})
#set(DependOnLibs ${DependOnLibs} ${FFTW3_LIBRARY})
@@ -189,11 +184,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)
target_link_libraries(PUserFcnBase ${ROOT_LIBRARIES})