Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer require building kvssink to build samples #1159

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(KINESIS_VIDEO_PRODUCER_CPP_VERSION ${KINESIS_VIDEO_PRODUCER_CPP_MAJOR_VERSIO

# User Flags
option(BUILD_GSTREAMER_PLUGIN "Build kvssink GStreamer plugin" OFF)
optoin(BUILD_SAMPLES "Whether to build the samples" ON)
stefankiesz marked this conversation as resolved.
Show resolved Hide resolved
option(BUILD_JNI "Build C++ wrapper for JNI to expose the functionality to Java/Android" OFF)
option(BUILD_STATIC "Build with static linkage" OFF)
option(ADD_MUCLIBC "Add -muclibc c flag" OFF)
Expand Down Expand Up @@ -228,20 +229,28 @@ if(BUILD_JNI)
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()


if(BUILD_GSTREAMER_PLUGIN)
pkg_check_modules(GST_APP REQUIRED gstreamer-app-1.0)
include_directories(${GST_APP_INCLUDE_DIRS})
link_directories(${GST_APP_LIBRARY_DIRS})
include_directories(${OPEN_SRC_INSTALL_PREFIX}/include)

if(BUILD_STATIC)
add_library(gstkvssink STATIC ${GST_PLUGIN_SOURCE_FILES})
else()
add_library(gstkvssink MODULE ${GST_PLUGIN_SOURCE_FILES})
endif()
target_link_libraries(gstkvssink PRIVATE ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES} KinesisVideoProducer)

install(
TARGETS gstkvssink
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

endif()

if(BUILD_SAMPLES)
add_executable(kvssink_gstreamer_sample samples/kvssink_gstreamer_sample.cpp)
target_link_libraries(kvssink_gstreamer_sample ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES} kvspic)

Expand All @@ -257,12 +266,14 @@ if(BUILD_GSTREAMER_PLUGIN)
add_executable(kvs_gstreamer_file_uploader_sample samples/kvs_gstreamer_file_uploader_sample.cpp)
target_link_libraries(kvs_gstreamer_file_uploader_sample ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES})

install(
TARGETS gstkvssink
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

if(BUILD_GSTREAMER_PLUGIN)
if(BUILD_STATIC)
add_library(gstkvssink STATIC ${GST_PLUGIN_SOURCE_FILES})
else()
add_library(gstkvssink MODULE ${GST_PLUGIN_SOURCE_FILES})
endif()
target_link_libraries(gstkvssink PRIVATE ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES} KinesisVideoProducer)
endif()
endif()

if(BUILD_TEST)
Expand Down
Loading