cmake_minimum_required(VERSION 3.15)
project(can_test)

set(CMAKE_CXX_STANDARD 11)

FIND_PACKAGE(Protobuf REQUIRED)


aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/can CAN_SRC )
aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/can_SDK CAN_SDK )
aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/error_code ERROR_SRC )
aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/tool TOOL_SRC )
aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/communication_can COMMUNICATION_CAN_SRC )
aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/motor MOTOR_SRC )




include_directories(
        /usr/local/include
        ${PCL_INCLUDE_DIRS}
        ${OpenCV_INCLUDE_DIRS}
        ${PROTOBUF_INCLUDE_DIRS}

        error_code
        tool
        communication_can
        motor
)
link_directories("/usr/local/lib")
message(STATUS ${EXECUTABLE_OUTPUT_PATH})

add_executable(can_test main.cpp
        ${CAN_SRC}
        ${CAN_SDK}
        ${ERROR_SRC}
        ${TOOL_SRC}
        ${COMMUNICATION_CAN_SRC}
        ${MOTOR_SRC}


        )




target_link_libraries(can_test
        /home/huli/huli/usb_can_test/can_test/can_SDK/libcontrolcan.so

        /usr/local/lib/libglog.a
        /usr/local/lib/libgflags.a
        ${PROTOBUF_LIBRARIES}

        -lpthread
        )
