cmake_minimum_required(VERSION 3.16) project(TestNag LANGUAGES Fortran) find_package(OpenMP REQUIRED) # Uncommenting those two commands works around the issue #set_property(TARGET OpenMP::OpenMP_Fortran PROPERTY # INTERFACE_LINK_LIBRARIES "") #set_property(TARGET OpenMP::OpenMP_Fortran PROPERTY INTERFACE_LINK_OPTIONS "-openmp") add_executable(test test.f90) target_link_libraries(test OpenMP::OpenMP_Fortran)