cmake_minimum_required(VERSION 3.0.0) project(EgoSystem VERSION 1.0.0) set(USE_LIDAR OFF) MESSAGE(STATUS "operation system is ${CMAKE_HOST_SYSTEM_PROCESSOR}") SET (CMAKE_CXX_COMPILER "/usr/bin/clang++-12") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g2 -ggdb -Wall -Wno-unused-variable -pthread -Wno-attributes") add_definitions(-DJSONCPP_USING_SECURE_MEMORY=0) add_definitions(-DWEBRTC_POSIX=1) add_definitions(-DWEBRTC_LINUX=1) set(API_DIR ../webrtcinterop/include) include_directories(${API_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GLIB_PKG glib-2.0) if (GLIB_PKG_FOUND) message(Found glib-2.0) endif (GLIB_PKG_FOUND) find_path(MODBUS_INCLUDE_DIR NAMES modbus.h modbus/modbus.h REQUIRED) message(STATUS "MODBUS_INCLUDE_DIR: ${MODBUS_INCLUDE_DIR}") message("${protobuf_INCLUDE_DIRS}") file(GLOB native_srcs "*.cpp") set(CURDIR ${CMAKE_CURRENT_LIST_DIR}) file(GLOB common_srcs ${CURDIR}/../common/*.cpp) include_directories(${protobuf_INCLUDE_DIRS}) set(RS_DRIVER ${CURDIR}/../thirdparty/rs_driver) message(RS_DRIVER "${RS_DRIVER}") include_directories(${RS_DRIVER}) include_directories(${CURDIR}/../thirdparty/protobuf/include) include_directories(${CURDIR}/../Protocol/linux/) file(GLOB proto_srcs ${CURDIR}/../Protocol/linux/*.cc) file(GLOB lidar_srcs ${CURDIR}/lidar/*.cpp) link_directories("../webrtcinterop/build") IF(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64") link_directories("../thirdparty/webrtc/lib/linux") elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64") link_directories("../thirdparty/webrtc/lib/aarch64") link_directories("../thirdparty/protobuf/lib/aarch64") endif() include_directories("../thirdparty/Mqtt/inlcude/") link_directories("../thirdparty/Mqtt/lib/") include_directories(${CUDA_INCLUDES} ./ ./include ./include/libjpeg-8b /usr/include/libdrm) aux_source_directory(/usr/src/jetson_multimedia_api/samples/common/classes COMMON) add_executable(EgoSystem ${native_srcs} ${common_srcs} ${proto_srcs}) find_package(Boost COMPONENTS system REQUIRED) message(Boost "${Boost_SYSTEM_LIBRARY}") #list(APPEND EXTERNAL_LIBS pcap) list(APPEND EXTERNAL_LIBS "-lpthread") #list(APPEND EXTERNAL_LIBS pcap) list(APPEND EXTERNAL_LIBS "libprotobuf.a") target_link_libraries(EgoSystem libwebrtcinterop.a) target_link_libraries(EgoSystem libwebrtc.a) target_link_libraries(EgoSystem ${EXTERNAL_LIBS} ) target_link_libraries(EgoSystem libpcanbasic.so.8) target_link_libraries(EgoSystem libpcanbasic.so) target_link_libraries(EgoSystem libpcanbasic.so.0) target_link_libraries(EgoSystem libpaho-mqtt3a.a) target_link_libraries(EgoSystem libpaho-mqtt3c.a) target_link_libraries(EgoSystem libjsoncpp.so) target_link_libraries(EgoSystem ${Boost_SYSTEM_LIBRARY}) target_link_libraries(EgoSystem dl) target_link_libraries(EgoSystem X11) target_link_libraries(EgoSystem ${GLIB_LIBRARIES}) link_directories(/usr/lib/aarch64-linux-gnu/tegra /lib/aarch64-linux-gnu /usr/local/lib /usr/lib) # target_link_libraries(EgoSystem ${CUDA_LIBRARIES} pthread v4l2 EGL GLESv2 X11 nvbufsurface nvbufsurftransform nvjpeg nvosd drm cuda) target_link_libraries(EgoSystem ${CUDA_LIBRARIES} pthread v4l2 EGL GLESv2 X11 /usr/lib/aarch64-linux-gnu/tegra/libnvbufsurface.so /usr/lib/aarch64-linux-gnu/tegra/libnvbufsurftransform.so /usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so /usr/lib/aarch64-linux-gnu/tegra/libnvosd.so /usr/lib/aarch64-linux-gnu/libdrm.so)