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")
|
2021-08-21 03:02:15 +08:00
|
|
|
add_definitions(-D _WIN32)
|
2021-03-24 17:08:29 +08:00
|
|
|
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
2021-08-21 03:02:15 +08:00
|
|
|
add_definitions(-D __linux__)
|
2021-08-21 06:54:34 +08:00
|
|
|
set(OpenCV_DIR /opt/intel//openvino_2021.2.185/opencv/cmake)
|
2021-03-24 17:08:29 +08:00
|
|
|
set(TBB_ROOT /opt/intel/openvino_2020.2.120/deployment_tools/inference_engine/external/tbb)
|
2021-08-21 06:54:34 +08:00
|
|
|
set(realsense2_DIR /home/pulsar/workspace/packages/librealsense/lib/cmake/realsense2)
|
2021-03-24 17:08:29 +08:00
|
|
|
endif ()
|
2021-08-21 01:06:03 +08:00
|
|
|
|
2021-03-24 17:08:29 +08:00
|
|
|
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)
|
2021-08-21 06:54:34 +08:00
|
|
|
#TODO:是否编译OPENVINO
|
|
|
|
option(WITH_OPENVINO "Build With OpenVino" OFF)
|
2021-03-24 17:08:29 +08:00
|
|
|
#TODO:是否编译TBB
|
|
|
|
option(WITH_TBB "Build With TBB" OFF)
|
|
|
|
#TODO:是否编译REALSENSE
|
2021-08-21 08:39:44 +08:00
|
|
|
option(WITH_LIBREALSENCE2 "Build With Librealsence" ON)
|
|
|
|
set(WITH_LIBREALSENCE2 ON)
|
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-08-21 06:54:34 +08:00
|
|
|
#有OpenVino一定有TBB
|
|
|
|
if (${WITH_OPENVINO} STREQUAL "ON")
|
|
|
|
set(WITH_TBB ON)
|
|
|
|
endif ()
|
|
|
|
|
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)
|
2021-08-21 06:54:34 +08:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
|
|
|
set(ENV_CMAKE_FILES_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
|
|
|
set(RC_CLIENT_CMAKE_FILES_PATH ${PROJECT_SOURCE_DIR}/robot_client/cmake)
|
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)
|
2021-08-21 06:54:34 +08:00
|
|
|
set(ROBOCAR_APPLICATION_DIR ${PROJECT_SOURCE_DIR}/tools)
|
|
|
|
set(ROBOCAR_APPLICATION_NAME
|
|
|
|
cleargpio
|
|
|
|
robocar
|
|
|
|
)
|
|
|
|
|
|
|
|
set(RC_RESOURCE_DIR ${PROJECT_SOURCE_DIR}/resource)
|
|
|
|
set(RC_CLIENT_SOURCES_DIR ${PROJECT_SOURCE_DIR}/robot_client/sources)
|
|
|
|
set(RC_CLIENT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/robot_client/include)
|
2021-03-24 17:08:29 +08:00
|
|
|
|
|
|
|
set(ENV_CMAKE_FILES_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
|
|
|
set(CMAKE_FILES_PATH ${PROJECT_SOURCE_DIR}/src/cmake)
|
2021-08-21 06:54:34 +08:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/pistache/subprojects/hinnant-date/include)
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/pistache/subprojects/cpp-httplib/include)
|
2020-05-07 00:49:39 +08:00
|
|
|
|
2021-08-21 06:54:34 +08:00
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/3rdparty/pistache)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/3rdparty/libserv)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/3rdparty/websocketpp)
|
2020-05-07 00:49:39 +08:00
|
|
|
add_subdirectory(robot_client)
|
2021-08-21 06:54:34 +08:00
|
|
|
add_subdirectory(test)
|
|
|
|
add_subdirectory(tools)
|
2020-05-07 00:49:39 +08:00
|
|
|
|
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
|
|
|
|