[CMake] Interface targets with their own project in Visual Studio

Robert Dailey rcdailey.lists at gmail.com
Thu Jul 28 12:04:42 EDT 2016


On Tue, Jul 19, 2016 at 9:38 AM, Robert Dailey <rcdailey.lists at gmail.com> wrote:
> Hello,
>
> I'd like to define an INTERFACE library that has header files only but
> still generates its own project in Visual Studio. The only way to add
> headers to an interface target that I'm aware of is
> target_source_files(), which instead of creating a project it will
> cause the header files themselves to propagate to the actual targets
> that specify the interface target as a link dependency.
>
> Is there a way to change this behavior?
>
> If not, the only workaround I can think of is pretty old-school:
> add_custom_target(), but if I use that I'm not sure I can specify
> include directories and preprocessor definitions that will be
> inherited by dependencies. So it seems like I'm forced to choose one
> or the other.

Anyone have any thoughts on this please?


More information about the CMake mailing list