From 481c288481a7b49b1ed6a0551ffdd0db05a55ff9 Mon Sep 17 00:00:00 2001 From: Rafael Papallas Date: Wed, 21 Feb 2018 10:37:46 +0000 Subject: [PATCH 1/2] Changed installation destination Changed from lib/openrave-0.9 to share/openrave-0.9/plugins to be consistent with all openrave catkin plugins --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d78698c..3294b83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ set_target_properties(${PROJECT_NAME}_plugin PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}" LINK_FLAGS "${OpenRAVE_LINK_FLAGS}" LIBRARY_OUTPUT_DIRECTORY - "${CATKIN_DEVEL_PREFIX}/lib/openrave-${OpenRAVE_LIBRARY_SUFFIX}") + "${CATKIN_DEVEL_PREFIX}/share/openrave-${OpenRAVE_LIBRARY_SUFFIX}/plugins") target_link_libraries("${PROJECT_NAME}_plugin" ${catkin_LIBRARIES} ${TinyXML2_LIBRARIES} @@ -57,6 +57,6 @@ if(CATKIN_ENABLE_TESTING) endif(CATKIN_ENABLE_TESTING) install(TARGETS "${PROJECT_NAME}_plugin" - LIBRARY DESTINATION "lib/openrave-${OpenRAVE_LIBRARY_SUFFIX}" + LIBRARY DESTINATION "share/openrave-${OpenRAVE_LIBRARY_SUFFIX}/plugins" ) From 31b3b2f1efd4a504c16df83910105643c2af031a Mon Sep 17 00:00:00 2001 From: Rafael Papallas Date: Wed, 25 Jul 2018 11:09:57 +0100 Subject: [PATCH 2/2] Added support for Boost 1.60+ --- src/boostfs_helpers.h | 65 ++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/src/boostfs_helpers.h b/src/boostfs_helpers.h index 0ed03ae..02334f4 100644 --- a/src/boostfs_helpers.h +++ b/src/boostfs_helpers.h @@ -17,36 +17,43 @@ namespace boost namespace filesystem3 #endif { - template < > - path& path::append< typename path::iterator >( typename path::iterator begin, typename path::iterator end, const codecvt_type& cvt) - { - for( ; begin != end ; ++begin ) - *this /= *begin; - return *this; - } + #if BOOST_VERSION > 106000 + // From Boost 1.60+ there is a built-in function for this (boost::filesystem::relative). + boost::filesystem::path make_relative(boost::filesystem::path a_From, boost::filesystem::path a_To) + { + return boost::filesystem::relative(a_From, a_To); + } + #else + template < > + path& path::append< typename path::iterator >( typename path::iterator begin, typename path::iterator end, const codecvt_type& cvt) + { + for( ; begin != end ; ++begin ) + *this /= *begin; + return *this; + } - // Return path when appended to a_From will resolve to same as a_To - boost::filesystem::path make_relative( boost::filesystem::path a_From, boost::filesystem::path a_To ) - { - a_From = boost::filesystem::absolute( a_From ); a_To = boost::filesystem::absolute( a_To ); - boost::filesystem::path ret; - boost::filesystem::path::const_iterator itrFrom( a_From.begin() ), itrTo( a_To.begin() ); - - // Find common base - for( boost::filesystem::path::const_iterator toEnd( a_To.end() ), fromEnd( a_From.end() ) ; - itrFrom != fromEnd && itrTo != toEnd && *itrFrom == *itrTo; ++itrFrom, ++itrTo ); - - // Navigate backwards in directory to reach previously found base - for( boost::filesystem::path::const_iterator fromEnd( a_From.end() ); itrFrom != fromEnd; ++itrFrom ) { - if( (*itrFrom) != "." ) - ret /= ".."; - } - - // Now navigate down the directory branch - ret.append( itrTo, a_To.end() ); - return ret; - } + // Return path when appended to a_From will resolve to same as a_To + boost::filesystem::path make_relative( boost::filesystem::path a_From, boost::filesystem::path a_To ) + { + a_From = boost::filesystem::absolute( a_From ); a_To = boost::filesystem::absolute( a_To ); + boost::filesystem::path ret; + boost::filesystem::path::const_iterator itrFrom( a_From.begin() ), itrTo( a_To.begin() ); + + // Find common base + for( boost::filesystem::path::const_iterator toEnd( a_To.end() ), fromEnd( a_From.end() ) ; + itrFrom != fromEnd && itrTo != toEnd && *itrFrom == *itrTo; ++itrFrom, ++itrTo ); + + // Navigate backwards in directory to reach previously found base + for( boost::filesystem::path::const_iterator fromEnd( a_From.end() ); itrFrom != fromEnd; ++itrFrom ) { + if( (*itrFrom) != "." ) + ret /= ".."; + } + + // Now navigate down the directory branch + ret.append( itrTo, a_To.end() ); + return ret; + } + #endif } } -