Commit 605517cb authored by Guilhem Saurel's avatar Guilhem Saurel

Merge branch 'master' into devel

parents 73c5966a 1769d4bb
Pipeline #8743 passed with stage
in 24 minutes and 11 seconds
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
# Setup project properties # Project properties
SET(PROJECT_ORG stack-of-tasks) SET(PROJECT_ORG stack-of-tasks)
SET(PROJECT_NAME dynamic-graph) SET(PROJECT_NAME dynamic-graph)
SET(PROJECT_DESCRIPTION "Dynamic graph library") SET(PROJECT_DESCRIPTION "Dynamic graph library")
SET(PROJECT_URL "http://github.com/${PROJECT_ORG}/${PROJECT_NAME}") SET(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
SET(PROJECT_SUFFIX "-v3") SET(PROJECT_SUFFIX "-v3")
# Export CMake Target # Project options
SET(PROJECT_USE_CMAKE_EXPORT TRUE) OPTION(SUFFIX_SO_VERSION "Suffix library name with its version" ON)
# Make sure that every header is generated in dynamic-graph # Project configuration
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(CUSTOM_HEADER_DIR ${PROJECT_NAME}) SET(CUSTOM_HEADER_DIR ${PROJECT_NAME})
# Do not fail on warning
SET(CXX_DISABLE_WERROR TRUE) SET(CXX_DISABLE_WERROR TRUE)
SET(DOXYGEN_USE_MATHJAX YES)
SET(DYNAMIC_GRAPH_PLUGINDIR "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}-plugins")
SET(PACKAGE_EXTRA_MACROS "set(DYNAMIC_GRAPH_PLUGINDIR ${DYNAMIC_GRAPH_PLUGINDIR})")
SET(PKG_CONFIG_EXTRA "plugindir=${DYNAMIC_GRAPH_PLUGINDIR}")
SET(CMAKE_INSTALL_RPATH "${DYNAMIC_GRAPH_PLUGINDIR}")
# JRL-cmakemodule setup
INCLUDE(cmake/base.cmake) INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
# Specify the project. # Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX) COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS}) PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
# jrl-cmakemodules handling of usual modules INCLUDE(cmake/pthread.cmake) # needs to be included after the CXX definition
INCLUDE(cmake/pthread.cmake)
INCLUDE(cmake/boost.cmake)
ADD_REQUIRED_DEPENDENCY(eigen3) # Project dependencies
ADD_PROJECT_DEPENDENCY(Eigen3 REQUIRED PKG_CONFIG_REQUIRES eigen3)
SET(BOOST_COMPONENTS serialization system unit_test_framework thread) SET(BOOST_COMPONENTS serialization system unit_test_framework thread)
SEARCH_FOR_BOOST() SEARCH_FOR_BOOST()
SEARCH_FOR_PTHREAD()
# Allows math in mathjax.
SET(DOXYGEN_USE_MATHJAX YES)
# Defines paths.
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
# Add configuration headers for plug-ins. # Add configuration headers for plug-ins.
GENERATE_CONFIGURATION_HEADER( GENERATE_CONFIGURATION_HEADER(
...@@ -43,32 +43,63 @@ GENERATE_CONFIGURATION_HEADER( ...@@ -43,32 +43,63 @@ GENERATE_CONFIGURATION_HEADER(
${HEADER_DIR} ${HEADER_DIR}
config-tracer-real-time.hh DG_TRACERREALTIME tracer_real_time_EXPORTS) config-tracer-real-time.hh DG_TRACERREALTIME tracer_real_time_EXPORTS)
set(PACKAGE_EXTRA_MACROS
"set (DYNAMIC_GRAPH_PLUGINDIR \${CMAKE_CURRENT_LIST_DIR}/../../plugin)")
# Specific to PKG module
# FIXME: to be changed into lib/dynamic-graph
# to avoid name collision when installing dynamic-graph in /usr.
SET(PLUGINDIR "${CMAKE_INSTALL_FULL_LIBDIR}/plugin")
# Add extra keys to pkg-config file to export the location of the
# plug-in directory in a robust manner.
SET(PKG_CONFIG_EXTRA "plugindir=${PLUGINDIR}")
# Add dependency toward dynamic graph library in pkg-config file.
PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
# Search for Boost.
SEARCH_FOR_PTHREAD()
####################################
### Main Library
####################################
# Verbosity level # Verbosity level
IF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\")) IF(NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
ADD_DEFINITIONS(-DVP_DEBUG_MODE=${CMAKE_VERBOSITY_LEVEL} -DVP_DEBUG) ADD_DEFINITIONS(-DVP_DEBUG_MODE=${CMAKE_VERBOSITY_LEVEL} -DVP_DEBUG)
ENDIF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\")) ENDIF(NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
# Main Library
SET(${PROJECT_NAME}_HEADERS
include/${CUSTOM_HEADER_DIR}/fwd.hh
include/${CUSTOM_HEADER_DIR}/debug.h
include/${CUSTOM_HEADER_DIR}/real-time-logger.h
include/${CUSTOM_HEADER_DIR}/real-time-logger-def.h
include/${CUSTOM_HEADER_DIR}/dynamic-graph-api.h
include/${CUSTOM_HEADER_DIR}/entity.h
include/${CUSTOM_HEADER_DIR}/factory.h
include/${CUSTOM_HEADER_DIR}/pool.h
include/${CUSTOM_HEADER_DIR}/exception-abstract.h
include/${CUSTOM_HEADER_DIR}/exception-factory.h
include/${CUSTOM_HEADER_DIR}/exception-signal.h
include/${CUSTOM_HEADER_DIR}/exception-traces.h
include/${CUSTOM_HEADER_DIR}/signal.h
include/${CUSTOM_HEADER_DIR}/signal-array.h
include/${CUSTOM_HEADER_DIR}/signal-base.h
include/${CUSTOM_HEADER_DIR}/signal-ptr.h
include/${CUSTOM_HEADER_DIR}/signal-time-dependent.h
include/${CUSTOM_HEADER_DIR}/signal-ptr.t.cpp
include/${CUSTOM_HEADER_DIR}/signal.t.cpp
include/${CUSTOM_HEADER_DIR}/time-dependency.h
include/${CUSTOM_HEADER_DIR}/time-dependency.t.cpp
include/${CUSTOM_HEADER_DIR}/signal-caster.h
include/${CUSTOM_HEADER_DIR}/signal-cast-helper.h
include/${CUSTOM_HEADER_DIR}/all-signals.h
include/${CUSTOM_HEADER_DIR}/signal-helper.h
include/${CUSTOM_HEADER_DIR}/entity-helper.h
include/${CUSTOM_HEADER_DIR}/tracer.h
include/${CUSTOM_HEADER_DIR}/tracer-real-time.h
include/${CUSTOM_HEADER_DIR}/command.h
include/${CUSTOM_HEADER_DIR}/eigen-io.h
include/${CUSTOM_HEADER_DIR}/linear-algebra.h
include/${CUSTOM_HEADER_DIR}/value.h
include/${CUSTOM_HEADER_DIR}/command-setter.h
include/${CUSTOM_HEADER_DIR}/command-setter.t.cpp
include/${CUSTOM_HEADER_DIR}/command-getter.h
include/${CUSTOM_HEADER_DIR}/command-getter.t.cpp
include/${CUSTOM_HEADER_DIR}/command-direct-getter.h
include/${CUSTOM_HEADER_DIR}/command-direct-setter.h
include/${CUSTOM_HEADER_DIR}/command-bind.h
include/${CUSTOM_HEADER_DIR}/all-commands.h
include/${CUSTOM_HEADER_DIR}/logger.h
)
SET(${PROJECT_NAME}_SOURCES SET(${PROJECT_NAME}_SOURCES
src/debug/debug.cpp src/debug/debug.cpp
...@@ -94,134 +125,24 @@ SET(${PROJECT_NAME}_SOURCES ...@@ -94,134 +125,24 @@ SET(${PROJECT_NAME}_SOURCES
src/command/command.cpp src/command/command.cpp
) )
SET(${PROJECT_NAME}_HEADERS ADD_LIBRARY(${PROJECT_NAME} SHARED
include/dynamic-graph/fwd.hh ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
include/dynamic-graph/debug.h TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIR})
include/dynamic-graph/real-time-logger.h TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
include/dynamic-graph/real-time-logger-def.h
include/dynamic-graph/dynamic-graph-api.h
include/dynamic-graph/entity.h
include/dynamic-graph/factory.h
include/dynamic-graph/pool.h
include/dynamic-graph/exception-abstract.h
include/dynamic-graph/exception-factory.h
include/dynamic-graph/exception-signal.h
include/dynamic-graph/exception-traces.h
include/dynamic-graph/signal.h
include/dynamic-graph/signal-array.h
include/dynamic-graph/signal-base.h
include/dynamic-graph/signal-ptr.h
include/dynamic-graph/signal-time-dependent.h
include/dynamic-graph/signal-ptr.t.cpp
include/dynamic-graph/signal.t.cpp
include/dynamic-graph/time-dependency.h
include/dynamic-graph/time-dependency.t.cpp
include/dynamic-graph/signal-caster.h
include/dynamic-graph/signal-cast-helper.h
include/dynamic-graph/all-signals.h
include/dynamic-graph/signal-helper.h
include/dynamic-graph/entity-helper.h
include/dynamic-graph/tracer.h
include/dynamic-graph/tracer-real-time.h
include/dynamic-graph/command.h
include/dynamic-graph/eigen-io.h
include/dynamic-graph/linear-algebra.h
include/dynamic-graph/value.h
include/dynamic-graph/command-setter.h
include/dynamic-graph/command-setter.t.cpp
include/dynamic-graph/command-getter.h
include/dynamic-graph/command-getter.t.cpp
include/dynamic-graph/command-direct-getter.h
include/dynamic-graph/command-direct-setter.h
include/dynamic-graph/command-bind.h
include/dynamic-graph/all-commands.h
include/dynamic-graph/logger.h
)
ADD_LIBRARY(${PROJECT_NAME}
SHARED ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
SET(PUBLIC_HEADER ${${PROJECT_NAME}_HEADERS})
INSTALL(TARGETS ${PROJECT_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
PUBLIC_HEADER
INCLUDES DESTINATION include
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
# We need to include Eigen3 because the CMakeFile at 16.04 LTS
# is not so modern.
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_BUILD_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
$<BUILD_INTERFACE:${EIGEN3_INCLUDE_DIRS}>
INTERFACE ${EIGEN3_INCLUDE_DIRS}
$<INSTALL_INTERFACE:include>
)
OPTION(SUFFIX_SO_VERSION
"Suffix shared library name by a string depending on git status of project"
ON)
IF (${SUFFIX_SO_VERSION} EQUAL "ON")
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDIF ()
IF (UNIX)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${CMAKE_DL_LIBS} pthread)
ENDIF (UNIX)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${Boost_LIBRARIES}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${Boost_LIBRARIES})
#################################### IF(UNIX)
### Plugins TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${CMAKE_DL_LIBS} pthread)
#################################### ENDIF(UNIX)
SET(plugins_list
src/traces/tracer
src/traces/tracer-real-time
)
SET(tracer-real-time_dependency tracer)
FOREACH(plugin_file ${plugins_list})
GET_FILENAME_COMPONENT(plugin ${plugin_file} NAME)
ADD_LIBRARY(${plugin} SHARED "${plugin_file}.cpp")
TARGET_LINK_LIBRARIES(${plugin}
${PROJECT_NAME} ${${plugin}_dependency}
${Boost_LIBRARIES})
SET_TARGET_PROPERTIES(${plugin} IF(SUFFIX_SO_VERSION)
PROPERTIES SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
PREFIX "" ENDIF(SUFFIX_SO_VERSION)
)
INSTALL(TARGETS ${plugin} INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
EXPORT ${TARGET_NAME}
DESTINATION ${PLUGINDIR})
ENDFOREACH(plugin_file)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(tests)
get_cmake_property(_variableNames VARIABLES) PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
LIST(APPEND LOGGING_WATCHED_VARIABLES
${_variableName}
)
endforeach()
INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME}) INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME})
MESSAGE(STATUS "dynamic_graph_VERSION=${dynamic_graph_VERSION}")
Subproject commit 61344038b1352d5a8de1e20db710c83be805d2eb Subproject commit 321eb1ccf1d94570eb564f3659b13ef3ef82239e
<package format="2"> <package format="2">
<name>dynamic-graph</name> <name>dynamic-graph</name>
<version>3.8.1</version> <version>4.0.0</version>
<description> <description>
Dynamic graph library Dynamic graph library
</description> </description>
......
SET(plugins
traces/tracer
traces/tracer-real-time
)
SET(tracer-real-time_deps tracer)
FOREACH(plugin ${plugins})
GET_FILENAME_COMPONENT(LIBRARY_NAME ${plugin} NAME)
ADD_LIBRARY(${LIBRARY_NAME} SHARED ${plugin})
IF(SUFFIX_SO_VERSION)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDIF(SUFFIX_SO_VERSION)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${PROJECT_NAME} ${${LIBRARY_NAME}_deps})
INSTALL(TARGETS ${LIBRARY_NAME} EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION ${DYNAMIC_GRAPH_PLUGINDIR})
ENDFOREACH(plugin)
# Copyright 2010, Olivier Stasse, JRL, CNRS/AIST # Copyright 2010-2020, Olivier Stasse, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS
#
ADD_DEFINITIONS(-DDEBUG=2)
# Add Boost path to include directories.
#INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
# Make Boost.Test generates the main function in test cases.
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN) ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
ADD_DEFINITIONS(-DTESTS_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data") ADD_DEFINITIONS(-DTESTS_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data")
ADD_DEFINITIONS(-DTESTS_PLUGINDIR="${LIBRARY_OUTPUT_PATH}") ADD_DEFINITIONS(-DTESTS_PLUGINDIR="${LIBRARY_OUTPUT_PATH}")
ADD_DEFINITIONS(-DTESTS_DYNLIBSUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}") ADD_DEFINITIONS(-DTESTS_DYNLIBSUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}")
# DYNAMIC_GRAPH_TEST(NAME)
# ------------------------
#
# Define a test named `NAME'.
#
# This macro will create a binary from `NAME.cpp', link it against
# Boost and add it to the test suite.
#
MACRO(DYNAMIC_GRAPH_TEST NAME) MACRO(DYNAMIC_GRAPH_TEST NAME)
ADD_EXECUTABLE(${NAME} ${NAME}.cpp) ADD_UNIT_TEST(${NAME} ${NAME}.cpp)
ADD_TEST(${NAME} ${RUNTIME_OUTPUT_DIRECTORY}/${NAME}) TARGET_LINK_LIBRARIES(${NAME} ${PROJECT_NAME} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(${NAME} ${PROJECT_NAME})
ADD_DEPENDENCIES(${NAME} ${PROJECT_NAME})
# Link against Boost.
TARGET_LINK_LIBRARIES(${NAME} ${Boost_LIBRARIES})
ENDMACRO(DYNAMIC_GRAPH_TEST) ENDMACRO(DYNAMIC_GRAPH_TEST)
# Signal cast test. # Signal cast test.
SET(signalcast_libs signal-cast-registerer-libA signal-cast-registerer-libB) SET(signalcast_libs signal-cast-registerer-libA signal-cast-registerer-libB)
FOREACH(lib ${signalcast_libs}) FOREACH(lib ${signalcast_libs})
ADD_LIBRARY(${lib} SHARED ${lib}.cpp) ADD_LIBRARY(${lib} SHARED ${lib})
TARGET_LINK_LIBRARIES(${lib} ${PROJECT_NAME}) TARGET_LINK_LIBRARIES(${lib} ${PROJECT_NAME})
ADD_DEPENDENCIES(${lib} ${PROJECT_NAME})
ENDFOREACH() ENDFOREACH()
DYNAMIC_GRAPH_TEST(signal-cast-registerer) DYNAMIC_GRAPH_TEST(signal-cast-registerer)
# Unit testing. # Unit testing.
......
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