[cmake-developers] [CMake 0013038]: cannot set CMAKE_AR when cross-compiling Fortran-only project

Mantis Bug Tracker mantis at public.kitware.com
Mon Mar 12 13:04:42 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13038 
====================================================================== 
Reported By:                Marcin Wojdyr
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13038
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-03-12 13:04 EDT
Last Modified:              2012-03-12 13:04 EDT
====================================================================== 
Summary:                    cannot set CMAKE_AR when cross-compiling
Fortran-only project
Description: 
I'm trying to cross-compile LAPACK 3.4.0 on Fedora using MinGW cross-compiler.
Binutils paths are not set correctly.

The CMAKE_AR in cache file is set to /usr/bin/ar, even if I explicitly set in
toolchain file
SET(CMAKE_AR:FILEPATH /usr/bin/i686-pc-mingw32-ar)
or
SET(CMAKE_AR /usr/bin/i686-pc-mingw32-ar)

The only way to have the paths set correctly is to do:
SET(_CMAKE_TOOLCHAIN_PREFIX i686-pc-mingw32-)
but this is cmake internal variable.

I don't know cmake well, so I may be wrong, but I'd suppose there are two issues
here.

1. _CMAKE_TOOLCHAIN_PREFIX is set in CMakeDetermineCCompiler and
CMakeDetermineCXXCompiler.cmake, but not in CMakeDetermineFortranCompiler.
Most of Fortran projects use also C, so it is set anyway, but LAPACK has only
Fortran.

2. CMAKE_AR and CMAKE_RANLIB set explicitly are not respected.

Last note: it used to work, I cross-compiled this or previous lapack version
with cmake 2.8.5 or 6.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-03-12 13:04 Marcin Wojdyr  New Issue                                    
======================================================================




More information about the cmake-developers mailing list