diff --git a/cmake/rviz-extras.cmake.in b/cmake/rviz-extras.cmake.in index 790843ed81..48ea84dcb8 100644 --- a/cmake/rviz-extras.cmake.in +++ b/cmake/rviz-extras.cmake.in @@ -1,4 +1,7 @@ -# 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}") +# Allow this to be conditionally included because it is not available during CMake configure. +if(EXISTS "${rviz_DIR}/default_plugin_location.cmake") + # 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}") +endif()