Hi William,


The compiler is not determined via this line - that merely retrieves the name 
component from the full path to the actual compiler executable. CMake uses a 
number of methods, if I may express it that way, to determine which compiler 
(Fortran or otherwise to use). One of them is the FC environment variable. If 
that is not set, it searches through a list of possible compiler commands.



As for CMakeCache.txt and the like: it is best to start a build in a clean 
directory. Left-overs from a previous build may confuse the configuration and 
actual building of the program or programs.



(As for get_file_component: In the PLplot project the PATH part of the full 
path to the compiler is used to fine-tune the directories where the compiler 
libraries are to be found.)



Regards,



Arjen


Arjen Markus
Sr. Adviseur/Onderzoeker
T

+31(0)88 335 8559

E

arjen.mar...@deltares.nl




[Logo]<http://www.deltares.com/>

 www.deltares.com<http://www.deltares.com/>

Postbus 177
2600 MH Delft

[Deltares Twitter]
<http://www.twitter.com/deltares>

[Deltares LinkedIn]<http://www.linkedin.com/company/217430>

[Deltares Facebook]<https://www.facebook.com/pages/Deltares/154189334634001>



[Think before printing]Please consider the environment before printing this 
email


> -----Original Message-----
> From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of William Clodius
> Sent: Friday, April 13, 2018 4:34 AM
> To: cmake@cmake.org
> Subject: [CMake] Testing with multiple Fortran compilers
>
> I have been using CMake with gfortran for a number of years, and now want test
> my code with ifort. I want to switch easily switch between compilers. My
> CMakeLists.txt file is based on the fortran example from make.org an appears 
> to
> have most of the infrastructure needed, but I don't understand how the line
>
> get_filename_component (Fortran_COMPILER_NAME
> ${CMAKE_Fortran_COMPILER} NAME)
>
> determines the Fortran compiler to be used. Does it examine the FC system
> variable? Does it require the full pathname to the compiler executable? Do I 
> have to
> delete the CMakeCache.txt, Makefile, and cmake_install.cmake each time I 
> change
> compilers?
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake

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.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to