Skip to content

Commit a9274df

Browse files
committed
Resolving conflicts
1 parent 1626e1e commit a9274df

30 files changed

+314
-351
lines changed
File renamed without changes.
File renamed without changes.

src/CMakeLists.txt

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,52 @@ if (ENABLE_BLACKMAGIC)
114114

115115
endif()
116116

117+
################ OPENCV ##################
118+
119+
find_package( OpenCV 4 )
120+
if (OpenCV_FOUND)
121+
message("\nCOMPILING WITH OPENCV\n")
122+
set(CMAKE_SWIG_FLAGS "-DUSE_OPENCV=1")
123+
add_definitions( -DUSE_OPENCV=1 )
124+
else()
125+
message("\nOPENCV NOT FOUND, SOME FUNCTIONALITIES WILL BE DISABLED\n")
126+
endif()
127+
128+
################ PROTOBUF ##################
129+
if (OpenCV_FOUND)
130+
find_package(Protobuf 3)
131+
132+
if (NOT Protobuf_FOUND)
133+
# Protobuf is required when compiling with opencv
134+
message(FATAL_ERROR "\nPLEASE INSTALL PROTOBUF. Protobuf is required when compiling with opencv.\n")
135+
endif()
136+
137+
include_directories(${PROTOBUF_INCLUDE_DIR})
138+
139+
set(PROTOBUF_MESSAGES_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/protobuf_messages")
140+
141+
FILE(GLOB PROTO_MSGS "${PROTOBUF_MESSAGES_FOLDER}/*.proto")
142+
foreach(PROTO_MSG ${PROTO_MSGS})
143+
execute_process (
144+
COMMAND bash -c "${PROTOBUF_PROTOC_EXECUTABLE} -I=${PROTOBUF_MESSAGES_FOLDER} --cpp_out=${PROTOBUF_MESSAGES_FOLDER} ${PROTO_MSG}"
145+
)
146+
endforeach()
147+
148+
FILE(GLOB PROTO_CCS "${PROTOBUF_MESSAGES_FOLDER}/*.pb.cc")
149+
foreach(PROTO_CC ${PROTO_CCS})
150+
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${PROTO_CC} ${CMAKE_CURRENT_SOURCE_DIR})
151+
file(REMOVE ${PROTO_CC})
152+
endforeach()
153+
154+
FILE(GLOB PROTO_HS "${PROTOBUF_MESSAGES_FOLDER}/*.pb.h")
155+
foreach(PROTO_H ${PROTO_HS})
156+
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${PROTO_H} ${CMAKE_CURRENT_SOURCE_DIR})
157+
file(REMOVE ${PROTO_H})
158+
endforeach()
159+
160+
endif()
161+
162+
117163
############### PROFILING #################
118164
#set(PROFILER "/usr/lib/libprofiler.so.0.3.2")
119165
#set(PROFILER "/usr/lib/libtcmalloc.so.4")
@@ -515,45 +561,6 @@ endif()
515561
### INSTALL HEADERS & LIBRARY
516562
###
517563

518-
############### CLI EXECUTABLES ################
519-
# Create test executable
520-
add_executable(openshot-example examples/Example.cpp)
521-
522-
523-
# Define path to test input files
524-
set(TEST_MEDIA_PATH "${PROJECT_SOURCE_DIR}/src/examples/")
525-
if (WIN32)
526-
string(REPLACE "/" "\\\\" TEST_MEDIA_PATH TEST_MEDIA_PATH)
527-
endif()
528-
target_compile_definitions(openshot-example PRIVATE
529-
-DTEST_MEDIA_PATH="${TEST_MEDIA_PATH}" )
530-
531-
# Link test executable to the new library
532-
target_link_libraries(openshot-example openshot)
533-
534-
535-
add_executable(openshot-html-test examples/ExampleHtml.cpp)
536-
target_link_libraries(openshot-html-test openshot Qt5::Gui)
537-
538-
############### OPENCV EXAMPLE EXECUTABLE ################
539-
if (OpenCV_FOUND)
540-
# Create test Opencv executable
541-
add_executable( openshotCV-example examples/Example_opencv.cpp )
542-
# Define path to test input files
543-
target_link_libraries( openshotCV-example ${OpenCV_LIBS} openshot)
544-
target_compile_definitions(openshotCV-example PRIVATE
545-
-DTEST_MEDIA_PATH="${TEST_MEDIA_PATH}" )
546-
# Link test executable to the new library
547-
target_link_libraries(openshot-example openshot)
548-
endif()
549-
550-
551-
############### PLAYER EXECUTABLE ################
552-
# Create test executable
553-
add_executable(openshot-player Qt/demo/main.cpp)
554-
555-
# Link test executable to the new library
556-
target_link_libraries(openshot-player openshot)
557564

558565
############### TEST BLACKMAGIC CAPTURE APP ################
559566
if (BLACKMAGIC_FOUND)
@@ -565,8 +572,6 @@ if (BLACKMAGIC_FOUND)
565572
target_link_libraries(openshot-blackmagic openshot)
566573
endif()
567574

568-
############### INCLUDE SWIG BINDINGS ################
569-
add_subdirectory(bindings)
570575

571576
############### INSTALL HEADERS & LIBRARY ################
572577

src/CVObjectDetection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
2929
*/
3030

31-
#include "../include/CVObjectDetection.h"
31+
#include "CVObjectDetection.h"
3232

3333
// // Initialize the parameters
3434
// float confThreshold = 0.5; // Confidence threshold

src/CVStabilization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
2929
*/
3030

31-
#include "../include/CVStabilization.h"
31+
#include "CVStabilization.h"
3232

3333
// Set default smoothing window value to compute stabilization
3434
CVStabilization::CVStabilization(std::string processInfoJson, ProcessingController &processingController)

src/CVTracker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
2929
*/
3030

31-
#include "../include/CVTracker.h"
31+
#include "CVTracker.h"
3232

3333
// Constructor
3434
CVTracker::CVTracker(std::string processInfoJson, ProcessingController &processingController)

0 commit comments

Comments
 (0)