CMakeLists.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. cmake_minimum_required(VERSION 3.0.0)
  2. project(webrtcinterop VERSION 0.1.0)
  3. MESSAGE(STATUS "operation system is ${CMAKE_HOST_SYSTEM_PROCESSOR}")
  4. SET (CMAKE_CXX_COMPILER "/usr/bin/clang++-12")
  5. find_package(CUDA REQUIRED)
  6. enable_language(CUDA)
  7. if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
  8. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g2 -ggdb -Wall -Wno-unused-variable -pthread")
  9. endif()
  10. add_definitions(-DWEBRTC_POSIX)
  11. add_definitions(-DWEBRTC_LINUX)
  12. add_definitions(-DJSONCPP_USING_SECURE_MEMORY=0)
  13. set(API_DIR ./include)
  14. set(WEBRTC_DIR ../thirdparty/webrtc)
  15. include_directories(${CUDA_INCLUDES} ./ ./include ./include/libjpeg-8b /usr/include/libdrm)
  16. include_directories(${API_DIR})
  17. include_directories(${WEBRTC_DIR}/include)
  18. include_directories(${WEBRTC_DIR}/include/third_party/abseil-cpp)
  19. include_directories(${WEBRTC_DIR}/include/third_party/libyuv/include)
  20. include_directories(${WEBRTC_DIR}/include/third_party/jsoncpp/source/include)
  21. include_directories(${WEBRTC_DIR}/include/third_party/jsoncpp/generated)
  22. include_directories(${CUDA_INCLUDE_DIRS} )
  23. FILE(GLOB LIVEHELPERSOURCE src/*.cpp *.cpp )
  24. aux_source_directory(/usr/src/jetson_multimedia_api/samples/common/classes COMMON)
  25. add_library(webrtcinterop ${LIVEHELPERSOURCE} ${COMMON})
  26. target_compile_definitions(webrtcinterop PUBLIC NO_OPENSSL=1 BSD=1 SOCKLEN_T=socklen_t _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE=1)
  27. link_directories(/usr/lib/aarch64-linux-gnu/tegra /lib/aarch64-linux-gnu /usr/local/lib /usr/lib)
  28. target_link_libraries(webrtcinterop ${CUDA_LIBRARIES} pthread v4l2 EGL GLESv2 X11 nvbufsurface nvbufsurftransform nvjpeg nvosd drm cuda)
  29. set(CPACK_PROJECT_NAME ${PROJECT_NAME})
  30. set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
  31. include(CPack)