[CMake] Internal Interface Libraries and Header Dependencies

Christian Mazakas christian.mazakas at gmail.com
Wed Jul 12 13:59:59 EDT 2017


To give a brief overview of what I'm trying to do, right now I'm working on
a project with tests. I want to abstract my implementation into a library
that I can then link to when building both a testing binary and an
application binary.

The issue is, my library is currently header-only. So I figured that I
would generate an interface library out of this.

However, the header dependencies are not being propagated out to the
resulting executables. This means that any changes in my header files
appear to be ignored and don't cause the dependent source files to be
recompiled. The only way I can get proper behavior is to call
"target_include_directories" directly on each one of my executables.

For reference, I'm using the "Visual Studio 14 2015 Win64" generator on
Windows 10, building a CUDA project.

Does anyone have any insight on this? I can post my CMakeLists.txt file
should need be.

- Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170712/9a9b7786/attachment.html>


More information about the CMake mailing list