Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

CMakeLists.txt 3.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  1. include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
  2. subdirlist(SUB_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
  3. foreach (SUB_DIR ${SUB_DIRS})
  4. add_subdirectory(${SUB_DIR})
  5. endforeach (SUB_DIR ${SUB_DIRS})
  6. # make the openpose.so/dll
  7. file(GLOB_RECURSE OP_HEADERS_UNFILTERED "${CMAKE_SOURCE_DIR}/include/openpose/*.h"
  8. "${CMAKE_SOURCE_DIR}/include/openpose/*.hpp"
  9. "${CMAKE_SOURCE_DIR}/include/openpose/*.hu")
  10. set(OP_HEADERS "")
  11. # # Add experimental sub-folders
  12. # foreach (FILE ${OP_HEADERS_UNFILTERED})
  13. # if (NOT FILE MATCHES "${CMAKE_SOURCE_DIR}/include/openpose/experimental/*")
  14. # list(APPEND OP_HEADERS ${FILE})
  15. # endif ()
  16. # endforeach(FILE ${OP_HEADERS_UNFILTERED})
  17. if (${GPU_MODE} MATCHES "CUDA")
  18. cuda_add_library(openpose ${SOURCES_OPENPOSE} ${OP_HEADERS})
  19. else ()
  20. add_library(openpose ${SOURCES_OPENPOSE} ${OP_HEADERS})
  21. endif ()
  22. # Ubuntu
  23. if (UNIX OR APPLE)
  24. target_link_libraries(openpose ${OpenPose_3rdparty_libraries})
  25. if (CMAKE_COMPILER_IS_GNUCXX)
  26. foreach (SUB_DIR ${SUB_DIRS})
  27. set_target_properties(openpose_${SUB_DIR} PROPERTIES COMPILE_FLAGS ${OP_CXX_FLAGS})
  28. endforeach (SUB_DIR ${SUB_DIRS})
  29. set_target_properties(openpose PROPERTIES COMPILE_FLAGS ${OP_CXX_FLAGS})
  30. endif (CMAKE_COMPILER_IS_GNUCXX)
  31. # Windows
  32. elseif (WIN32)
  33. set_property(TARGET openpose PROPERTY DEBUG_POSTFIX d)
  34. target_link_libraries(openpose ${OpenPose_3rdparty_libraries})
  35. if (${DL_FRAMEWORK} MATCHES "CAFFE")
  36. target_compile_definitions(openpose PRIVATE BOOST_ALL_NO_LIB)
  37. endif(${DL_FRAMEWORK} MATCHES "CAFFE")
  38. set_property(TARGET openpose PROPERTY FOLDER "OpenPose library")
  39. foreach (SUB_DIR ${SUB_DIRS})
  40. string(TOUPPER ${SUB_DIR} SUB_DIR_UPPERCASE)
  41. source_group("Source Files\\${SUB_DIR}" FILES ${SOURCES_OP_${SUB_DIR_UPPERCASE}_WITH_CP} "*")
  42. file(GLOB_RECURSE SUB_MOD_HEADERS "${CMAKE_SOURCE_DIR}/include/openpose/${SUB_DIR}/*.h"
  43. "${CMAKE_SOURCE_DIR}/include/openpose/${SUB_DIR}/*.hpp"
  44. "${CMAKE_SOURCE_DIR}/include/openpose/${SUB_DIR}/*.hu")
  45. source_group("Header Files\\${SUB_DIR}" FILES ${SUB_MOD_HEADERS})
  46. endforeach (SUB_DIR ${SUB_DIRS})
  47. set_target_properties(openpose PROPERTIES COMPILE_FLAGS -DOP_EXPORTS)
  48. # Properties->General->Output Directory
  49. set_property(TARGET openpose PROPERTY RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/$(Platform)/$(Configuration))
  50. set_property(TARGET openpose PROPERTY RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/$(Platform)/$(Configuration))
  51. endif (UNIX OR APPLE)
  52. if (UNIX OR APPLE)
  53. add_library(caffe SHARED IMPORTED)
  54. set_property(TARGET caffe PROPERTY IMPORTED_LOCATION ${Caffe_LIBS})
  55. target_link_libraries(openpose caffe ${Boost_SYSTEM_LIBRARY} ${OpenCL_LIBRARIES})
  56. if (BUILD_CAFFE)
  57. add_dependencies(openpose openpose)
  58. endif (BUILD_CAFFE)
  59. set_property(TARGET openpose PROPERTY VERSION ${OpenPose_VERSION})
  60. install(TARGETS openpose
  61. EXPORT OpenPose
  62. RUNTIME DESTINATION bin
  63. LIBRARY DESTINATION lib
  64. ARCHIVE DESTINATION lib/openpose)
  65. endif (UNIX OR APPLE)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...