William Clodius writes:

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

The easiest way is to export the FC variable with the name of the
compiler before any call to cmake.  It just has to be in the path, so
you do not have to worry about specifying the absolute filename.

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

Absolutely.  Those need to be separate build directories, one for each
different compiler/settings.  Remember that you can have as many of
these as you want.



Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 

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 

Follow this link to subscribe/unsubscribe:

Reply via email to