[CMake] Order of IMPORTED target include directories

Brad King brad.king at kitware.com
Thu Apr 12 11:58:33 EDT 2018


On 04/10/2018 01:50 PM, Ephi Sinowitz (BLOOMBERG/ 919 3RD A) wrote:
> I would like to ensure that all include directories propagated from
> IMPORTED targets come after the include directories propagated from
> non-imported targets. On gcc the includes from IMPORTED targets are
> marked with -isystem which effectively moves these directories to the
> end of the include search path. Unfortunately not all compilers have
> an analagous compiler switch. Is there something else I can do to get
> the imported targets includes moved to the end?

CMake would have to be taught how to change the order during generation.
It would make sense to do that even for compilers that do not have
-isystem since that would make the directory ordering consistent with
compilers that do have -isystem.

If you want to work on this, look at IsSystemIncludeDirectory and its
call sites.

-Brad


More information about the CMake mailing list