diff --git a/CMakeLists.txt b/CMakeLists.txt index 20297c27b..b2dc54651 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}")