Is there any way to safely include libraries (either internal or external) in the directory of a project (say in a lib/ folder) when you ship or release code? As far as I can see it would be a lot easier if the library files the application depended on were placed there; that way, other people wanting to use the code wouldn't have to download, compile and install the libraries on their own system (in the /usr/local/lib folder or likewise). If this is possible (or advisable), then other people could then just git clone the entire directory including the libraries, something like cmake could set the linker to pick up these libraries and the users could then just issue a cmake and make command rather than have to install the libraries on their system first.
I'm sure this might not work if the two machines have a different byte order or word length, but excluding these, is there any reason not to just put the .a or .so files in with your code?
If it is not possible (or recommended for some reason) to include the library files with the source code then are there any alternatives to having the other user download, compile and install them on their own machine? Containers (Docker) or dependency managers (Conan) perhaps?
p.s. I'm talking about c/c++ development in linux environments exclusively for desktop applications.