paullouisageneau / libdatachannel

C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
https://libdatachannel.org/
Mozilla Public License 2.0
1.73k stars 352 forks source link

CMake script does not install STATIC library and static dependencies #1208

Open pfeatherstone opened 2 months ago

pfeatherstone commented 2 months ago

I'm building and installing this library using the following commands:

cmake . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
sudo cmake --build build --target install

I was expecting it to build the static library libdatachannel-static.a by default and installing it along with its dependencies:

paullouisageneau commented 2 months ago

CMakelists builds the shared library by default. The static library can be built with the target datachannel-static, however only the shared library can be installed.

pfeatherstone commented 2 months ago

Cheers. It is possible to amend the script to allow for installing the static library along with it dependencies ?

mkm85 commented 2 weeks ago

Had the same issue, maybe just remove the static vs dynamic stuff and only provide a single library called LibDataChannel, then it is up to the one who compiles the library to specify if it should be built as static or dynamic. Consumers of the library can then simply link against LibDataChannel::LibDataChannel without having to worry about how it is compiled.