CMakeLists.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/)
  2. include_directories(${3RDPARTY_INCLUDE_DIRS})
  3. # 添加编译参数
  4. add_compile_options(-Wall -std=c++11 -O2 -g -DPLATFORM_TEGRA)
  5. set(module_list "")
  6. if(build_inference)
  7. list(APPEND module_list inference)
  8. install(DIRECTORY inference/include/ DESTINATION include)
  9. endif()
  10. if(build_dataType)
  11. list(APPEND module_list dataType)
  12. install(DIRECTORY dataType/include/ DESTINATION include)
  13. endif()
  14. if(build_md5)
  15. list(APPEND module_list md5)
  16. install(DIRECTORY md5/include/ DESTINATION include)
  17. endif()
  18. if(build_userApp)
  19. list(APPEND module_list userApp)
  20. install(DIRECTORY userApp/include/ DESTINATION include)
  21. endif()
  22. if(build_HttpClient)
  23. list(APPEND module_list HttpClient)
  24. install(DIRECTORY HttpClient/include/ DESTINATION include)
  25. endif()
  26. if(build_recorder)
  27. list(APPEND module_list recorder)
  28. install(DIRECTORY recorder/include/ DESTINATION include)
  29. endif()
  30. if(build_Cleaner)
  31. list(APPEND module_list Cleaner)
  32. install(DIRECTORY Cleaner/include/ DESTINATION include)
  33. endif()
  34. if(build_monitor)
  35. list(APPEND module_list monitor)
  36. install(DIRECTORY monitor/include/ DESTINATION include)
  37. endif()
  38. if(build_deviceState)
  39. list(APPEND module_list deviceState)
  40. install(DIRECTORY deviceState/include/ DESTINATION include)
  41. endif()
  42. if(build_Manager)
  43. list(APPEND module_list Manager)
  44. install(DIRECTORY Manager/include/ DESTINATION include)
  45. endif()
  46. if(build_Shell)
  47. list(APPEND module_list Shell)
  48. install(DIRECTORY Shell/include/ DESTINATION include)
  49. endif()
  50. if(build_Disposition)
  51. list(APPEND module_list Disposition)
  52. install(DIRECTORY Disposition/include/ DESTINATION include)
  53. endif()
  54. if(build_InfineFilter)
  55. list(APPEND module_list InfineFilter)
  56. install(DIRECTORY InfineFilter/include/ DESTINATION include)
  57. endif()
  58. if(HAVE_FFMPEG)
  59. include_directories(${FFMPEG_INCLUDE_DIR})
  60. endif()
  61. if(HAVE_OPENCV)
  62. include_directories(${OpenCV_INCLUDE_DIRS})
  63. endif()
  64. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
  65. include_directories(${PROJECT_SOURCE_DIR}/modules)
  66. include_directories(${ToolKit_Root})
  67. include_directories(${MediaKit_Root})
  68. include_directories(/usr/local/cuda-10.2/include/)
  69. foreach(module ${module_list})
  70. include_directories(${PROJECT_SOURCE_DIR}/modules/${module}/include/)
  71. file(GLOB_RECURSE module_src ${PROJECT_SOURCE_DIR}/modules/${module}/*.cpp)
  72. list(APPEND srcs ${module_src})
  73. endforeach()
  74. add_library(modules SHARED ${srcs})
  75. target_link_libraries(modules ${ALL_LINKER_LIBS})