Skip to content

Commit

Permalink
Merge pull request #614 from OpenShot/jonoomph-updating-protobuf-library
Browse files Browse the repository at this point in the history
Fixing INSTALL issue related to ProtoBufMessage.dylib
  • Loading branch information
jonoomph committed Jan 11, 2021
2 parents 5b5763e + ad73d23 commit 49097ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Expand Up @@ -420,7 +420,7 @@ if (OpenCV_FOUND)
${OPENSHOT_CV_SOURCES})

# Link libopenshot with OpenCV libs
target_link_libraries(openshot PUBLIC ProtoMessages ${OpenCV_LIBS} ${PROTOBUF_LIBRARY} ${Protobuf_INCLUDE_DIRS})
target_link_libraries(openshot PUBLIC openshot_protobuf ${OpenCV_LIBS} ${PROTOBUF_LIBRARY} ${Protobuf_INCLUDE_DIRS})
endif()

############### LINK LIBRARY #################
Expand Down
16 changes: 14 additions & 2 deletions src/protobuf_messages/CMakeLists.txt
Expand Up @@ -31,9 +31,21 @@ include_directories(${PROTOBUF_INCLUDE_DIRS})

file(GLOB ProtoFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.proto")
PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
add_library(ProtoMessages SHARED ${ProtoSources} ${ProtoHeaders})
add_library(openshot_protobuf SHARED ${ProtoSources} ${ProtoHeaders})

set(ProtobufMessagePath ${CMAKE_CURRENT_BINARY_DIR}
CACHE INTERNAL "Path to generated protobuf header files.")

target_link_libraries(ProtoMessages ${Boost_LIBRARIES} ${PROTOBUF_LIBRARY})
target_link_libraries(openshot_protobuf ${Boost_LIBRARIES} ${PROTOBUF_LIBRARY})

# Set SONAME and other library properties
set_target_properties(openshot_protobuf PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_SO_VERSION}
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
)

# Install primary library
install(TARGETS openshot_protobuf
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

0 comments on commit 49097ce

Please sign in to comment.