Skip to content

Commit

Permalink
CMake: openmp optional for FF and CPP if not explicitly requested (co…
Browse files Browse the repository at this point in the history
…rrection)
  • Loading branch information
andrew-platt committed Mar 27, 2024
1 parent db7e686 commit 9ff07ea
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 9ff07ea

Please sign in to comment.