Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 #15

Merged
merged 18 commits into from
Jan 24, 2022
Merged

V2 #15

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ambf_control_system)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/rbdl_model)
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/rbdl_model_tests)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/rbdl_model_tests)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/rbdl_server)
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/rbdl_model_test)
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/trajectory_generator)
Expand Down
30 changes: 0 additions & 30 deletions cmake/FindAMBFClient.cmake

This file was deleted.

30 changes: 0 additions & 30 deletions cmake/Findambf_client.cmake

This file was deleted.

253 changes: 223 additions & 30 deletions cmake/ambf_clientConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,30 +1,223 @@
SET (AMBF_CLIENT_FOUND FALSE)


UNSET( AMBF_CLIENT_INCLUDE_DIR CACHE)
UNSET( AMBF_CLIENT_LIBRARY CACHE)

FIND_PATH (AMBF_CLIENT_INCLUDE_DIR ambf_client/ambf_client.h
HINTS
/localcodebase/ambfnags92/ambf/ambf_controller/ambf_client/
/usr/local/include
/usr/include
)

FIND_LIBRARY (AMBF_CLIENT_LIBRARY ambf_client
PATHS
/localcodebase/ambfnags92/ambf/build/devel/lib
)

IF (AMBF_CLIENT_INCLUDE_DIR AND AMBF_CLIENT_LIBRARY)
SET (AMBF_CLIENT_FOUND TRUE)
ELSE(AMBF_CLIENT_INCLUDE_DIR AND AMBF_CLIENT_LIBRARY)
SET (AMBF_CLIENT_FOUND FALSE)
MESSAGE (SEND_ERROR " Could not find AMBF_CLIENT.")
ENDIF (RBDL_INCLUDE_DIR AND RBDL_LIBRARY)

IF (AMBF_CLIENT_FOUND)
MESSAGE(STATUS "Found AMBF: ${AMBF_CLIENT_LIBRARY}")
ELSE(AMBF_CLIENT_FOUND)
MESSAGE(STATUS " NOt Found AMBF")
ENDIF (RBDL_FOUND)
# generated from catkin/cmake/template/pkgConfig.cmake.in

# append elements to a list and remove existing duplicates from the list
# copied from catkin/cmake/list_append_deduplicate.cmake to keep pkgConfig
# self contained
macro(_list_append_deduplicate listname)
if(NOT "${ARGN}" STREQUAL "")
if(${listname})
list(REMOVE_ITEM ${listname} ${ARGN})
endif()
list(APPEND ${listname} ${ARGN})
endif()
endmacro()

# append elements to a list if they are not already in the list
# copied from catkin/cmake/list_append_unique.cmake to keep pkgConfig
# self contained
macro(_list_append_unique listname)
foreach(_item ${ARGN})
list(FIND ${listname} ${_item} _index)
if(_index EQUAL -1)
list(APPEND ${listname} ${_item})
endif()
endforeach()
endmacro()

# pack a list of libraries with optional build configuration keywords
# copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig
# self contained
macro(_pack_libraries_with_build_configuration VAR)
set(${VAR} "")
set(_argn ${ARGN})
list(LENGTH _argn _count)
set(_index 0)
while(${_index} LESS ${_count})
list(GET _argn ${_index} lib)
if("${lib}" MATCHES "^(debug|optimized|general)$")
math(EXPR _index "${_index} + 1")
if(${_index} EQUAL ${_count})
message(FATAL_ERROR "_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library")
endif()
list(GET _argn ${_index} library)
list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}")
else()
list(APPEND ${VAR} "${lib}")
endif()
math(EXPR _index "${_index} + 1")
endwhile()
endmacro()

# unpack a list of libraries with optional build configuration keyword prefixes
# copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig
# self contained
macro(_unpack_libraries_with_build_configuration VAR)
set(${VAR} "")
foreach(lib ${ARGN})
string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}")
list(APPEND ${VAR} "${lib}")
endforeach()
endmacro()


