My company sells a commercial Linux app that depends on the NVIDIA CUDA toolkit. However many of our customers do not have root access on their boxes and can't install CUDA themselves, so we want to bundle the CUDA static libraries with our app.
Our legal department has indicated that we need to actually include the contents of the library inside one of our app's existing static libraries rather than just shipping the CUDA static library as a separate file. I can create such a merged library by hand, and it works fine:
libtool --mode=link gcc -static -o <my library>.a <my library's object files> /usr/local/cuda/lib64/libcudart_static.a
(I know this is not portable, but I'm only targeting Linux, so it's okay)
I'm having trouble doing this from within CMake and feel like I'm fighting the system. Is there a reasonably sane way to do this?
I've read a lot of SO answers on the subject but none that I've found concern how to create a merged static library from 3rd-party binaries from within CMake.