I'm trying to build a C++ Project with CMake that contains a shared library (Lua) , the problem I'm having is that I only want to ship the Packages with Lua when building a Tar.gz for Linux or an NSIS installer for Windows, when packaging a deb or rpm package the library should be listed as a dependency (liblua5.3-0) but not actually be packaged.
Is it somehow possible to exclude files or build targets in CPack based on the generator?
I think the answer is to
installconditionallyI would probably make an option for this which is set at the top of my top-level cmake file, then use it in any
installcommands I come accross.If you don't like making users set too many options, could you derive it from
${CPACK_GENERATOR}if that's user-defined. In my projects, I tend to setCPACK_GENERATORafter myinstallcommands, so that wouldn't work as well for me.