2021-03-24 17:08:29 +08:00
|
|
|
project(RoboCar)
|
2020-05-07 00:49:39 +08:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
2021-03-24 17:08:29 +08:00
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
|
|
|
set(TORCH_ROOT "E:/packages/libtorch-win-shared-with-deps-1.7.1+cu101/libtorch/share/cmake/Torch")
|
|
|
|
set(BOOST_ROOT "F:/PCL 1.10.0/3rdParty/Boost")
|
|
|
|
set(Boost_INCLUDE_DIR "F:/PCL 1.10.0/3rdParty/Boost/include/boost-1_72")
|
|
|
|
#TODO:OpenCV的位置
|
|
|
|
set(OpenCV_DIR E:/packages/opencv-4.5.1/build)
|
|
|
|
set(PCL_DIR "F:/PCL 1.10.0/cmake")
|
|
|
|
set(PCL_ROOT "F:/PCL 1.10.0")
|
|
|
|
set(PYTHON_INCLUDE_DIR "D:/Python36/include")
|
|
|
|
set(PYTHON_LIBRARY_DIR "D:/Python36/libs")
|
|
|
|
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
set(OpenCV_DIR /opt/intel/openvino/opencv/cmake)
|
|
|
|
set(TBB_ROOT /opt/intel/openvino_2020.2.120/deployment_tools/inference_engine/external/tbb)
|
|
|
|
endif ()
|
2021-08-21 01:06:03 +08:00
|
|
|
|
|
|
|
|
|
|
|
#TODO:启用64位编译s
|
2021-03-24 17:08:29 +08:00
|
|
|
set(BUILD_USE_64BITS on)
|
|
|
|
message(STATUS "BUILD_USE_64BITS:${BUILD_USE_64BITS}")
|
|
|
|
#TODO:Boost编译组件版本
|
|
|
|
set(Boost_COMPILER vc142)
|
|
|
|
message(STATUS "Boost_COMPILER:${Boost_COMPILER}")
|
2020-05-26 22:22:35 +08:00
|
|
|
|
2020-05-07 00:49:39 +08:00
|
|
|
option(WITH_CONTROL_CENTER "Build Robot Control Center" ON)
|
2021-03-24 17:08:29 +08:00
|
|
|
set(BOOST_ROOT)
|
|
|
|
#TODO:是否编译TBB
|
|
|
|
option(WITH_TBB "Build With TBB" OFF)
|
|
|
|
#TODO:是否编译REALSENSE
|
2020-05-26 22:22:35 +08:00
|
|
|
option(WITH_LIBREALSENCE2 "Build With Librealsence" OFF)
|
2021-03-24 17:08:29 +08:00
|
|
|
#TODO:编译测试
|
2020-05-26 22:22:35 +08:00
|
|
|
option(RC_TEST "Build With test" ON)
|
|
|
|
|
2021-03-24 17:08:29 +08:00
|
|
|
#TODO:开启下位控制器模式
|
2020-05-26 22:22:35 +08:00
|
|
|
add_definitions(-D USE_DSP_DEVICE)
|
|
|
|
|
2020-05-18 13:53:58 +08:00
|
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
2021-03-24 17:08:29 +08:00
|
|
|
|
2020-05-18 13:53:58 +08:00
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
|
|
|
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
2020-05-26 22:22:35 +08:00
|
|
|
set(OpenGL_GL_PREFERENCE GLVND)
|
2021-03-24 17:08:29 +08:00
|
|
|
set(BUILD_EXAMPLES OFF)
|
|
|
|
|
|
|
|
set(ENV_CMAKE_FILES_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
|
|
|
set(CMAKE_FILES_PATH ${PROJECT_SOURCE_DIR}/src/cmake)
|
|
|
|
#include(${ENV_CMAKE_FILES_PATH}/rcMpiCmake.cmake)
|
|
|
|
#include(${ENV_CMAKE_FILES_PATH}/rcBoostCmake.cmake)
|
2020-05-07 00:49:39 +08:00
|
|
|
|
2020-05-18 13:53:58 +08:00
|
|
|
add_subdirectory(3rdparty/grpc)
|
2020-05-15 15:29:48 +08:00
|
|
|
add_subdirectory(3rdparty/gflags)
|
|
|
|
add_subdirectory(3rdparty/libserv)
|
2020-05-26 22:22:35 +08:00
|
|
|
if (${WITH_TBB} STREQUAL "OFF")
|
|
|
|
add_subdirectory(3rdparty/librealsense)
|
|
|
|
endif ()
|
2020-05-18 13:53:58 +08:00
|
|
|
add_subdirectory(3rdparty/websocketpp)
|
|
|
|
|
2021-03-24 17:08:29 +08:00
|
|
|
|
2020-05-26 22:22:35 +08:00
|
|
|
add_subdirectory(tools)
|
2020-05-07 00:49:39 +08:00
|
|
|
add_subdirectory(robot_client)
|
|
|
|
|
2021-03-24 17:08:29 +08:00
|
|
|
if (${WITH_CONTROL_CENTER} STREQUAL "OFF")
|
2020-05-26 22:22:35 +08:00
|
|
|
add_subdirectory(robot_center)
|
|
|
|
endif ()
|
2020-05-07 00:49:39 +08:00
|
|
|
|