[cmake-developers] Issuing errors for faulty INTERFACE_INCLUDE_DIRECTORIES

Brad King brad.king at kitware.com
Tue Mar 26 15:57:05 EDT 2013


On 03/26/2013 03:38 PM, Stephen Kelly wrote:
> Brad King wrote:
>> Alternatively one could solve this case with no additional CMake feature
>> by hiding the needed paths in $<1:...> generator expressions.  That is not
>> as explicit, but I would be okay with that as the recommended solution
>> over an awkwardly named property.
> 
> We could make it more explicit by adding a generator expression which 
> behaves the same as $<1:...> (like BUILD_INTERFACE already). This is also 
> more exact about what to exclude the check for:
> 
>  INTERFACE_INCLUDE_DIRECTORIES 
>    "/foo/bar;$<DELAYED_CREATION:/created/later>;/other/dir"

While this is not an edge case I think it is obscure enough that explaining
why the $<DELAYED_CREATION:...> expression exists will be too much for now.
Let's just leave it as-is and we can add other solutions if $<1:...> is too
problematic in practice.

> Unrelated to this specific issue, I've added another commit to stage with 
> another check (for relative paths). Additionally I've added a commit to my 
> clone in the error-on-exported-missing-include-dir branch, which introduces 
> a policy. That commit doesn't really have to be in CMake 2.8.11. Currently 
> the test doesn't pass, and I'm not sure why. The cmake_policy() line in the 
> test doesn't seem to have an effect.

Yes, after 2.8.11.

This line in the test:

 +cmake_minimum_required(VERSION 2.8)

should not be needed because the test CMakeLists.txt has them.

The switch on GetPolicyStatus does not use our standard convention.
Usually we have WARN fall through to OLD and have NEW as its own case.
Currently I think it is right but hard to follow.  Can you refactor?

I don't see at a glance why the test would fail.  You'll have to dig.

Thanks,
-Brad



More information about the cmake-developers mailing list