CMakeLists.txt 849 B

12345678910111213141516171819202122232425
  1. set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
  2. cmake_minimum_required(VERSION 3.16)
  3. set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
  4. set(CMAKE_CXX_STANDARD 14)
  5. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
  6. set(DS_ROOT_DIR /opt/nvidia/deepstream/deepstream)
  7. set(DS_LIBS_DIR ${DS_ROOT_DIR}/lib)
  8. set(DS_INCLUDES_DIR ${DS_ROOT_DIR}/sources/includes)
  9. find_package(GLib)
  10. find_package(OpenCV)
  11. include_directories(${GLIB2_INCLUDE_DIR})
  12. include_directories(${OpenCV_INCLUDE_DIRS})
  13. include_directories(${DS_INCLUDES_DIR})
  14. include_directories(${CMAKE_SOURCE_DIR}/includes)
  15. file(GLOB TRACK ${CMAKE_SOURCE_DIR}/src/*.cpp)
  16. set(CMAKE_CXX_FLAGS "-Wall -Wextra -fPIC")
  17. set(CMAKE_CUDA_FLAGS "--compiler-options -fPIC")
  18. link_directories(${DS_LIBS_DIR})
  19. add_library(ByteTracker SHARED ${TRACK})
  20. target_link_libraries(ByteTracker nvds_meta)