uestc-careye/CMakeLists.txt
2021-08-21 08:39:44 +08:00

79 lines
2.8 KiB
CMake

project(RoboCar)
cmake_minimum_required(VERSION 3.0)
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")
add_definitions(-D _WIN32)
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_definitions(-D __linux__)
set(OpenCV_DIR /opt/intel//openvino_2021.2.185/opencv/cmake)
set(TBB_ROOT /opt/intel/openvino_2020.2.120/deployment_tools/inference_engine/external/tbb)
set(realsense2_DIR /home/pulsar/workspace/packages/librealsense/lib/cmake/realsense2)
endif ()
message(STATUS "Boost_COMPILER:${Boost_COMPILER}")
option(WITH_CONTROL_CENTER "Build Robot Control Center" ON)
set(BOOST_ROOT)
#TODO:是否编译OPENVINO
option(WITH_OPENVINO "Build With OpenVino" OFF)
#TODO:是否编译TBB
option(WITH_TBB "Build With TBB" OFF)
#TODO:是否编译REALSENSE
option(WITH_LIBREALSENCE2 "Build With Librealsence" ON)
set(WITH_LIBREALSENCE2 ON)
#TODO:编译测试
option(RC_TEST "Build With test" ON)
#有OpenVino一定有TBB
if (${WITH_OPENVINO} STREQUAL "ON")
set(WITH_TBB ON)
endif ()
#TODO:开启下位控制器模式
add_definitions(-D USE_DSP_DEVICE)
include(CheckCXXCompilerFlag)
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)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(OpenGL_GL_PREFERENCE GLVND)
set(BUILD_EXAMPLES OFF)
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)
set(ENV_CMAKE_FILES_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_FILES_PATH ${PROJECT_SOURCE_DIR}/src/cmake)
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/pistache/subprojects/hinnant-date/include)
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/pistache/subprojects/cpp-httplib/include)
add_subdirectory(${PROJECT_SOURCE_DIR}/3rdparty/pistache)
add_subdirectory(${PROJECT_SOURCE_DIR}/3rdparty/libserv)
add_subdirectory(${PROJECT_SOURCE_DIR}/3rdparty/websocketpp)
add_subdirectory(robot_client)
add_subdirectory(test)
add_subdirectory(tools)
if (${WITH_CONTROL_CENTER} STREQUAL "OFF")
add_subdirectory(robot_center)
endif ()