Skip to content

Commit

Permalink
Merge pull request #979 from ros-visualization/provide_default_librar…
Browse files Browse the repository at this point in the history
…y_cmake

Provide a cmake variable for linking to the default plugin
  • Loading branch information
wjwwood committed Mar 22, 2016
2 parents 96960c7 + 6d476fb commit f282d2e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ if(NOT OGRE_OV_LIBRARIES_ABS)
endif()

catkin_package(
CFG_EXTRAS
rviz-extras.cmake
INCLUDE_DIRS
src
${EIGEN3_INCLUDE_DIRS}
Expand Down
4 changes: 4 additions & 0 deletions cmake/rviz-extras.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# The file being included is generated by src/rviz/default_plugin/CMakeLists.txt
include("${rviz_DIR}/default_plugin_location.cmake")
set(rviz_DEFAULT_PLUGIN_LIBRARIES
"${rviz_DIR}/../../../@CATKIN_PACKAGE_LIB_DESTINATION@/${rviz_DEFAULT_PLUGIN_FILE_NAME}")
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from catkin_pkg.python_setup import generate_distutils_setup

d = generate_distutils_setup(
packages = ['rviz'],
package_dir = {'': 'src/python_bindings'},
requires = ['roslib', 'rospkg', 'python_qt_bindings']
packages=['rviz'],
package_dir={'': 'src/python_bindings'},
requires=['roslib', 'rospkg', 'python_qt_bindings']
)

setup(**d)
13 changes: 9 additions & 4 deletions src/rviz/default_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ install(TARGETS default_plugin
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

#message("TODO: stop installing libdefault_plugin.so into share/rviz after pluginlib starts looking for it in lib.")
#install(TARGETS default_plugin
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
# Generate to the devel space so the extras file can include it from the devel space.
file(GENERATE
OUTPUT "${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/default_plugin_location.cmake"
CONTENT "set(rviz_DEFAULT_PLUGIN_FILE_NAME $<TARGET_FILE_NAME:default_plugin>)"
)
# Install from the devel space to the install space.
install(FILES "${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/default_plugin_location.cmake"
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake
)

0 comments on commit f282d2e

Please sign in to comment.