You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
OpenCV/Protobuf: Install library and headers
This commit is contained in:
@@ -395,7 +395,7 @@ if(ENABLE_OPENCV)
|
||||
set(ENABLE_OPENCV FALSE CACHE BOOL
|
||||
"Build with OpenCV algorithms (requires Boost, Protobuf 3)" FORCE)
|
||||
else()
|
||||
add_subdirectory(protobuf_messsages)
|
||||
add_subdirectory(protobuf_messages)
|
||||
# Add OpenCV source files
|
||||
target_sources(openshot PRIVATE
|
||||
${OPENSHOT_CV_SOURCES}
|
||||
@@ -407,8 +407,10 @@ if(ENABLE_OPENCV)
|
||||
opencv_highgui
|
||||
opencv_dnn
|
||||
opencv_tracking
|
||||
protobuf::libprotobuf
|
||||
openshot_protobuf
|
||||
)
|
||||
set(HAVE_OPENCV TRUE CACHE BOOL "Building with OpenCV effects" FORCE)
|
||||
mark_as_advanced(HAVE_OPENCV)
|
||||
endif()
|
||||
endif()
|
||||
add_feature_info("OpenCV algorithms" ENABLE_OPENCV "Use OpenCV algorithms")
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
#include "Json.h"
|
||||
#include "ProcessingController.h"
|
||||
#include "Clip.h"
|
||||
#include "objdetectdata.pb.h"
|
||||
#include "protobuf_messages/objdetectdata.pb.h"
|
||||
|
||||
#include "../src/sort_filter/sort.hpp"
|
||||
#include "sort_filter/sort.hpp"
|
||||
|
||||
namespace openshot
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#undef uint64
|
||||
#undef int64
|
||||
#include <cmath>
|
||||
#include "stabilizedata.pb.h"
|
||||
#include "protobuf_messages/stabilizedata.pb.h"
|
||||
#include "ProcessingController.h"
|
||||
#include "Clip.h"
|
||||
#include "Json.h"
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
#include "Frame.h"
|
||||
#include "Json.h"
|
||||
#include "ProcessingController.h"
|
||||
#include "trackerdata.pb.h"
|
||||
#include "protobuf_messages/trackerdata.pb.h"
|
||||
|
||||
#include "../src/sort_filter/sort.hpp"
|
||||
#include "sort_filter/sort.hpp"
|
||||
|
||||
using namespace std;
|
||||
using google::protobuf::util::TimeUtil;
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#cmakedefine AVUTIL_VERSION_STR "@AVUTIL_VERSION_STR@"
|
||||
#cmakedefine01 HAVE_IMAGEMAGICK
|
||||
#cmakedefine01 HAVE_RESVG
|
||||
#cmakedefine01 HAVE_OPENCV
|
||||
#cmakedefine01 APPIMAGE_BUILD
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "../Color.h"
|
||||
#include "../Json.h"
|
||||
#include "../KeyFrame.h"
|
||||
#include "objdetectdata.pb.h"
|
||||
#include "protobuf_messages/objdetectdata.pb.h"
|
||||
|
||||
// Struct that stores the detected bounding boxes for all the clip frames
|
||||
struct DetectionData{
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "../Color.h"
|
||||
#include "../Json.h"
|
||||
#include "../KeyFrame.h"
|
||||
#include "stabilizedata.pb.h"
|
||||
#include "protobuf_messages/stabilizedata.pb.h"
|
||||
|
||||
using namespace std;
|
||||
using google::protobuf::util::TimeUtil;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "../Color.h"
|
||||
#include "../Json.h"
|
||||
#include "../KeyFrame.h"
|
||||
#include "trackerdata.pb.h"
|
||||
#include "protobuf_messages/trackerdata.pb.h"
|
||||
|
||||
using namespace std;
|
||||
using google::protobuf::util::TimeUtil;
|
||||
@@ -111,11 +111,11 @@ namespace openshot
|
||||
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
|
||||
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;
|
||||
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::shared_ptr<Frame> (new Frame()), frame_number); }
|
||||
|
||||
|
||||
// Load protobuf data file
|
||||
bool LoadTrackedData(std::string inputFilePath);
|
||||
|
||||
// Get tracker info for the desired frame
|
||||
|
||||
// Get tracker info for the desired frame
|
||||
EffectFrameData GetTrackedData(size_t frameId);
|
||||
|
||||
/// Get and Set JSON methods
|
||||
|
||||
@@ -26,8 +26,16 @@
|
||||
################################################################################
|
||||
|
||||
# Dependencies
|
||||
find_package(Protobuf 3)
|
||||
include_directories(${PROTOBUF_INCLUDE_DIRS})
|
||||
find_package(Protobuf 3 REQUIRED)
|
||||
|
||||
# Create a target for libprotobuf, if necessary (CMake < 3.9)
|
||||
if(NOT TARGET protobuf::libprotobuf)
|
||||
add_library(protobuf_TARGET INTERFACE)
|
||||
target_include_directories(protobuf_TARGET
|
||||
INTERFACE ${Protobuf_INCLUDE_DIRS})
|
||||
target_link_libraries(protobuf_TARGET INTERFACE ${Protobuf_LIBRARIES})
|
||||
add_library(protobuf::libprotobuf ALIAS protobuf_TARGET)
|
||||
endif()
|
||||
|
||||
file(GLOB ProtoFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.proto")
|
||||
PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
|
||||
@@ -36,7 +44,7 @@ add_library(openshot_protobuf SHARED ${ProtoSources} ${ProtoHeaders})
|
||||
set(ProtobufMessagePath ${CMAKE_CURRENT_BINARY_DIR}
|
||||
CACHE INTERNAL "Path to generated protobuf header files.")
|
||||
|
||||
target_link_libraries(openshot_protobuf ${Boost_LIBRARIES} ${PROTOBUF_LIBRARY})
|
||||
target_link_libraries(openshot_protobuf protobuf::libprotobuf)
|
||||
|
||||
# Set SONAME and other library properties
|
||||
set_target_properties(openshot_protobuf PROPERTIES
|
||||
@@ -45,7 +53,13 @@ set_target_properties(openshot_protobuf PROPERTIES
|
||||
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
|
||||
)
|
||||
|
||||
# Install primary library
|
||||
# Install protobuf library and generated headers
|
||||
install(TARGETS openshot_protobuf
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libopenshot
|
||||
)
|
||||
install(FILES ${ProtoHeaders}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libopenshot/protobuf_messages
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user