[CMake] How to specify $1 for compiler?

Michael Wild themiwi at gmail.com
Thu Feb 3 14:33:57 EST 2011


On 02/03/2011 08:30 PM, Jed Brown wrote:
> I need to build a compilation command of the form
> 
>   win32fe f90 -with -options -and source.f -o path/to/source.f.o
> 
> but setting CMAKE_Fortran_COMILER=/path/to/win32fe and
> CMAKE_Fortran_FLAGS="f90 -with -options" does not work because CMake places
> other options in between:
> 
>   win32fe -o path/to/source.f.o -with -options source.f
> 
> which does not work because win32fe needs the compiler to come first.  Note
> that the C compiler seems to place the "-o" options later so
> CMAKE_C_COMPILER=/path/to/win32fo CMAKE_C_FLAGS="cl -with -options" is
> working.
> 
> Is this difference in options placement intentional? Is there a robust way
> to make something be $1 in the command line?

Have you tried this?

CMAKE_Fortran_COMPILER="/path/to/win32fe -f90 -with -options"

Michael


More information about the CMake mailing list