amazon-kinesis-video-streams-producer-sdk-cpp
amazon-kinesis-video-streams-producer-sdk-cpp copied to clipboard
Allow using prebuilt libkvscproducer through pkg-config (#1193)
Original PR: https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/pull/1193
Description of Changes
(aside from original PR changes)
- Introduced a new CMake option to control the building of the KVS Producer C dependency library.
- Before, the library was always built from source (regardless of the value of the BUILD_DEPENDENCIES option). Now, whether it is built from source or found using pkg-config can be controlled with the new option.
Testing
These changes were tested locally on an M2 Mac with AppleClang-16 compiler using the following steps:
- Clone, then build and install the KVS Producer C SDK using the following commands:
mkdir build && cd build
cmake .. -DBUILD_COMMON_LWS=FALSE -DBUILD_COMMON_CURL=TRUE
make
make install
-
Move the Producer C dependency library files into the same installation directory as the libcproducer and libkvsCommonCurl library files which were installed in the previous step.
In my case, library files are using the.dylibextension andlibcproducer.dylibandlibkvsCommonCurl.dylibwere located in/usr/local/lib.
The dependency library files to move to that directory are:libcrypto.dylib,libssl.dylib, andlibcurl.dylibwhich are located inamazon-kinesis-video-streams-producer-c/open-source/lib/amazon-kinesis-video-streams-producer-c/open-source/lib/pkgconfigdirectory with its contentsamazon-kinesis-video-streams-producer-c/open-source/lib/cmakedirectory with its contents
-
Clone, then build the KVS Producer Cpp SDK using the following commands:
mkdir build && cd build
cmake .. -DBUILD_PRODUCER_C=OFF -DBUILD_GSTREAMER_PLUGIN=ON
make
- Use the following command to verify the libraries linked to the outputted KVS Producer Cpp library:
otool -L libKinesisVideoProducer.dylib
The output should show that the library is using Producer Cpp dependency(s) local to the build (currently just the log4cplus dependency) but using rpath for the Producer C libraries (libkvsCommonCurl and libcproducer):
libKinesisVideoProducer.dylib:
@rpath/libKinesisVideoProducer.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/libkvsCommonCurl.1.dylib (compatibility version 1.0.0, current version 1.5.4)
@rpath/libcproducer.1.dylib (compatibility version 1.0.0, current version 1.5.4)
/my/path/to/amazon-kinesis-video-streams-producer-sdk-cpp/open-source/local/lib/liblog4cplus-2.0.3.dylib (compatibility version 6.0.0, current version 6.2.0)
- Run a sample application to verify the build succeeded:
./kvs_gstreamer_sample myStreamName
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.