[CMake] Adding C(XX)FLAGS by using an environment variable?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Jul 2 17:35:20 EDT 2008


On 2008-07-02 18:23+0100 Mike Arthur wrote:

> On Wednesday 02 July 2008 15:51:03 you wrote:
>> export CC='gcc -g'
> Is it just 'export CXX' for C++ compiler?

Yes.

For future reference the only "documentation" for setting compiler flags
through environment variables that I can find at the present time is in the
Modules/CMakeDetermine<lang>Compiler.cmake files where "lang" is C, CXX,
Fortran, etc.  The PROGRAM_ARGS argument of GET_FILENAME_COMPONENT does the
job in those various files.

For some reason, all documentation of setting flags for compilers using
environment variables was removed from
http://www.cmake.org/Wiki/CMake_Useful_Variables.  Furthermore, only CC and
CXX (without flags) are mentioned in passing there and it doesn't even
mention FC for fortran which is another removal there which IMO was
completely wrong-headed.

To the CMake developers: is there some policy decision behind these removals
from the documentation or was that just a mistake somebody (not necessarily
a CMake developer) did when they updated the wiki?

Once I get an answer to that question, I would be happy to restore the
useful computer language environment variable documentation to the wiki so
long as I am not going to end up wasting my time fighting some CMake
developer who feels strongly it should be removed again.

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