Skip to content

Commit

Permalink
Fix ikfast cmake
Browse files Browse the repository at this point in the history
* do not write plugins.xml in source space
* added install tags
  • Loading branch information
mathias-luedtke authored Feb 15, 2017
1 parent eb0b2f8 commit f16b9d3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cob_kinematics/ikfast/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ exec_program("rosversion -d; echo" OUTPUT_VARIABLE ROS_VERSION)
add_custom_target(ikfast_libs DEPENDS urdf_openrave)
include_directories(include)

set(plugins_xml ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/plugins.xml)
file(GLOB yamls "config/*.yaml")
file(WRITE plugins.xml "<class_libraries>\n")
file(WRITE ${plugins_xml} "<class_libraries>\n")

set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true)
foreach(fname ${yamls})
Expand All @@ -22,8 +23,12 @@ foreach(fname ${yamls})
set_target_properties(${tname} PROPERTIES COMPILE_DEFINITIONS IKFAST_NAMESPACE=${bname} )
target_link_libraries(${tname} lapack)

file(APPEND plugins.xml "<library path=\"ros/lib/lib${tname}\">\n")
file(APPEND plugins.xml "<class name=\"cob_kinematics/IKFast_${bname}\" type=\"${bname}::IKFastPlugin\" base_class_type=\"kinematics::KinematicsBase\"/>\n")
file(APPEND plugins.xml "</library>\n")
install(TARGETS ${tname} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

file(APPEND ${plugins_xml} "<library path=\"ros/lib/lib${tname}\">\n")
file(APPEND ${plugins_xml} "<class name=\"cob_kinematics/IKFast_${bname}\" type=\"${bname}::IKFastPlugin\" base_class_type=\"kinematics::KinematicsBase\"/>\n")
file(APPEND ${plugins_xml} "</library>\n")
endforeach()
file(APPEND plugins.xml "</class_libraries>\n")
file(APPEND ${plugins_xml} "</class_libraries>\n")

install(FILES ${plugins_xml} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

0 comments on commit f16b9d3

Please sign in to comment.