From b1a450cf2269c5b9ed882b7e8d786ebec3adb8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Fri, 20 Oct 2023 08:31:11 +0200 Subject: [PATCH] LAGraph: Link to OpenMP::OpenMP_C target --- LAGraph/CMakeLists.txt | 7 ++----- LAGraph/experimental/CMakeLists.txt | 4 ++-- LAGraph/src/CMakeLists.txt | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/LAGraph/CMakeLists.txt b/LAGraph/CMakeLists.txt index bfe16c3da5..922e805810 100644 --- a/LAGraph/CMakeLists.txt +++ b/LAGraph/CMakeLists.txt @@ -127,11 +127,8 @@ find_package (GraphBLAS 7.0.1 REQUIRED MODULE) if ( COVERAGE ) message ( STATUS "OpenMP disabled for test coverage" ) else ( ) - include ( FindOpenMP ) - include ( FindThreads ) - if ( OPENMP_FOUND ) - set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) - endif ( ) + find_package ( OpenMP ) + find_package ( Threads ) endif ( ) #------------------------------------------------------------------------------- diff --git a/LAGraph/experimental/CMakeLists.txt b/LAGraph/experimental/CMakeLists.txt index a88386ffca..0c38025f38 100644 --- a/LAGraph/experimental/CMakeLists.txt +++ b/LAGraph/experimental/CMakeLists.txt @@ -59,8 +59,8 @@ target_link_directories ( lagraphx_static BEFORE PUBLIC ${CMAKE_SOURCE_DIR}/buil #------------------------------------------------------------------------------- if ( OPENMP_FOUND ) - target_link_libraries ( lagraphx PUBLIC lagraph ${OpenMP_C_LIBRARIES} ) - target_link_libraries ( lagraphx_static PUBLIC lagraph_static ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( lagraphx PUBLIC lagraph OpenMP::OpenMP_C ) + target_link_libraries ( lagraphx_static PUBLIC lagraph_static OpenMP::OpenMP_C ) endif ( ) #------------------------------------------------------------------------------- diff --git a/LAGraph/src/CMakeLists.txt b/LAGraph/src/CMakeLists.txt index daa435fbb4..c40b1ba5a5 100644 --- a/LAGraph/src/CMakeLists.txt +++ b/LAGraph/src/CMakeLists.txt @@ -65,8 +65,8 @@ target_link_directories( lagraph_static BEFORE PUBLIC ${CMAKE_SOURCE_DIR}/build #------------------------------------------------------------------------------- if ( OPENMP_FOUND ) - target_link_libraries ( lagraph PUBLIC ${OpenMP_C_LIBRARIES} ) - target_link_libraries ( lagraph_static PUBLIC ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( lagraph PUBLIC OpenMP::OpenMP_C ) + target_link_libraries ( lagraph_static PUBLIC OpenMP::OpenMP_C ) endif ( ) #-------------------------------------------------------------------------------