Professional Documents
Culture Documents
CMake Lists
CMake Lists
4)
project(libfranka-examples CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT FRANKA_IS_FOUND)
find_package(Franka REQUIRED)
endif()
find_package(Eigen3 REQUIRED)
find_package(Poco REQUIRED COMPONENTS Foundation)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
add_library(examples_common STATIC
examples_common.cpp
)
set(EXAMPLES
cartesian_impedance_control
communication_test
echo_robot_state
force_control
generate_cartesian_pose_motion
generate_cartesian_velocity_motion
generate_consecutive_motions
generate_elbow_motion
generate_joint_position_motion
generate_joint_velocity_motion
grasp_object
joint_impedance_control
joint_point_to_point_motion
motion_with_control
print_joint_poses
vacuum_object
)
foreach(example ${EXAMPLES})
add_executable(${example} ${example}.cpp)
target_link_libraries(${example} Franka::Franka examples_common Eigen3::Eigen3)
endforeach()
target_link_libraries(joint_impedance_control Threads::Threads)
target_link_libraries(motion_with_control Poco::Foundation)
include(GNUInstallDirs)
install(TARGETS ${EXAMPLES}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)