Commit 962a70ec authored by Olivier Stasse's avatar Olivier Stasse
Browse files

[cmake] Export CMake Files.

parent e64d4863
...@@ -22,7 +22,10 @@ add_required_dependency("urdfdom") ...@@ -22,7 +22,10 @@ add_required_dependency("urdfdom")
SET(CATKIN_REQUIRED_COMPONENTS SET(CATKIN_REQUIRED_COMPONENTS
pal_hardware_interfaces pal_hardware_interfaces
controller_interface temperature_sensor_controller
controller_interface
controller_manager
pal_common_msgs
roscpp roscpp
std_msgs std_msgs
dynamic_graph_bridge dynamic_graph_bridge
...@@ -52,6 +55,8 @@ include_directories(include tests ${bullet_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}) ...@@ -52,6 +55,8 @@ include_directories(include tests ${bullet_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
link_directories(${bullet_LIBRARY_DIRS}) link_directories(${bullet_LIBRARY_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
SETUP_PROJECT() SETUP_PROJECT()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
...@@ -61,33 +66,36 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}") ...@@ -61,33 +66,36 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}")
# Add dependency through jrl-cmakemodules to compile # Add dependency through jrl-cmakemodules to compile
# this code without catkin_make # this code without catkin_make
add_required_dependency("pal_hardware_interfaces") #add_project_dependency(dynamic_graph_bridge REQUIRED)
add_optional_dependency("temperature_sensor_controller") add_project_dependency(dynamic-graph REQUIRED)
add_required_dependency(roscpp) add_project_dependency(dynamic-graph-python REQUIRED)
add_required_dependency("realtime_tools >= 1.8") add_project_dependency(sot-core REQUIRED)
add_required_dependency("dynamic_graph_bridge")
add_required_dependency("controller_interface")
add_required_dependency("controller_manager")
add_required_dependency("pal_common_msgs")
add_required_dependency("dynamic-graph")
add_required_dependency("dynamic-graph-python")
add_required_dependency("sot-core")
add_required_dependency("pinocchio") add_required_dependency("pinocchio")
# This is necessary so that the pc file generated by catking is similar # This is necessary so that the pc file generated by catking is similar
# to the on done directly by jrl-cmake-modules # to the on done directly by jrl-cmake-modules
catkin_package(CATKIN_DEPENDS catkin_package(CATKIN_DEPENDS
roscpp realtime_tools message_runtime dynamic_graph_bridge roscpp
pal_hardware_interfaces controller_interface controller_manager realtime_tools
message_runtime
dynamic_graph_bridge
pal_hardware_interfaces
controller_interface controller_manager
LIBRARIES ${CATKIN_DEPENDS_LIBRARIES} ) LIBRARIES ${CATKIN_DEPENDS_LIBRARIES} )
# Detect the controller interface version to switch code # Detect the controller interface version to switch code
if(CONTROLLER_INTERFACE_FOUND) if(controller_interface_FOUND)
if (${CONTROLLER_INTERFACE_VERSION} VERSION_GREATER "0.2.5") if (${controller_interface_VERSION} VERSION_GREATER "0.2.5")
add_definitions(-DCONTROLLER_INTERFACE_KINETIC) add_definitions(-DCONTROLLER_INTERFACE_KINETIC)
endif(${CONTROLLER_INTERFACE_VERSION} VERSION_GREATER "0.2.5") endif(${controller_interface_VERSION} VERSION_GREATER "0.2.5")
endif(CONTROLLER_INTERFACE_FOUND) endif(controller_interface_FOUND)
LIST(APPEND LOGGING_WATCHED_VARIABLES
CONTROLLER_INTERFACE_FOUND
CONTROLLER_INTERFACE_VERSION )
# Detect if temperature sensor controller package is found # Detect if temperature sensor controller package is found
# if yes then it is a PARL Robotics Forked code. # if yes then it is a PARL Robotics Forked code.
if(TEMPERATURE_SENSOR_CONTROLLER_FOUND) if(TEMPERATURE_SENSOR_CONTROLLER_FOUND)
...@@ -123,10 +131,9 @@ target_link_libraries(rcsot_controller ...@@ -123,10 +131,9 @@ target_link_libraries(rcsot_controller
${bullet_LIBRARIES} ${bullet_LIBRARIES}
) )
pkg_config_use_dependency(rcsot_controller urdfdom optional #target_link_libraries(rcsot_controller urdfdom optional
NO_INCLUDE_SYSTEM) # NO_INCLUDE_SYSTEM)
pkg_config_use_dependency(rcsot_controller dynamic-graph optional target_link_libraries(rcsot_controller dynamic-graph::dynamic-graph)
NO_INCLUDE_SYSTEM)
## Mark executables and/or libraries for installation ## Mark executables and/or libraries for installation
install(TARGETS rcsot_controller DESTINATION lib ) install(TARGETS rcsot_controller DESTINATION lib )
...@@ -144,4 +151,13 @@ endforeach() ...@@ -144,4 +151,13 @@ endforeach()
ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(tests)
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
LIST(APPEND LOGGING_WATCHED_VARIABLES
${_variableName}
)
endforeach()
SETUP_PROJECT_FINALIZE() SETUP_PROJECT_FINALIZE()
...@@ -20,9 +20,6 @@ file(MAKE_DIRECTORY ...@@ -20,9 +20,6 @@ file(MAKE_DIRECTORY
${LIBRARY_OUTPUT_PATH}/dynamic_graph/sot/test/sot_test_device) ${LIBRARY_OUTPUT_PATH}/dynamic_graph/sot/test/sot_test_device)
pkg_config_use_dependency(roscontrol_sot_hardware controller_manager
NO_INCLUDE_SYSTEM)
target_link_libraries(roscontrol_sot_hardware target_link_libraries(roscontrol_sot_hardware
${catkin_LIBRARIES} ${catkin_LIBRARIES}
${bullet_libraries} ${bullet_libraries}
...@@ -41,11 +38,12 @@ MACRO(build_test_device) ...@@ -41,11 +38,12 @@ MACRO(build_test_device)
#set_target_properties(${DEVICE_NAME} PROPERTIES PREFIX "") #set_target_properties(${DEVICE_NAME} PROPERTIES PREFIX "")
# Link the dynamic library containing the SoT with its dependencies. # Link the dynamic library containing the SoT with its dependencies.
PKG_CONFIG_USE_DEPENDENCY(${DEVICE_NAME} "dynamic-graph") target_link_libraries(${DEVICE_NAME} dynamic-graph::dynamic-graph)
PKG_CONFIG_USE_DEPENDENCY(${DEVICE_NAME} "dynamic-graph-python") target_link_libraries(${DEVICE_NAME}
PKG_CONFIG_USE_DEPENDENCY(${DEVICE_NAME} "sot-core") dynamic-graph-python::dynamic-graph-python)
PKG_CONFIG_USE_DEPENDENCY(${DEVICE_NAME} "pinocchio") target_link_libraries(${DEVICE_NAME} sot-core::sot-core)
PKG_CONFIG_USE_DEPENDENCY(${DEVICE_NAME} "dynamic_graph_bridge") PKG_CONFIG_USE_DEPENDENCY(${DEVICE_NAME} pinocchio)
# target_link_libraries(${DEVICE_NAME} dynamic_graph_bridge ros_bridge ros_inter)
IF(UNIX AND NOT APPLE) IF(UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(${DEVICE_NAME} ${Boost_LIBRARIES}) TARGET_LINK_LIBRARIES(${DEVICE_NAME} ${Boost_LIBRARIES})
...@@ -80,17 +78,20 @@ MACRO(build_test_controller) ...@@ -80,17 +78,20 @@ MACRO(build_test_controller)
#set_target_properties(${CONTROLLER_NAME} PROPERTIES PREFIX "") #set_target_properties(${CONTROLLER_NAME} PROPERTIES PREFIX "")
# Link the dynamic library containing the SoT with its dependencies. # Link the dynamic library containing the SoT with its dependencies.
PKG_CONFIG_USE_DEPENDENCY(${CONTROLLER_NAME} "dynamic-graph") target_link_libraries(${CONTROLLER_NAME}
PKG_CONFIG_USE_DEPENDENCY(${CONTROLLER_NAME} "dynamic-graph-python") dynamic-graph::dynamic-graph)
PKG_CONFIG_USE_DEPENDENCY(${CONTROLLER_NAME} "sot-core") target_link_libraries(${CONTROLLER_NAME}
dynamic-graph-python::dynamic-graph-python)
target_link_libraries(${CONTROLLER_NAME}
sot-core::sot-core)
PKG_CONFIG_USE_DEPENDENCY(${CONTROLLER_NAME} "pinocchio") PKG_CONFIG_USE_DEPENDENCY(${CONTROLLER_NAME} "pinocchio")
PKG_CONFIG_USE_DEPENDENCY(${CONTROLLER_NAME} "dynamic_graph_bridge") #target_link_libraries(${CONTROLLER_NAME} dynamic_graph_bridge)
ADD_DEPENDENCIES(${CONTROLLER_NAME} sot-test-device) ADD_DEPENDENCIES(${CONTROLLER_NAME} sot-test-device)
TARGET_LINK_LIBRARIES(${CONTROLLER_NAME} "ros_bridge") #TARGET_LINK_LIBRARIES(${CONTROLLER_NAME} ros_bridge)
TARGET_LINK_LIBRARIES(${CONTROLLER_NAME} "ros_interpreter") #TARGET_LINK_LIBRARIES(${CONTROLLER_NAME} ros_interpreter)
TARGET_LINK_LIBRARIES(${CONTROLLER_NAME} "sot-test-device") TARGET_LINK_LIBRARIES(${CONTROLLER_NAME} sot-test-device)
IF(UNIX AND NOT APPLE) IF(UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(${CONTROLLER_NAME} ${Boost_LIBRARIES}) TARGET_LINK_LIBRARIES(${CONTROLLER_NAME} ${Boost_LIBRARIES})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment