[CMake] Cannot set FOLDER property to an interface (header-only) target

David Cole DLRdave at aol.com
Thu Dec 31 08:19:49 EST 2015


I can't think of a reason why we would not whitelist the FOLDER property...
Unless somebody else chimes in with one, perhaps you could submit a
proposed patch to whitelist it?


D


On Wednesday, December 30, 2015, Klaim - Joël Lamotte <mjklaim at gmail.com>
wrote:

> The following CMake script:
>
>     cmake_minimum_required(VERSION 3.4)
>
>     add_library( mylib INTERFACE )
>     set_property( TARGET mylib PROPERTY FOLDER /some/dir )
>
>
> Will trigger this error on configuration:
>
>     CMake Error at CMakeLists.txt:4 (set_property):
>       INTERFACE_LIBRARY targets may only have whitelisted properties.  The
>       property "FOLDER" is not allowed.
>
>
> This prevent any interface library to be organized in Visual Studio
> virtual folders.
> Unfortunately it also mean that header-only targets can't be organized.
>
> I have no idea how this should be solved. Should the property just be
> white-listed?
> Or should a better have a another specific library mode for header-only
> targets?
>
> Is there any workaround?
>
> Joël Lamotte
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151231/6a2bc78c/attachment.html>


More information about the CMake mailing list