[cmake-developers] target_include_directories and empty lists

Brad King brad.king at kitware.com
Wed Jul 31 09:50:01 EDT 2013


On 07/31/2013 09:17 AM, Stephen Kelly wrote:
> On 07/31/2013 03:13 PM, Brad King wrote:
>> On 07/31/2013 09:11 AM, Stephen Kelly wrote:
>>> http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=452e58525bb1656df0a169c8a047c25837caa4cf
>> [snip]
>>>     Docs: Document that target property commands require at least one item.
>> [snip]
>>> -      "<INTERFACE|PUBLIC|PRIVATE> [items1...]\n"
>>> +      "<INTERFACE|PUBLIC|PRIVATE> item [items1...]\n"
>> What is wrong with an empty list of items?
> 
> I didn't see any reason not to be 'strict'.

The use case in issue 14325 is very common and IMO expected behavior.
In fact throughout the reviews I assumed this was allowed based not
only on the documentation but what I thought we intended.  What about
the tll() version?

> Changing that behavior is something I'd recommend deferring to after
> 2.8.12 if you want to change it. I don't feel extremely strongly about
> keeping it strict.

How intrusive is the change?  I don't want to make people wait for
2.8.13 just to avoid creating conditions like

 if(mylist)
   target_include_directories(... PUBLIC ${mylist})
 endif()

They will end up being pervasive in code examples and stick around
far longer than we expect.  Just look at the use of the ancient
and completely unnecessary ARGS parameter to add_custom_command.

-Brad



More information about the cmake-developers mailing list