From 9ff07eac3aafde8541e532f804e20beadb879a6f Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Wed, 27 Mar 2024 14:37:47 -0600 Subject: [PATCH] CMake: openmp optional for FF and CPP if not explicitly requested (correction) --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20297c27b6..b2dc54651d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,11 +110,13 @@ include(${CMAKE_SOURCE_DIR}/cmake/set_rpath.cmake) # OpenMP #------------------------------------------------------------------------------- -if (OPENMP) +if (OPENMP OR BUILD_FASTFARM OR BUILD_OPENFAST_CPP_API) + if (OPENMP) FIND_PACKAGE(OpenMP REQUIRED) -endif() -if (BUILD_FASTFARM OR BUILD_OPENFAST_CPP_API) - FIND_PACKAGE(OpenMP) + else() + # Optional for FF or the CPP interface + FIND_PACKAGE(OpenMP) + endif() if (OpenMP_Fortran_FOUND) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}") link_libraries("${OpenMP_Fortran_LIBRARIES}")