Commit b0e03ae0 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Comment test

Reorganize CMakeLists.txt for compiling with CMake export.
TODO: Fix the fact that the installation is not properly
done even when specifying PYTHON_STANDARD_LAYOUT.
parent 962a70ec
......@@ -8,21 +8,40 @@ set(CXX_DISABLE_WERROR True)
set(WARNING_CXX_FLAGS "${WARNING_CXX_FLAGS} -Werror=format-security")
SET(PROJECT_ORG stack-of-tasks)
set(PROJECT_DESCRIPTION "roscontrol_sot")
set(PROJECT_NAME roscontrol_sot)
set(PROJECT_URL "https://github.com/stack-of-tasks/roscontrol_sot")
# Export CMake Target
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
# Disable failing compilation when a compilation error appears
set(CXX_DISABLE_WERROR False)
include(cmake/base.cmake)
# Specify the project.
cmake_policy(SET CMP0048 NEW)
PROJECT(${PROJECT_NAME}
LANGUAGES
CXX
VERSION
${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
)
include(cmake/ros.cmake)
include(cmake/GNUInstallDirs.cmake)
include(cmake/python.cmake)
project(roscontrol_sot)
find_package(PkgConfig REQUIRED)
add_required_dependency(bullet)
add_required_dependency("urdfdom")
SET(CATKIN_REQUIRED_COMPONENTS
temperature_sensor_controller
pal_hardware_interfaces
temperature_sensor_controller
controller_interface
controller_manager
pal_common_msgs
......@@ -51,14 +70,12 @@ set(PROJECT_NAME roscontrol_sot)
set(PROJECT_URL "https://github.com/stack-of-tasks/roscontrol_sot")
include_directories(include tests ${bullet_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
include_directories(include tests ${catkin_INCLUDE_DIRS} ${bullet_INCLUDE_DIRS})
link_directories(${bullet_LIBRARY_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
SETUP_PROJECT()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_INSTALL_RPATH "${LIBRARY_OUTPUT_PATH}")
......@@ -67,22 +84,21 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}")
# Add dependency through jrl-cmakemodules to compile
# this code without catkin_make
#add_project_dependency(dynamic_graph_bridge REQUIRED)
add_project_dependency(dynamic-graph REQUIRED)
add_project_dependency(dynamic-graph-python REQUIRED)
add_project_dependency(sot-core REQUIRED)
add_required_dependency("pinocchio")
add_project_dependency(dynamic-graph REQUIRED )
add_project_dependency(dynamic-graph-python REQUIRED )
add_project_dependency(sot-core REQUIRED )
add_required_dependency("pinocchio" REQUIRED)
# This is necessary so that the pc file generated by catking is similar
# to the on done directly by jrl-cmake-modules
catkin_package(CATKIN_DEPENDS
temperature_sensor_controller
pal_hardware_interfaces
controller_interface controller_manager
roscpp
realtime_tools
message_runtime
dynamic_graph_bridge
pal_hardware_interfaces
controller_interface controller_manager
LIBRARIES ${CATKIN_DEPENDS_LIBRARIES} )
# Detect the controller interface version to switch code
......@@ -92,16 +108,17 @@ if(controller_interface_FOUND)
endif(${controller_interface_VERSION} VERSION_GREATER "0.2.5")
endif(controller_interface_FOUND)
LIST(APPEND LOGGING_WATCHED_VARIABLES
CONTROLLER_INTERFACE_FOUND
CONTROLLER_INTERFACE_VERSION )
# Detect if temperature sensor controller package is found
# if yes then it is a PARL Robotics Forked code.
if(TEMPERATURE_SENSOR_CONTROLLER_FOUND)
if(temperature_sensor_controller_FOUND)
add_definitions(-DTEMPERATURE_SENSOR_CONTROLLER)
endif(TEMPERATURE_SENSOR_CONTROLLER_FOUND)
endif(temperature_sensor_controller_FOUND)
LIST(APPEND LOGGING_WATCHED_VARIABLES
TEMPERATURE_SENSOR_CONTROLLER_FOUND
CONTROLLER_INTERFACE_FOUND
CONTROLLER_INTERFACE_VERSION )
###########
## Build ##
......@@ -120,6 +137,7 @@ src/roscontrol-sot-controller.cpp
src/log.cpp
)
pkg_config_use_dependency(rcsot_controller pinocchio NO_INCLUDE_SYSTEM)
## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(roscontrol_sot_node ${${PROJECT_NAME}_EXPORTED_TARGETS}
......@@ -136,11 +154,15 @@ target_link_libraries(rcsot_controller
target_link_libraries(rcsot_controller dynamic-graph::dynamic-graph)
## Mark executables and/or libraries for installation
install(TARGETS rcsot_controller DESTINATION lib )
install(TARGETS rcsot_controller
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION lib )
ADD_EXECUTABLE(roscontrol-sot-parse-log
src/roscontrol-sot-parse-log.cc)
install(TARGETS roscontrol-sot-parse-log DESTINATION bin )
install(TARGETS roscontrol-sot-parse-log
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION bin )
foreach(dir config launch)
install(DIRECTORY ${dir}
......@@ -149,7 +171,7 @@ foreach(dir config launch)
endforeach()
ADD_SUBDIRECTORY(tests)
#ADD_SUBDIRECTORY(tests)
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
......@@ -161,3 +183,8 @@ endforeach()
SETUP_PROJECT_FINALIZE()
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
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