[cmake-developers] Header-only library targets

Patrik Huber patrikhuber at gmail.com
Thu Jul 9 16:39:14 EDT 2015


Hi all,

I've recently switched from CMake 2.8.12 to 3.2, full of enthusiasm that
header-only libraries would now be better supported through the INTERFACE
option/target. However, the support for header-only libraries isn't really
great, in particular if you're using an IDE like Visual Studio.

The main problem is that if you define an INTERFACE target, there's no way
to specify headers, and they won't show up in IDEs. There's workarounds
with a custom target, but that's not really great for example to set
dependencies, populate the include directory of the library or to INSTALL
the target.

Brad King said in this (http://www.cmake.org/Bug/view.php?id=15234) ticket
that posting here would be appropriate. I've posted a couple of links to
Stackoverflow in the ticket as well - other people have this issue as well
and the only way out of it is some hacks, neither of which are satisfactory.

I'm sorry if this has been been discussed before, I just joined the list,
and I couldn't find any means to search through the mailing list archives
(except through Google, whose results didn't indicate it had been discussed
before). But even if it has been discussed before, I think it's appropriate
to raise this issue again - hopefully, a fix should not be that hard.

Thanks,

Patrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150709/890279f4/attachment-0001.html>


More information about the cmake-developers mailing list