I have an application which depends on a library, which uses add_subdirectory() to include in our CMakeLists. This subdirectory is 3rd party code, and placed there as a git submodule, so I can’t easily modify CMakeLists.txt of the library itself, only the top level.
I am attempting to fix up cmake install settings for the application, and get CPack to work with it. The problem I have is that the installing the library (DLL files) also installs “includes”/header files which I don’t want to package with my application.
Is there any way to selectively choose what gets installed, from outside the library subdirectory?
Or failing that, can I specify some post-install, pre-packaging command through cmake to delete the unwanted includes?
What I tend to do in such situations is to use component install in my project and install just the binary I’m interested in as a part of my own component. Works like a charm.