Finds OpenMP support
This module can be used to detect OpenMP support in a compiler. If the compiler supports OpenMP, the flags required to compile with OpenMP support are returned in variables for the different languages. The variables may be empty if the compiler does not need a special flag to support OpenMP.
The module exposes the components C
, CXX
, and Fortran
. Each of these controls the various languages to search OpenMP support for.
Depending on the enabled components the following variables will be set:
OpenMP_FOUND
OpenMP_VERSION
This module will set the following variables per language in your project, where <lang>
is one of C, CXX, or Fortran:
OpenMP_<lang>_FOUND
<lang>
was detected.OpenMP_<lang>_FLAGS
<lang>
, separated by spaces.For linking with OpenMP code written in <lang>
, the following variables are provided:
OpenMP_<lang>_LIB_NAMES
<lang>
.OpenMP_<libname>_LIBRARY
<lang>
.OpenMP_<lang>_LIBRARIES
<lang>
.Additionally, the module provides IMPORTED
targets:
OpenMP::OpenMP_<lang>
<lang>
.Specifically for Fortran, the module sets the following variables:
OpenMP_Fortran_HAVE_OMPLIB_HEADER
omp_lib.h
.OpenMP_Fortran_HAVE_OMPLIB_MODULE
omp_lib
Fortran module.The module will also try to provide the OpenMP version variables:
OpenMP_<lang>_SPEC_DATE
<lang>
compiler.OpenMP_<lang>_VERSION_MAJOR
<lang>
compiler.OpenMP_<lang>_VERSION_MINOR
<lang>
compiler.OpenMP_<lang>_VERSION
<lang>
compiler.The specification date is formatted as given in the OpenMP standard: yyyymm
where yyyy
and mm
represents the year and month of the OpenMP specification implemented by the <lang>
compiler.
© 2000–2018 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.12/module/FindOpenMP.html