[CMake] Compaq Visual Fortran

Brad King brad.king at kitware.com
Tue Feb 16 10:12:13 EST 2010


Arjen Markus wrote:
>     f90.exe /compile_only -IF:\plplot-svn\plplot\bindings\f77\strutils.f
> 
> Compaq Visual Fortran has an option /include or /I or -I but also an
> option /iface:keyword or -IF:keyword.
> 
> In this particular constellation it is interpreting the options in the
> wrong manner! Instead of -I "F:\plplot-svn\..." it interprets the option
> as -IF:"\plplot-svn\plplot\..."
> 
> I am not sure if there are other compilers (except Intel Fortran) that
> use an optional colon to separate option name from the keyword, but
> the issue is wider than just this one:
> 
> What happens if someone puts the sources in a directory whose name
> contains a space, like: "c:\my documents\my sources\" ?

It will be quoted or converted to the windows "shortpath" format which
never has spaces.  CMake quotes only when necessary (see below).

The documented way to change the include path flag to "-I " instead
of just "-I" is:

  set(CMAKE_INCLUDE_FLAG_C "-I ")
  set(CMAKE_INCLUDE_FLAG_CXX "-I ")

Reading the source, I see there is an undocumented way to force
quoting of include paths:

  set(CMAKE_QUOTE_INCLUDE_PATHS 1)

One of the above should be added to the compiler information file for
Compaq.

> Shouldn't all file names and directory names be properly delimited?

Quoting on windows is a PITA because programs receive one big command
line string from the operating system on startup.  Most programs just
let the runtime library parse the string to produce argv[] and call
main, but some tools get the command line string and parse it themselves.

-Brad


More information about the CMake mailing list