cmake_minimum_required(VERSION 3.0.0) project(Ego VERSION 1.0.0) MESSAGE(STATUS "operation system is ${CMAKE_HOST_SYSTEM_PROCESSOR}") IF(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64") SET (CMAKE_C_COMPILER "/usr/bin/clang") SET (CMAKE_CXX_COMPILER "/usr/bin/clang++") SET (CMAKE_AR "/usr/bin/llvm-ar") SET (CMAKE_LINKER "/usr/bin/llvm-link") SET (CMAKE_NM "/usr/bin/llvm-nm") SET (CMAKE_OBJDUMP "/usr/bin/llvm-objdump") ENDIF() if( CMAKE_BUILD_TYPE STREQUAL "Debug" ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g2 -ggdb -Wall -Wno-unused-variable -pthread") endif() add_definitions(-DJSONCPP_USING_SECURE_MEMORY=0) #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations -Wno-deprecated-declarations -pthread -g -Wall -Wno-unused-variable -DWEBRTC_POSIX=1 -DWEBRTC_LINUX=1") add_definitions(-DWEBRTC_POSIX=1) add_definitions(-DWEBRTC_LINUX=1) set(API_DIR ../webrtcinterop/include) include_directories(${API_DIR}) #find_package(OpenCV REQUIRED) 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) #pkg_check_modules(PC_LIBUDEV libudev) #if(PC_LIBUDEV_FOUND) # message(Found libudev) #endif(PC_LIBUDEV_FOUND) file(GLOB native_srcs "*.cpp") set(CURDIR ${CMAKE_CURRENT_LIST_DIR}) file(GLOB common_srcs ${CURDIR}/../common/*.cpp) IF(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64") include_directories("../thirdparty/protobuf/include") ELSE() find_package(Protobuf REQUIRED) include_directories(${Protobuf_INCLUDE_DIRS}) include_directories("../thirdparty/Eigen/eigen3") ENDIF() #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") message(${CURDIR}../thirdparty/protobuf/lib/x64) link_directories(${CURDIR}/../thirdparty/protobuf/lib/x64) elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64") link_directories("../thirdparty/webrtc/lib/aarch64") #link_directories("../thirdparty/protobuf/lib/aarch64") endif() #message(lidar "${lidar_srcs}") add_executable(Ego ${native_srcs} ${common_srcs} ${proto_srcs}) find_package(Boost COMPONENTS system REQUIRED) #find_library( # UDEV_LIB # udev #) #list(APPEND EXTERNAL_LIBS pcap) #list(APPEND EXTERNAL_LIBS "-lpthread") #list(APPEND EXTERNAL_LIBS "libprotobuf.a") #target_link_libraries(EgoSystem pthread) target_link_libraries(Ego libwebrtcinterop.a) target_link_libraries(Ego libwebrtc.a) target_link_libraries(Ego libsensors.a) target_link_libraries(Ego -lpthread ) IF(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64") target_link_libraries(Ego libprotobuf.a) ELSE() target_link_libraries(Ego ${Protobuf_LIBRARIES}) ENDIF() target_link_libraries(Ego libjsoncpp.so) target_link_libraries(Ego ${Boost_SYSTEM_LIBRARY}) target_link_libraries(Ego dl) target_link_libraries(Ego X11) target_link_libraries(Ego ${GLIB_LIBRARIES}) #target_link_libraries(EgoSystem ${PC_LIBUDEV_LIBRARIES}) target_link_libraries(Ego -lpcanbasic) #target_link_libraries(EgoSystem ${OpenCV_LIBRARIES})