Skip to content

Commit

Permalink
use file generate to create pointer to default plugin lib
Browse files Browse the repository at this point in the history
  • Loading branch information
wjwwood committed Apr 11, 2016
1 parent 351f2d4 commit 1b39023
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
19 changes: 3 additions & 16 deletions src/rviz/default_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,10 @@ install(TARGETS ${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

# Generate to the devel space so the extras file can include it from the devel space.
add_custom_command(
OUTPUT ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/default_plugin_location.cmake
COMMAND
${CMAKE_COMMAND}
-DPATH_TO_FILE="${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/default_plugin_location.cmake"
-DDEFAULT_PLUGIN_FILE_NAME=$<TARGET_FILE_NAME:${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME}>
-P ${CMAKE_CURRENT_SOURCE_DIR}/file_generate_helper.cmake
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:${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME}>)"
)
add_custom_target(create_default_plugin_location_file ALL
DEPENDS ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/default_plugin_location.cmake
)
# TODO(wjwwood): remove the solution above (including the file_generate_helper.cmake file) when we can
# depend on cmake >= 2.8.12 (after dropping Saucy) and use the snippet below.
# 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:${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME}>)"
# )
# 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
Expand Down
1 change: 0 additions & 1 deletion src/rviz/default_plugin/file_generate_helper.cmake

This file was deleted.

0 comments on commit 1b39023

Please sign in to comment.