[CMake] CXX incorrectly includes CMakeFortranInformation.cmake for MinGW/MSYS/Wine

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sun Apr 4 19:16:11 EDT 2010


Clint (with an old version of MinGW) and I (with MinGW-4.5) have been
running into a peculiar CXX error for MinGW/MSYS on Wine.

Enabling C++ _sometimes_ fails because it includes
CMakeFortranInformation.cmake (why?) which then leads to a
"get_filename_component called with incorrect number of arguments"

I have been doing a bunch of experiments with this and I get this error for
the following cases.

1. (This is the one where I have attached the --trace --debug-output from
cmake)

project(test NONE )
enable_language(CXX )

2. 
project(test CXX)

3.
project(test NONE )
enable_language(CXX )
enable_language(Fortran )

In contrast to 3. The following succeeded:

A. 
project(test CXX Fortran )

B.
project(test NONE )
enable_language(Fortran )
enable_language(CXX )

All the above experiments (and generation of the attached file for the first
case) were done with Windows cmake-2.8.1 on the MinGW/MSYS/Wine platform
with "MSYS Makefiles" generator.

Cases (1), (2), (3), and (B) all feature CXX being enabled separately
from Fortran (if Fortran appears at all).  A working hypothesis
to explain these results which is also consistent with the attached
--trace output is that separate CXX enabling also enables Fortran
as a side effect for the "MSYS Makefiles" generator.  For the first 3 cases
this leads to an error because Fortran is uninitialized.  For case (B) Fortran
has been initialized so that the extra CXX side effect has no bad
consequences.

That leaves the case A success to explain, but that case takes a separate
path through the CMake code and perhaps in that case, Fortran is done before
CXX as in case B.

Other experiments...

I temporarily moved CMakeFortranInformation.cmake out of the way for
case (2), and obtained success.

I also tried the Windows version of cmake-2.6.4 for case (2) with everything
else the same and got the same issue.

I also tried case (2) with Linux (and --trace) and got success;
CMakeFortranInformation.cmake is not included for that case.

I hope the attached cmake --trace --debug-output output for case (1) and my
variety of above experiments will help the CMake developers figure this out.

For those with access to MinGW/MSYS/Windows here, could you please try to
verify the above failures and successes (it will only take a few minutes
since the required CMakeLists.txt files are only a few lines at most) for
the "MSYS Makefiles" generator in an effort to eliminate Wine or some nasty
interaction between Wine and CMake as the cause for these issues?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake.out.gz
Type: application/octet-stream
Size: 10424 bytes
Desc: test case cmake output with --trace and --debug-output
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100404/9edb6d8b/attachment.obj>


More information about the CMake mailing list