make sure that older cmake versions (<= 3.8) inject the right linker flags for OpenMP.

This commit is contained in:
suter_a 2018-05-07 13:02:22 +02:00
parent 9370b2cd4d
commit 9bdb8ec2ec

View File

@ -111,7 +111,11 @@ if (nexus)
set(DependOnLibs ${DependOnLibs} PNeXus)
endif (nexus)
if (OpenMP_FOUND)
set(DependOnLibs ${DependOnLibs} ${OpenMP_CXX_LIBRARIES})
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)
endif (OpenMP_FOUND)
target_link_libraries(PUserFcnBase ${ROOT_LIBRARIES})