if(ambf_client_CONFIG_INCLUDED)
return()
endif()
set(ambf_client_CONFIG_INCLUDED TRUE)

# set variables for source/devel/install prefixes
if("TRUE" STREQUAL "TRUE")
set(ambf_client_SOURCE_PREFIX /mnt/OneTB/localcodebase/ambf_repos/ambfvtwodotzero/ambf/ambf_ros_modules/ambf_client)
set(ambf_client_DEVEL_PREFIX /mnt/OneTB/localcodebase/ambf_repos/ambfvtwodotzero/ambf/build/devel)
set(ambf_client_INSTALL_PREFIX "")
set(ambf_client_PREFIX ${ambf_client_DEVEL_PREFIX})
else()
set(ambf_client_SOURCE_PREFIX "")
set(ambf_client_DEVEL_PREFIX "")
set(ambf_client_INSTALL_PREFIX /usr/local)
set(ambf_client_PREFIX ${ambf_client_INSTALL_PREFIX})
endif()

# warn when using a deprecated package
if(NOT "" STREQUAL "")
set(_msg "WARNING: package 'ambf_client' is deprecated")
# append custom deprecation text if available
if(NOT "" STREQUAL "TRUE")
set(_msg "${_msg} ()")
endif()
message("${_msg}")
endif()

# flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project
set(ambf_client_FOUND_CATKIN_PROJECT TRUE)

if(NOT "/mnt/OneTB/localcodebase/ambf_repos/ambfvtwodotzero/ambf/ambf_ros_modules/ambf_client/include " STREQUAL " ")
set(ambf_client_INCLUDE_DIRS "")
set(_include_dirs "/mnt/OneTB/localcodebase/ambf_repos/ambfvtwodotzero/ambf/ambf_ros_modules/ambf_client/include")
if(NOT " " STREQUAL " ")
set(_report "Check the issue tracker '' and consider creating a ticket if the problem has not been reported yet.")
elseif(NOT " " STREQUAL " ")
set(_report "Check the website '' for information and consider reporting the problem.")
else()
set(_report "Report the problem to the maintainer 'Shreyas Chandra Sekhar <[email protected]>' and request to fix the problem.")
endif()
foreach(idir ${_include_dirs})
if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir})
set(include ${idir})
elseif("${idir} " STREQUAL "include ")
get_filename_component(include "${ambf_client_DIR}/../../../include" ABSOLUTE)
if(NOT IS_DIRECTORY ${include})
message(FATAL_ERROR "Project 'ambf_client' specifies '${idir}' as an include dir, which is not found. It does not exist in '${include}'. ${_report}")
endif()
else()
message(FATAL_ERROR "Project 'ambf_client' specifies '${idir}' as an include dir, which is not found. It does neither exist as an absolute directory nor in '/mnt/OneTB/localcodebase/ambf_repos/ambfvtwodotzero/ambf/ambf_ros_modules/ambf_client/${idir}'. ${_report}")
endif()
_list_append_unique(ambf_client_INCLUDE_DIRS ${include})
endforeach()
endif()

