[CMake] How to specify $1 for compiler?

Jed Brown jed at 59A2.org
Thu Feb 3 14:30:08 EST 2011


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110203/21bc479f/attachment.htm>


More information about the CMake mailing list