Skip to content

Commit

Permalink
modified build option and dependencies configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
robotpilot committed Mar 27, 2018
1 parent fda51ea commit 2496162
Show file tree
Hide file tree
Showing 14 changed files with 473 additions and 258 deletions.
55 changes: 40 additions & 15 deletions ati_ft_sensor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
################################################################################
# CMake
# Set minimum required version of cmake, project name and compile options
################################################################################
cmake_minimum_required(VERSION 2.8.3)
project(ati_ft_sensor)

set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)

################################################################################
# Packages
# Find catkin packages and libraries for catkin and system dependencies
################################################################################
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
geometry_msgs
cmake_modules
robotis_math
)

find_package(Eigen REQUIRED)
find_package(Boost REQUIRED COMPONENTS thread)
find_package(Eigen3 REQUIRED)

set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CATKIN_DEVEL_PREFIX}/lib/pkgconfig")
find_package(PkgConfig)
pkg_check_modules(yaml_cpp yaml-cpp REQUIRED)
## Resolve system dependency on yaml-cpp, which apparently does not
## provide a CMake find_package() module.
## Insert your header file compatible specified path like '#include <yaml-cpp/yaml.h>'
find_package(PkgConfig REQUIRED)
pkg_check_modules(YAML_CPP REQUIRED yaml-cpp)
find_path(YAML_CPP_INCLUDE_DIR
NAMES yaml_cpp.h
PATHS ${YAML_CPP_INCLUDE_DIRS}
)
find_library(YAML_CPP_LIBRARY
NAMES YAML_CPP
PATHS ${YAML_CPP_LIBRARY_DIRS}
)
link_directories(${YAML_CPP_LIBRARY_DIRS})