set(libraries "ambf_client_cpp")
foreach(library ${libraries})
# keep build configuration keywords, target names and absolute libraries as-is
if("${library}" MATCHES "^(debug|optimized|general)$")
list(APPEND ambf_client_LIBRARIES ${library})
elseif(${library} MATCHES "^-l")
list(APPEND ambf_client_LIBRARIES ${library})
elseif(${library} MATCHES "^-")
# This is a linker flag/option (like -pthread)
# There's no standard variable for these, so create an interface library to hold it
if(NOT ambf_client_NUM_DUMMY_TARGETS)
set(ambf_client_NUM_DUMMY_TARGETS 0)
endif()
# Make sure the target name is unique
set(interface_target_name "catkin::ambf_client::wrapped-linker-option${ambf_client_NUM_DUMMY_TARGETS}")
while(TARGET "${interface_target_name}")
math(EXPR ambf_client_NUM_DUMMY_TARGETS "${ambf_client_NUM_DUMMY_TARGETS}+1")
set(interface_target_name "catkin::ambf_client::wrapped-linker-option${ambf_client_NUM_DUMMY_TARGETS}")
endwhile()
add_library("${interface_target_name}" INTERFACE IMPORTED)
if("${CMAKE_VERSION}" VERSION_LESS "3.13.0")
set_property(
TARGET
"${interface_target_name}"
APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "${library}")
else()
target_link_options("${interface_target_name}" INTERFACE "${library}")
endif()
list(APPEND ambf_client_LIBRARIES "${interface_target_name}")
elseif(TARGET ${library})
list(APPEND ambf_client_LIBRARIES ${library})
elseif(IS_ABSOLUTE ${library})
list(APPEND ambf_client_LIBRARIES ${library})
else()
set(lib_path "")
set(lib "${library}-NOTFOUND")
# since the path where the library is found is returned we have to iterate over the paths manually
foreach(path /mnt/OneTB/localcodebase/ambf_repos/ambfvtwodotzero/ambf/build/devel/lib;/mnt/OneTB/localcodebase/ambf_repos/aimlab/ambf/build/devel/lib;/opt/ros/melodic/lib)
find_library(lib ${library}
PATHS ${path}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
if(lib)
set(lib_path ${path})
break()
endif()
endforeach()
if(lib)
_list_append_unique(ambf_client_LIBRARY_DIRS ${lib_path})
list(APPEND ambf_client_LIBRARIES ${lib})
else()
# as a fall back for non-catkin libraries try to search globally
find_library(lib ${library})
if(NOT lib)
message(FATAL_ERROR "Project '${PROJECT_NAME}' tried to find library '${library}'. The library is neither a target nor built/installed properly. Did you compile project 'ambf_client'? Did you find_package() it before the subdirectory containing its code is included?")
endif()
list(APPEND ambf_client_LIBRARIES ${lib})
endif()
endif()
endforeach()

set(ambf_client_EXPORTED_TARGETS "")
# create dummy targets for exported code generation targets to make life of users easier
foreach(t ${ambf_client_EXPORTED_TARGETS})
if(NOT TARGET ${t})
add_custom_target(${t})
endif()
endforeach()

set(depends "ambf_msgs;message_runtime")
foreach(depend ${depends})
string(REPLACE " " ";" depend_list ${depend})
# the package name of the dependency must be kept in a unique variable so that it is not overwritten in recursive calls
list(GET depend_list 0 ambf_client_dep)
list(LENGTH depend_list count)
if(${count} EQUAL 1)
# simple dependencies must only be find_package()-ed once
if(NOT ${ambf_client_dep}_FOUND)
find_package(${ambf_client_dep} REQUIRED NO_MODULE)
endif()
else()
# dependencies with components must be find_package()-ed again
list(REMOVE_AT depend_list 0)
find_package(${ambf_client_dep} REQUIRED NO_MODULE ${depend_list})
endif()
_list_append_unique(ambf_client_INCLUDE_DIRS ${${ambf_client_dep}_INCLUDE_DIRS})

# merge build configuration keywords with library names to correctly deduplicate
_pack_libraries_with_build_configuration(ambf_client_LIBRARIES ${ambf_client_LIBRARIES})
_pack_libraries_with_build_configuration(_libraries ${${ambf_client_dep}_LIBRARIES})
_list_append_deduplicate(ambf_client_LIBRARIES ${_libraries})
# undo build configuration keyword merging after deduplication
_unpack_libraries_with_build_configuration(ambf_client_LIBRARIES ${ambf_client_LIBRARIES})

_list_append_unique(ambf_client_LIBRARY_DIRS ${${ambf_client_dep}_LIBRARY_DIRS})
list(APPEND ambf_client_EXPORTED_TARGETS ${${ambf_client_dep}_EXPORTED_TARGETS})
endforeach()

set(pkg_cfg_extras "")
foreach(extra ${pkg_cfg_extras})
if(NOT IS_ABSOLUTE ${extra})
set(extra ${ambf_client_DIR}/${extra})
endif()
include(${extra})
endforeach()
Loading