modernize the way how to check/deal with OpenMP. This helps also on the macOS side.
This commit is contained in:
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}
|
||||
|
||||
Reference in New Issue
Block a user