if(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5")
add_definitions(-DHAVE_NEW_YAMLCPP)
endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5")

################################################################################
# Setup for python modules and scripts
################################################################################

################################################################################
# Declare ROS messages, services and actions
Expand All @@ -31,11 +53,13 @@ pkg_check_modules(yaml_cpp yaml-cpp REQUIRED)
################################################################################

################################################################################
# Catkin specific configuration
# Declare catkin specific configuration to be passed to dependent projects
################################################################################
catkin_package(
INCLUDE_DIRS include
LIBRARIES ati_ft_sensor
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp roslib geometry_msgs cmake_modules robotis_math
DEPENDS Boost EIGEN3
)

################################################################################
Expand All @@ -44,18 +68,19 @@ catkin_package(
include_directories(
include
${catkin_INCLUDE_DIRS}
${Eigen_INCLUDE_DIRS}
${yaml_cpp_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${YAML_CPP_INCLUDE_DIRS}
)

add_library(ati_ft_sensor src/ati_force_torque_sensor_twe.cpp)
add_dependencies(ati_ft_sensor ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(ati_ft_sensor ${yaml_cpp_LIBRARIES} ${catkin_LIBRARIES})
add_library(${PROJECT_NAME} src/ati_force_torque_sensor_twe.cpp)
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${Eigen3_LIBRARIES} ${YAML_CPP_LIBRARIES})

################################################################################
# Install
################################################################################
install(TARGETS ati_ft_sensor
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
Expand Down
32 changes: 20 additions & 12 deletions motion_module_tutorial/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
################################################################################
# CMake
# Set minimum required version of cmake, project name and compile options
################################################################################
cmake_minimum_required(VERSION 2.8.3)
project(motion_module_tutorial)

set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)

################################################################################
# Packages
# Find catkin packages and libraries for catkin and system dependencies
################################################################################
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
robotis_framework_common
)

find_package(Boost REQUIRED COMPONENTS thread)

################################################################################
# Setup for python modules and scripts
################################################################################

################################################################################
# Declare ROS messages, services and actions
################################################################################
Expand All @@ -23,12 +31,13 @@ find_package(catkin REQUIRED COMPONENTS
################################################################################

################################################################################
# Catkin specific configuration
# Declare catkin specific configuration to be passed to dependent projects
################################################################################
catkin_package(
INCLUDE_DIRS include
LIBRARIES motion_module_tutorial
CATKIN_DEPENDS roscpp robotis_framework_common
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp std_msgs robotis_framework_common
DEPENDS Boost
)

################################################################################
Expand All @@ -37,18 +46,17 @@ catkin_package(
include_directories(
include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)

add_library(motion_module_tutorial
src/${PROJECT_NAME}/motion_module_tutorial.cpp
)

add_dependencies(motion_module_tutorial ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_library(${PROJECT_NAME} src/${PROJECT_NAME}/motion_module_tutorial.cpp)
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Boost_LIBRARIES})

################################################################################
# Install
################################################################################
install(TARGETS motion_module_tutorial
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
Expand Down
32 changes: 20 additions & 12 deletions sensor_module_tutorial/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
################################################################################
# CMake
# Set minimum required version of cmake, project name and compile options
################################################################################
cmake_minimum_required(VERSION 2.8.3)
project(sensor_module_tutorial)

set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)

################################################################################
# Packages
# Find catkin packages and libraries for catkin and system dependencies
################################################################################
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
robotis_framework_common
)

find_package(Boost REQUIRED COMPONENTS thread)

################################################################################
# Setup for python modules and scripts
################################################################################

################################################################################
# Declare ROS messages, services and actions
################################################################################
Expand All @@ -23,12 +31,13 @@ find_package(catkin REQUIRED COMPONENTS
################################################################################

################################################################################
# Catkin specific configuration
# Declare catkin specific configuration to be passed to dependent projects
################################################################################
catkin_package(
INCLUDE_DIRS include
LIBRARIES sensor_module_tutorial
CATKIN_DEPENDS roscpp robotis_framework_common
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp std_msgs robotis_framework_common
DEPENDS Boost
)

################################################################################
Expand All @@ -37,18 +46,17 @@ catkin_package(
include_directories(
include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)

add_library(sensor_module_tutorial
src/${PROJECT_NAME}/sensor_module_tutorial.cpp
)

add_dependencies(sensor_module_tutorial ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_library(${PROJECT_NAME} src/${PROJECT_NAME}/sensor_module_tutorial.cpp)
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Boost_LIBRARIES})

################################################################################
# Install
################################################################################
install(TARGETS sensor_module_tutorial
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
Expand Down
39 changes: 24 additions & 15 deletions thormang3_action_module/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
################################################################################
# CMake
# Set minimum required version of cmake, project name and compile options
################################################################################
cmake_minimum_required(VERSION 2.8.3)
project(thormang3_action_module)

set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)

################################################################################
# Packages
# Find catkin packages and libraries for catkin and system dependencies
################################################################################
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
std_msgs
robotis_controller_msgs
robotis_framework_common
thormang3_action_module_msgs
robotis_framework_common
)

find_package(Boost REQUIRED COMPONENTS thread)

################################################################################
# Setup for python modules and scripts
################################################################################

################################################################################
# Declare ROS messages, services and actions
################################################################################
Expand All @@ -26,12 +34,13 @@ find_package(catkin REQUIRED COMPONENTS
################################################################################

################################################################################
# Catkin specific configuration
# Declare catkin specific configuration to be passed to dependent projects
################################################################################
catkin_package(
INCLUDE_DIRS include
LIBRARIES thormang3_action_module
CATKIN_DEPENDS roscpp robotis_framework_common
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp roslib std_msgs robotis_controller_msgs thormang3_action_module_msgs robotis_framework_common
DEPENDS Boost
)

################################################################################
Expand All @@ -40,18 +49,17 @@ catkin_package(
include_directories(
include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)

add_library(thormang3_action_module
src/action_module.cpp
)

add_dependencies(thormang3_action_module ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_library(${PROJECT_NAME} src/action_module.cpp)
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Boost_LIBRARIES})

################################################################################
# Install
################################################################################
install(TARGETS thormang3_action_module
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
Expand All @@ -61,9 +69,10 @@ install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)

install(DIRECTORY data/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
install(DIRECTORY data
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

################################################################################
# Test
################################################################################
Loading

0 comments on commit 2496162

Please sign in to comment.