[CMake] CMAKE_SOURCE_DIR overwritten by CMake Fortran language support

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Mar 26 16:28:54 EDT 2010


Hi Brad:

The PLplot project still uses some special Fortran support files for our
CMake-2.6.4 users, but we have run into cross-platform problems in that case
where Linux can access our special location for Fortran Platform files, but
MinGW cannot.  It has been reported (by Arjen Markus) that the MinGW issue
is because something in that case overwrites CMAKE_SOURCE_DIR (which
we are using to help locate our special platform files in our
version of CMakeFortranInformation.cmake for CMake-2.6.4).

We are currently trying using CMAKE_HOME_DIRECTORY rather than
CMAKE_SOURCE_DIR in our version of CMakeFortranInformation.cmake for
CMake-2.6.4 in hopes that the MinGW CMake Fortran support infrastructure
will not overwrite that important variable as well.

These are issues for old versions of CMake that I hope we can work around,
but I am drawing them to your attention just in case modern CMake also
overwrites CMAKE_SOURCE_DIR as part of MinGW Fortran support. I just think
that is a bad idea which I hope you have been able to avoid in modern CMake.
However, if important CMake variables like this necessarily must be
overwritten by CMake language support, then that unusual behaviour should be
documented.

N.B. For others here I want to make clear that ordinary CMake code does
not see the effects of the overwriting of CMAKE_SOURCE_DIR for MinGW.
The effect of that change instead appears to be limited just to files such
as CMakeFortranInformation.cmake which are part of the CMake-2.6.x language
support infrastructure, and my question to Brad was whether that strange
result had also propagated to CMake-2.8.x.

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
__________________________


More information about the CMake mailing list