[CMake] cmake and openmp

Luis Kornblueh luis.kornblueh at mpimet.mpg.de
Mon Jul 18 07:49:47 EDT 2016


Hi everybody,

I do have a problem with OpenMP and cmake.

We have a code in Fortran, which uses different modules dependent if our
code gets compiled with or without OpenMP.

The flags used by the respective compiler to switch on OpenMP are
detected properly by the cmake find...().

But the dependency scanner does not know about and I did not found a way
to tell it to use the preprocessor variable _OPENMP, which is defined by
the compiler, if OpenMP is enabled.

If I set _OPENMP myself with add_definitions(), the dependency scanning
works as expected, but the compiler is complaining on a redefined macro,
the one from cmake and the other one from the compiler. Furthermore the
compiler one may contain information I don't know about and are getting
hidden by my redefinition ...

So, how can I define a macro for the dependency scanner only?

Cheerio,
Luis

-- 
                             \\\\\\
                             (-0^0-)
--------------------------oOO--(_)--OOo-----------------------------

 Luis Kornblueh                               Tel. : +49-40-41173289
 Max-Planck-Institute for Meteorology         Fax. : +49-40-41173298
 Bundesstr. 53
 D-20146 Hamburg                 Email: luis.kornblueh at mpimet.mpg.de
 Federal Republic of Germany


More information about the CMake mailing list