CMakeLists.txt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. # set(CMAKE_C_COMPILER /usr/bin/gcc)
  6. # set(CMAKE_CXX_COMPILER /usr/bin/g++)
  7. # set(CUDA_INSTALL_TARGET_DIR targets/aarch64-linux)
  8. # set(CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda)
  9. # set(CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_ROOT_DIR}/${CUDA_INSTALL_TARGET_DIR}/include)
  10. # set(CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda-11.4)
  11. # set(CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_ROOT_DIR}/include)
  12. # set(CUDA_LIBRARIES ${CUDA_TOOLKIT_ROOT_DIR}/lib64)
  13. # enable_language(CUDA)
  14. if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
  15. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g2 -ggdb -Wall -Wno-unused-variable -pthread")
  16. endif()
  17. set(CUDA_LIB_DIRS ${CUDA_TOOLKIT_ROOT_DIR}/${CUDA_INSTALL_TARGET_DIR}/lib)
  18. # add_library(cuda_kernels STATIC yuyvtoi420.cu)
  19. # cuda_add_library(cuda_kernels yuyvtoi420.cu)
  20. add_definitions(-DWEBRTC_POSIX)
  21. add_definitions(-DWEBRTC_LINUX)
  22. add_definitions(-DJSONCPP_USING_SECURE_MEMORY=0)
  23. set(API_DIR ./include)
  24. set(WEBRTC_DIR ../thirdparty/webrtc)
  25. include_directories(${API_DIR})
  26. include_directories(${WEBRTC_DIR}/include)
  27. include_directories(${WEBRTC_DIR}/include/third_party/abseil-cpp)
  28. include_directories(${WEBRTC_DIR}/include/third_party/libyuv/include)
  29. include_directories(${WEBRTC_DIR}/include/third_party/jsoncpp/source/include)
  30. include_directories(${WEBRTC_DIR}/include/third_party/jsoncpp/generated)
  31. include_directories(${CUDA_INCLUDE_DIRS} )
  32. FILE(GLOB LIVEHELPERSOURCE src/*.cpp *.cpp )
  33. # FILE(GLOB CUDA_SOURCE *.cu)
  34. # message(STATUS "CUDA source files:")
  35. # foreach(file ${CUDA_SOURCE})
  36. # message(STATUS " ${file}")
  37. # endforeach()
  38. # FILE(GLOB LIVEHELPERSOURCE src/*.cpp *.cpp )
  39. # add_library(webrtcinterop ${LIVEHELPERSOURCE} /home/nvidia/Desktop/env_enc/jetson_multimedia_api/samples/common/classes/NvBufSurface.cpp)
  40. add_library(webrtcinterop ${LIVEHELPERSOURCE} )
  41. target_compile_definitions(webrtcinterop PUBLIC NO_OPENSSL=1 BSD=1 SOCKLEN_T=socklen_t _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE=1)
  42. # target_link_libraries(webrtcinterop ${OpenCV_LIBS})
  43. # target_link_libraries(webrtcinterop libmvgmslcamera.so)
  44. # target_link_libraries(webrtcinterop cuda_kernels ${CUDA_LIBRARIES})
  45. # target_link_libraries(webrtcinterop libcuda_kernels.a ${CUDA_LIBRARIES})
  46. set(CPACK_PROJECT_NAME ${PROJECT_NAME})
  47. set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
  48. include(CPack)