Skip to content

Commit

Permalink
Unity plugin compatibility (CMU-Perceptual-Computing-Lab#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiuTinyat authored and gineshidalgo99 committed Jan 11, 2019
1 parent fc6d359 commit 6a6dd2e
Show file tree
Hide file tree
Showing 9 changed files with 634 additions and 24 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ if (WIN32)
endif (WIN32)

# Unity
# option(BUILD_UNITY_SUPPORT "Build OpenPose as a Unity plugin." OFF)
option(BUILD_UNITY_SUPPORT "Build OpenPose as a Unity plugin." OFF)

# Build as shared library
option(BUILD_SHARED_LIBS "Build as shared lib." ON)
Expand Down
3 changes: 3 additions & 0 deletions include/openpose/headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
// tracking module
#include <openpose/tracking/headers.hpp>

// unity module
#include <openpose/unity/headers.hpp>

// utilities module
#include <openpose/utilities/headers.hpp>

Expand Down
7 changes: 7 additions & 0 deletions include/openpose/unity/headers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef OPENPOSE_UNITY_HEADERS_HPP
#define OPENPOSE_UNITY_HEADERS_HPP

// unity module
#include <openpose/unity/unityBinding.hpp>

#endif // OPENPOSE_UNITY_HEADERS_HPP
3 changes: 3 additions & 0 deletions include/openpose/unity/unityBinding.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Temporarily, all the code is located in
// src/openpose/unity/unityBinding.cpp
// TODO: Move functionality from unityBinding.cpp to this class
1 change: 0 additions & 1 deletion src/openpose/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ if (UNIX OR APPLE)
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX OR APPLE)

2 changes: 1 addition & 1 deletion src/openpose/pose/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(SOURCES_OP_POSE
set(SOURCES_OP_POSE
defineTemplates.cpp
poseCpuRenderer.cpp
poseExtractor.cpp
Expand Down
21 changes: 21 additions & 0 deletions src/openpose/unity/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
set(SOURCES_OP_UNITY
unityBinding.cpp
)

include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
set(SOURCES_OP_UNITY_WITH_CP "" PARENT_SCOPE)
prepend(SOURCES_OP_UNITY_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_UNITY})
set(SOURCES_OP_UNITY_WITH_CP ${SOURCES_OP_UNITY_WITH_CP} PARENT_SCOPE)
set(SOURCES_OP_FILESTREAM_WITH_CP ${SOURCES_OP_FILESTREAM_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_UNITY_WITH_CP} PARENT_SCOPE)

if (UNIX OR APPLE)
add_library(openpose_unity ${SOURCES_OP_UNITY})
# target_link_libraries(openpose_unity openpose_pose ${OpenCV_LIBS})

install(TARGETS openpose_unity
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX OR APPLE)
Loading

0 comments on commit 6a6dd2e

Please sign in to comment.