diff --git a/CMakeLists.txt b/CMakeLists.txt index 08971a6df6b7a36bb34652e2b69aeed007a39918..2bbdf23d32bba0a61c8079ae26f9002d48ddae9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ project(openpose) -cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR) # min. cmake version recommmended by Caffe +cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR) # min. cmake version recommended by Caffe ### FIND THE OS @@ -150,22 +150,21 @@ if (${DL_FRAMEWORK} MATCHES "CAFFE") # Build Caffe include(ExternalProject) - set(BUILD_CAFFE ON) set(CAFFE_PREFIX caffe) set(CAFFE_URL ${CMAKE_SOURCE_DIR}/3rdparty/caffe) - ExternalProject_Add(${CAFFE_PREFIX} + ExternalProject_Add(openpose_caffe SOURCE_DIR ${CAFFE_URL} PREFIX ${CAFFE_PREFIX} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -DUSE_CUDNN=${USE_CUDNN} -DOpenCV_DIR=${OpenCV_DIR}) - ExternalProject_Get_Property(caffe install_dir) + ExternalProject_Get_Property(openpose_caffe install_dir) - set(Caffe_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/build/caffe/include) + set(Caffe_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/caffe/include) # TODO -- Find a better soln. - set(Caffe_LIBS ${CMAKE_SOURCE_DIR}/build/caffe/lib/libcaffe.so) + set(Caffe_LIBS ${CMAKE_BINARY_DIR}/caffe/lib/libcaffe.so) endif (BUILD_CAFFE) @@ -248,3 +247,30 @@ if (DOWNLOAD_HAND_MODEL) endif (DOWNLOAD_HAND_MODEL) message(STATUS "Models Downloaded.") + +### INSTALL + +# Install the headers +install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/openpose DESTINATION include) +install(EXPORT OpenPose DESTINATION lib/OpenPose) +if (BUILD_CAFFE) + install(DIRECTORY ${CMAKE_BINARY_DIR}/caffe/include/caffe DESTINATION include) + install(DIRECTORY ${CMAKE_BINARY_DIR}/caffe/lib/ DESTINATION lib) +endif (BUILD_CAFFE) + +# Compute installation prefix relative to this file +configure_file( + ${CMAKE_SOURCE_DIR}/cmake/OpenPoseConfig.cmake.in + ${CMAKE_BINARY_DIR}/cmake/OpenPoseConfig.cmake @ONLY) + +install(FILES ${CMAKE_BINARY_DIR}/cmake/OpenPoseConfig.cmake + DESTINATION lib/OpenPose) + +# Uninstall target +configure_file( + "${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + +add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) diff --git a/cmake/Modules/FindCaffe.cmake b/cmake/Modules/FindCaffe.cmake index eca5ccb53fbfeeb73952825ecb6219830d5b76ec..3736270f45b61458a6b8036ac11f117b9aab0a3d 100644 --- a/cmake/Modules/FindCaffe.cmake +++ b/cmake/Modules/FindCaffe.cmake @@ -18,6 +18,6 @@ find_library(Caffe_LIBS NAMES caffe HINTS /usr/local/lib) -if(CAFFE_LIBS AND Caffe_INCLUDE_DIRS) +if (Caffe_LIBS AND Caffe_INCLUDE_DIRS) set(Caffe_FOUND 1) -endif(CAFFE_LIBS AND Caffe_INCLUDE_DIRS) +endif (Caffe_LIBS AND Caffe_INCLUDE_DIRS) diff --git a/cmake/OpenPoseConfig.cmake.in b/cmake/OpenPoseConfig.cmake.in new file mode 100644 index 0000000000000000000000000000000000000000..13f249afe7bf317419068a9191306b83ba01a7b8 --- /dev/null +++ b/cmake/OpenPoseConfig.cmake.in @@ -0,0 +1,16 @@ +# Compute and install package configuration and version files +get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_prefix "${_dir}/../.." ABSOLUTE) + +# Import the targets +include("${_prefix}/lib/OpenPose/OpenPose.cmake") +if (@BUILD_CAFFE@) + set(Caffe_INCLUDE_DIRS "${_prefix}/include/caffe") + # set(Caffe_LIBS "${_prefix}/lib/libcaffe.so") +endif (@BUILD_CAFFE@) + +# Report other information +set(OpenPose_INCLUDE_DIRS "${_prefix}/include/openpose") +set(OpenPose_LIBS "openpose_core;openpose_filestream;openpose_gui;openpose_pose;" + "openpose_utilities;openpose_producer;openpose_thread;openpose_face;openpose_hand;" + "openpose_wrapper") diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in new file mode 100644 index 0000000000000000000000000000000000000000..d3c8ef8d70f1f49a25895970824091c2048dc2e6 --- /dev/null +++ b/cmake/cmake_uninstall.cmake.in @@ -0,0 +1,23 @@ +# Reference -- https://cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F +if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif(NOT "${rm_retval}" STREQUAL 0) + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") +endforeach(file) + diff --git a/doc/installation_cmake.md b/doc/installation_cmake.md index 4455d4d60a7942102bb1028062dcadfe3f5927de..4ccd2727c705e82826dd020e45fe6ab7a2825966 100644 --- a/doc/installation_cmake.md +++ b/doc/installation_cmake.md @@ -7,11 +7,13 @@ OpenPose - Installation using CMake 3. [Clone and Update the Repository](#clone-and-update-the-repository) 4. [Installation](#installation) 1. [Caffe Prerequisites (Ubuntu Only)](#caffe-prerequisites-ubuntu-only) - 2. [OpenPose Configuration](#openpose-configuration) - 3. [OpenPose Building](#openpose-building) - 4. [Run OpenPose](#run-openpose) + 2. [Configuration](#openpose-configuration) + 3. [Building](#openpose-building) + 4. [OpenPose from other Projects](#openpose-from-other-projects) + 5. [Run OpenPose](#run-openpose) 5. [Reinstallation](#reinstallation) -6. [Optional Settings](#optional-settings) +6. [Uninstallation](#uninstallation) +7. [Optional Settings](#optional-settings) 1. [Doxygen Documentation Autogeneration](#doxygen-documentation-autogeneration) 2. [Custom Caffe](#custom-caffe) 3. [Custom OpenCV](#custom-opencv) @@ -53,7 +55,7 @@ bash ./ubuntu/install_cmake.sh ### OpenPose Configuration -Note: If you prefer to use CMake though the command line, see [Cmake Command Line Build](#cmake-command-line-build). +Note: If you prefer to use CMake through the command line, see [Cmake Command Line Build](#cmake-command-line-build). 1. Install CMake GUI. 1. Ubuntu: run `sudo apt-get install cmake-qt-gui`. @@ -90,11 +92,42 @@ Note: If you prefer to use your own custom Caffe or OpenCV versions, see [Custom Finally, build the project by running the following commands. ``` cd build/ -no_cores=`cat /proc/cpuinfo | grep processor | wc -l` -make -j${no_cores} +make -j`nproc` ``` +### OpenPose from other Projects +If you only intend to use the OpenPose demo, you might skip this step. This step is only recommended if you plan to use the OpenPose API from other projects. +To install the OpenPose headers and libraries into the system environment path (e.g. `/usr/local/` or `/usr/`), run the following command. +``` +cd build/ +sudo make install +``` + +Once the installation is completed, you can use OpenPose in your other project using the `find_package` cmake command. Below, is a small example `CMakeLists.txt`. +``` +cmake_minimum_required(VERSION 2.8.7) + +add_definitions(-std=c++11) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") + +find_package(GFlags) +find_package(Glog) +find_package(OpenCV) +find_package(OpenPose REQUIRED) + +include_directories(${OpenPose_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIR} ${GLOG_INCLUDE_DIR} ${OpenCV_INCLUDE_DIRS}) + +add_executable(example.bin example.cpp) + +target_link_libraries(example.bin ${OpenPose_LIBS} ${GFLAGS_LIBRARY} ${GLOG_LIBRARY} ${OpenCV_LIBS}) +``` + +If Caffe was built with OpenPose, it will automatically find it. Otherwise, you will need to link Caffe again as shown below (otherwise, you might get an error like `/usr/bin/ld: cannot find -lcaffe`). +``` +link_directories(/caffe/build/install/lib) +``` ### Run OpenPose Check OpenPose was properly installed by running it on the default images, video or webcam: [doc/quick_start.md#quick-start](./quick_start.md#quick-start). @@ -103,9 +136,20 @@ Check OpenPose was properly installed by running it on the default images, video ## Reinstallation In order to re-install OpenPose: -1. Delete the `build/` folder. -2. In CMake GUI, click on `File` --> `Delete Cache`. -3. Follow the [Installation](#installation) steps again. +1. If you ran `sudo make install`, then run `sudo make uninstall` in `build/`. +2. Delete the `build/` folder. +3. In CMake GUI, click on `File` --> `Delete Cache`. +4. Follow the [Installation](#installation) steps again. + + + +## Uninstallation +If you used `sudo make install`, simply use the command below in the `build` directory and later remove the OpenPose folder. +``` +cd build/ +sudo make uninstall +``` +If you did not use `sudo make install`, simply remove the OpenPose folder. diff --git a/examples/openpose/CMakeLists.txt b/examples/openpose/CMakeLists.txt index 2036fe1c53ad51bee2383d11f4a5302d7ed578b1..a65cde242f46f3ea67f2c569450d4494da742f19 100644 --- a/examples/openpose/CMakeLists.txt +++ b/examples/openpose/CMakeLists.txt @@ -7,7 +7,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${SOURCE_NAME}") add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE}) target_link_libraries( ${SOURCE_NAME}.bin - wrapper utilities ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS} + openpose_wrapper ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS} ) -endforeach() \ No newline at end of file +endforeach() diff --git a/examples/tests/CMakeLists.txt b/examples/tests/CMakeLists.txt index 79aa266f45709599c7068bd2412741b7b294cfa5..326ffca7f2556a41d67cda25aa9f9c44919382ca 100644 --- a/examples/tests/CMakeLists.txt +++ b/examples/tests/CMakeLists.txt @@ -7,7 +7,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${SOURCE_NAME}") add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE}) target_link_libraries( ${SOURCE_NAME}.bin - wrapper utilities ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS} + openpose_wrapper ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS} ) endforeach() diff --git a/examples/tutorial_pose/CMakeLists.txt b/examples/tutorial_pose/CMakeLists.txt index defb47b292b9595521534ecc013f8f897b10a53e..c49fa6fa8b7d9b838f6f8a2894f55ef849448520 100644 --- a/examples/tutorial_pose/CMakeLists.txt +++ b/examples/tutorial_pose/CMakeLists.txt @@ -8,7 +8,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${SOURCE_NAME}") add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE}) target_link_libraries( ${SOURCE_NAME}.bin - wrapper utilities ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS} + openpose_wrapper ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS} ) endforeach() diff --git a/examples/tutorial_thread/CMakeLists.txt b/examples/tutorial_thread/CMakeLists.txt index 25e537145dcf031895e40357395b8834bb5ddb6e..3daf9fbb79cb8ec35d87cc48f8aeaee797c015b0 100644 --- a/examples/tutorial_thread/CMakeLists.txt +++ b/examples/tutorial_thread/CMakeLists.txt @@ -10,7 +10,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${SOURCE_NAME}") add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE}) target_link_libraries( ${SOURCE_NAME}.bin - wrapper utilities ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS} + openpose_wrapper ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS} ) endforeach() diff --git a/examples/tutorial_wrapper/CMakeLists.txt b/examples/tutorial_wrapper/CMakeLists.txt index 3b30964633104b8c45dee639a3f76e7a512d3af9..98d6f39d3a306f3ec25cc6b6340293ba3919d12d 100644 --- a/examples/tutorial_wrapper/CMakeLists.txt +++ b/examples/tutorial_wrapper/CMakeLists.txt @@ -9,7 +9,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${SOURCE_NAME}") add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE}) target_link_libraries( ${SOURCE_NAME}.bin - wrapper utilities ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS} + openpose_wrapper ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS} ) endforeach() diff --git a/src/openpose/CMakeLists.txt b/src/openpose/CMakeLists.txt index 2a4babbe13724e2f635655e62c80226ed7be5dce..f791bc7371c8e7584ae734006bb7cc4fc3f37689 100644 --- a/src/openpose/CMakeLists.txt +++ b/src/openpose/CMakeLists.txt @@ -8,6 +8,7 @@ add_subdirectory(thread) add_subdirectory(face) add_subdirectory(hand) add_subdirectory(wrapper) -set_target_properties(core filestream gui pose utilities producer thread face hand wrapper +set_target_properties(openpose_core openpose_filestream openpose_gui openpose_pose + openpose_utilities openpose_producer openpose_thread openpose_face openpose_hand + openpose_wrapper PROPERTIES COMPILE_FLAGS ${OP_CXX_FLAGS}) - diff --git a/src/openpose/core/CMakeLists.txt b/src/openpose/core/CMakeLists.txt index d1c810fa2ee1b1b55043a4f013ecf4148b9cd4eb..8c84a0c55a841a6507db3baf42cf1767b894ec88 100644 --- a/src/openpose/core/CMakeLists.txt +++ b/src/openpose/core/CMakeLists.txt @@ -1,4 +1,4 @@ -cuda_add_library(core +cuda_add_library(openpose_core array.cpp cvMatToOpInput.cpp cvMatToOpOutput.cpp @@ -22,7 +22,17 @@ cuda_add_library(core resizeAndMergeCaffe.cpp scaleAndSizeExtractor) -target_link_libraries(core ${Caffe_LIBS}) +add_library(caffe SHARED IMPORTED) +set_property(TARGET caffe PROPERTY IMPORTED_LOCATION ${Caffe_LIBS}) + +target_link_libraries(openpose_core caffe) + if (BUILD_CAFFE) - add_dependencies(core caffe) + add_dependencies(openpose_core openpose_caffe) endif (BUILD_CAFFE) + +install(TARGETS openpose_core + EXPORT OpenPose + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/openpose) diff --git a/src/openpose/face/CMakeLists.txt b/src/openpose/face/CMakeLists.txt index 44115449c0e639d1dada279dea102cac28d36b59..db7be0058636641881a488c39c48cf56929129c9 100644 --- a/src/openpose/face/CMakeLists.txt +++ b/src/openpose/face/CMakeLists.txt @@ -10,7 +10,13 @@ set(SOURCES renderFace.cu ) -cuda_add_library(face ${SOURCES}) +cuda_add_library(openpose_face ${SOURCES}) if (BUILD_CAFFE) - add_dependencies(face caffe) + add_dependencies(openpose_face openpose_caffe) endif (BUILD_CAFFE) + +install(TARGETS openpose_face + EXPORT OpenPose + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/openpose) diff --git a/src/openpose/filestream/CMakeLists.txt b/src/openpose/filestream/CMakeLists.txt index 80ebfe5ad8ebb19bed75d2310f4c41c3598c42dd..6bc5ae4e8e68c3736e9533fdc5667d6b183497af 100644 --- a/src/openpose/filestream/CMakeLists.txt +++ b/src/openpose/filestream/CMakeLists.txt @@ -9,4 +9,10 @@ set(SOURCES cocoJsonSaver.cpp keypointSaver.cpp videoSaver.cpp) -add_library(filestream ${SOURCES}) +add_library(openpose_filestream ${SOURCES}) + +install(TARGETS openpose_filestream + EXPORT OpenPose + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/openpose) \ No newline at end of file diff --git a/src/openpose/gui/CMakeLists.txt b/src/openpose/gui/CMakeLists.txt index e1446e0fccc5c08aebca9591b6e7cd7c0d8707a4..8c460b72f576bb604a0993eb8d3a40897909a6e1 100644 --- a/src/openpose/gui/CMakeLists.txt +++ b/src/openpose/gui/CMakeLists.txt @@ -6,5 +6,12 @@ set(SOURCES guiInfoAdder.cpp ) -add_library(gui ${SOURCES}) -target_link_libraries(gui pose ${OpenCV_LIBS}) +add_library(openpose_gui ${SOURCES}) +target_link_libraries(openpose_gui openpose_pose ${OpenCV_LIBS}) + +install(TARGETS openpose_gui + EXPORT OpenPose + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/openpose) + diff --git a/src/openpose/hand/CMakeLists.txt b/src/openpose/hand/CMakeLists.txt index bea5e31a0fd3254acecbd65844041a621e0b9449..1d6cd5e7d50504c9e36723077a8341d37133c510 100644 --- a/src/openpose/hand/CMakeLists.txt +++ b/src/openpose/hand/CMakeLists.txt @@ -9,7 +9,13 @@ set(SOURCES renderHand.cpp renderHand.cu) -cuda_add_library(hand ${SOURCES}) +cuda_add_library(openpose_hand ${SOURCES}) if (BUILD_CAFFE) - add_dependencies(hand caffe) + add_dependencies(openpose_hand openpose_caffe) endif (BUILD_CAFFE) + +install(TARGETS openpose_hand + EXPORT OpenPose + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/openpose) diff --git a/src/openpose/pose/CMakeLists.txt b/src/openpose/pose/CMakeLists.txt index 62fd96ec4741242f62e1f205514b07e7d1eb6d71..108ba02b6116bc34475cd8d780421139cfd0e251 100644 --- a/src/openpose/pose/CMakeLists.txt +++ b/src/openpose/pose/CMakeLists.txt @@ -12,7 +12,14 @@ set(SOURCES renderPose.cpp renderPose.cu) -cuda_add_library(pose ${SOURCES}) +cuda_add_library(openpose_pose ${SOURCES}) if (BUILD_CAFFE) - add_dependencies(pose caffe) + add_dependencies(openpose_pose openpose_caffe) endif (BUILD_CAFFE) + +install(TARGETS openpose_pose + EXPORT OpenPose + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/openpose) + diff --git a/src/openpose/producer/CMakeLists.txt b/src/openpose/producer/CMakeLists.txt index 13ab212462d27be1453a314b0b5d21530e50c38d..d489aecb04d6f29352ef18153581a10d56485e91 100644 --- a/src/openpose/producer/CMakeLists.txt +++ b/src/openpose/producer/CMakeLists.txt @@ -7,5 +7,12 @@ set(SOURCES videoReader.cpp webcamReader.cpp) -add_library(producer ${SOURCES}) -target_link_libraries(producer ${OpenCV_LIBS} core thread filestream) +add_library(openpose_producer ${SOURCES}) +target_link_libraries(openpose_producer ${OpenCV_LIBS} openpose_core + openpose_thread openpose_filestream) + +install(TARGETS openpose_producer + EXPORT OpenPose + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/openpose) diff --git a/src/openpose/thread/CMakeLists.txt b/src/openpose/thread/CMakeLists.txt index 5061dda51da89e4b8ca65940abf8411ca138433e..cfb6775d2aecb56bbb6175ccfd6e5d634eff8a95 100644 --- a/src/openpose/thread/CMakeLists.txt +++ b/src/openpose/thread/CMakeLists.txt @@ -1,4 +1,10 @@ set(SOURCES defineTemplates.cpp) -add_library(thread ${SOURCES}) +add_library(openpose_thread ${SOURCES}) + +install(TARGETS openpose_thread + EXPORT OpenPose + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/openpose) diff --git a/src/openpose/utilities/CMakeLists.txt b/src/openpose/utilities/CMakeLists.txt index 87dcfad899f09d2072ccbb9dafd071cf1342ba36..25af711468cfb5b04d08ff25d7f18885cdf29412 100644 --- a/src/openpose/utilities/CMakeLists.txt +++ b/src/openpose/utilities/CMakeLists.txt @@ -10,6 +10,12 @@ set(SOURCES find_package(Boost COMPONENTS system filesystem REQUIRED) -cuda_add_library(utilities ${SOURCES}) -target_link_libraries(utilities producer filestream +cuda_add_library(openpose_utilities ${SOURCES}) +target_link_libraries(openpose_utilities openpose_producer openpose_filestream ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) + +install(TARGETS openpose_utilities + EXPORT OpenPose + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/openpose) diff --git a/src/openpose/wrapper/CMakeLists.txt b/src/openpose/wrapper/CMakeLists.txt index c4dce701002fa741c94521c1a623af496d1e9472..6fb8a96ec4017bc341f81285447e6694ea9cbfa7 100644 --- a/src/openpose/wrapper/CMakeLists.txt +++ b/src/openpose/wrapper/CMakeLists.txt @@ -6,5 +6,13 @@ set(SOURCES wrapperStructOutput.cpp wrapperStructPose.cpp) -add_library(wrapper ${SOURCES}) -target_link_libraries(wrapper thread pose hand core face filestream gui producer utilities) +add_library(openpose_wrapper ${SOURCES}) +target_link_libraries(openpose_wrapper openpose_thread openpose_pose openpose_hand + openpose_core openpose_face openpose_filestream openpose_gui openpose_producer + openpose_utilities) + +install(TARGETS openpose_wrapper + EXPORT OpenPose + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/openpose)