From a3e7b6f8cd27702d6a9427e14755bf5f2c28dcca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 20 Dec 2023 14:31:38 +0100 Subject: [PATCH] CMake: Import OpenMP targets to global scope --- CHOLMOD/CMakeLists.txt | 2 +- GraphBLAS/CMakeLists.txt | 2 +- LAGraph/CMakeLists.txt | 2 +- ParU/CMakeLists.txt | 2 +- SuiteSparse_config/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHOLMOD/CMakeLists.txt b/CHOLMOD/CMakeLists.txt index 6f7053a39..2c269f1e4 100644 --- a/CHOLMOD/CMakeLists.txt +++ b/CHOLMOD/CMakeLists.txt @@ -75,7 +75,7 @@ endif ( ) option ( SUITESPARSE_USE_OPENMP "ON (default): Use OpenMP if available. OFF: Do not use OpenMP" ON ) option ( CHOLMOD_USE_OPENMP "ON: Use OpenMP in CHOLMOD if available. OFF: Do not use OpenMP. (Default: SUITESPARSE_USE_OPENMP)" ${SUITESPARSE_USE_OPENMP} ) if ( CHOLMOD_USE_OPENMP ) - find_package ( OpenMP ) + find_package ( OpenMP GLOBAL ) else ( ) # OpenMP has been disabled set ( OpenMP_C_FOUND OFF ) diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index 5758a4dc1..196d95aee 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -90,7 +90,7 @@ endif ( ) option ( SUITESPARSE_USE_OPENMP "ON (default): Use OpenMP if available. OFF: Do not use OpenMP" ON ) option ( GRAPHBLAS_USE_OPENMP "ON: Use OpenMP in GraphBLAS if available. OFF: Do not use OpenMP. (Default: SUITESPARSE_USE_OPENMP)" ${SUITESPARSE_USE_OPENMP} ) if ( GRAPHBLAS_USE_OPENMP ) - find_package ( OpenMP ) + find_package ( OpenMP GLOBAL ) else ( ) # OpenMP has been disabled. set ( OpenMP_C_FOUND OFF ) diff --git a/LAGraph/CMakeLists.txt b/LAGraph/CMakeLists.txt index 369533062..4d31ce16c 100644 --- a/LAGraph/CMakeLists.txt +++ b/LAGraph/CMakeLists.txt @@ -161,7 +161,7 @@ if ( COVERAGE ) message ( STATUS "OpenMP disabled for test coverage" ) else ( ) if ( LAGRAPH_USE_OPENMP ) - find_package ( OpenMP ) + find_package ( OpenMP GLOBAL ) if ( OpenMP_C_FOUND AND BUILD_STATIC_LIBS ) list ( APPEND LAGRAPH_STATIC_LIBS ${OpenMP_C_LIBRARIES} ) endif ( ) diff --git a/ParU/CMakeLists.txt b/ParU/CMakeLists.txt index ca4abcb9b..843e6351e 100644 --- a/ParU/CMakeLists.txt +++ b/ParU/CMakeLists.txt @@ -54,7 +54,7 @@ option ( SUITESPARSE_USE_OPENMP "ON (default): Use OpenMP if available. OFF: Do option ( PARU_USE_OPENMP "ON: Use OpenMP in ParU if available. OFF: Do not use OpenMP. (Default: SUITESPARSE_USE_OPENMP)" ${SUITESPARSE_USE_OPENMP} ) if ( PARU_USE_OPENMP ) # OpenMP 4.5 or later is required - find_package ( OpenMP ) + find_package ( OpenMP GLOBAL ) if ( OpenMP_CXX_FOUND AND OpenMP_CXX_VERSION VERSION_LESS 4.5 ) set ( PARU_USE_OPENMP OFF ) endif ( ) diff --git a/SuiteSparse_config/CMakeLists.txt b/SuiteSparse_config/CMakeLists.txt index 17874691a..d508a3b08 100644 --- a/SuiteSparse_config/CMakeLists.txt +++ b/SuiteSparse_config/CMakeLists.txt @@ -59,7 +59,7 @@ endif ( ) option ( SUITESPARSE_USE_OPENMP "ON (default): Use OpenMP if available. OFF: Do not use OpenMP" ON ) if ( SUITESPARSE_USE_OPENMP ) - find_package ( OpenMP ) + find_package ( OpenMP GLOBAL ) else ( ) # OpenMP has been disabled message ( STATUS "OpenMP disabled" )