z1_sdk/CMakeLists.txt

30 lines
876 B
CMake
Raw Normal View History

2022-07-20 11:20:01 +08:00
cmake_minimum_required(VERSION 3.0)
project(z1_sdk)
2023-05-25 21:04:18 +08:00
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++14 -pthread")
2022-07-20 11:20:01 +08:00
include_directories(
2023-07-06 16:09:07 +08:00
include
2022-07-20 11:20:01 +08:00
)
2022-11-11 18:17:07 +08:00
link_directories(lib)
2022-07-20 11:20:01 +08:00
2023-05-25 21:04:18 +08:00
set(EXAMPLES_FILES
examples/highcmd_basic.cpp
examples/highcmd_development.cpp
examples/lowcmd_development.cpp
examples/lowcmd_multirobots.cpp
)
foreach(EXAMPLE_FILE IN LISTS EXAMPLES_FILES)
get_filename_component(EXAMPLE_NAME ${EXAMPLE_FILE} NAME_WE)
add_executable(${EXAMPLE_NAME} ${EXAMPLE_FILE})
target_link_libraries(${EXAMPLE_NAME} Z1_SDK_${CMAKE_SYSTEM_PROCESSOR})
endforeach()
2023-01-30 20:28:13 +08:00
2023-07-06 16:09:07 +08:00
2023-07-12 20:11:26 +08:00
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
2023-07-06 16:09:07 +08:00
find_package(pybind11 QUIET)
if(${pybind11_FOUND})
pybind11_add_module(unitree_arm_interface examples_py/arm_python_interface.cpp)
target_link_libraries(unitree_arm_interface PRIVATE Z1_SDK_${CMAKE_SYSTEM_PROCESSOR})
endif()