[CMake] MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Arjen Markus Arjen.Markus at deltares.nl
Thu Feb 8 14:33:42 EST 2018


Hello,



In the PLplot project we are looking for a way to combine the MinGW-w64/MSYS2 platform (or Cygwin) with the NAG Fortran compiler. The reason for this is that both MinGW-w64/MSYS2 and Cygwin come with a nice repository of libraries, some of which we can use in the context of PLplot. The NAG Fortran compiler is a very nice, strict, compiler that is available for both Windows and Linux (and possibly other platforms as well). I know in principle how to combine NAG Fortran with the GCC tools, so this part of the combination is not the problem.



The problem is rather this:

If I start a console with MinGW-w64/MSYS2 or Cygwin I get an environment where all the libraries that I want can be found, but that environment is identified by CMake as "MinGW" or "Cygwin", so that the NAG Fortran specific settings are ignored.



(I store them in a file MinGW-NAG-Fortran.cmake, in analogy with all the other such files - a file Windows-NAG-Fortran.cmake does do the job for the "bare" Windows platform.)



The NAG Fortran compiler is selected, just like I want, instead of the gfortran compiler, as I define FC to be "nagfor" and I have expanded the PATH to include all the stuff for NAG Fortran.



But the crucial part is that CMake uses the settings for the GNU compilers.



So: Is it possible to instruct CMake to use the NAG-Fortran specific settings and if so, how do I do that?



Regards,



Arjen



DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180208/39894f5c/attachment.html>


More information about the CMake mailing list