Internal Interface Libraries and Header Dependencies

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Internal Interface Libraries and Header Dependencies

Christian Mazakas
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

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Internal Interface Libraries and Header Dependencies

Florent Castelli
If they were not propagated, it wouldn't compile at all, so they're definitely there somewhere.
Can you show your CMakeLists.txt files?

/Florent


On 12/07/2017 19:59, Christian Mazakas wrote:
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




--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake