[CMake] FFLAGS and INCLUDE_DIRECTORIES ordering

Orion Poplawski orion at cora.nwra.com
Sat Mar 9 21:58:16 EST 2013


In Fedora, we are currently adding -I/usr/lib{,64}/gfortran/modules to 
FFLAGS when building so that projects can find system gfortran modules. 
  However, FFLAGS is being inserted into the compile command before the 
project's include directory specified by INCLUDE_DIRECTORIES.  This 
causes problem say when building a newer version of a package with and 
older version installed locally.

I'm a little surprised about the ordering as it seems different than the 
well established automake ordering 
(http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html) 
where the project's flags (which I would lump INCLUDE_DIRECTORIES into) 
come before the passed in flags.

So, is there a way to pass in a compiler option that will appear *after* 
the INCLUDE_DIRECTORIES paths?

Thanks for any help, suggestions.

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  orion at cora.nwra.com
Boulder, CO 80301              http://www.cora.nwra.com


More information about the CMake mailing list