Commit 34e77e59 authored by Pierre Gergondet's avatar Pierre Gergondet
Browse files

* Move dynamicsJRLJapan to jrl-dynamics and hrp2Dynamics to hrp2-dynamics when needed

* Use PKG_CONFIG_USE_DEPENDENCY for jrl-dynamics and hrp2-dynamics
* Fix other minor dependency issues
parent 1ff8fff4
......@@ -40,7 +40,7 @@ SETUP_PROJECT()
# Search for dependencies.
ADD_REQUIRED_DEPENDENCY("jrl-mal >= 1.8.0")
ADD_REQUIRED_DEPENDENCY("dynamicsJRLJapan >= 1.16.1")
ADD_REQUIRED_DEPENDENCY("jrl-dynamics >= 1.16.1")
ADD_REQUIRED_DEPENDENCY("hrp2-dynamics >= 1.3.0")
ADD_REQUIRED_DEPENDENCY("hrp2-10-optimized >= 1.0")
......@@ -51,29 +51,6 @@ ADD_REQUIRED_DEPENDENCY("dynamic-graph >= 1.0.0")
ADD_REQUIRED_DEPENDENCY("sot-core >= 1.0.0")
SET(libs
zmpreffromcom
force-compensation
integrator-force-exact
mass-apparent
integrator-force-rk4
integrator-force
angle-estimator
waist-attitude-from-sensor
)
# hrp2-14 dependencies.
LIST(APPEND libs dynamic)
LIST(APPEND libs dynamic-hrp2)
SET (dynamic-hrp2_plugins_dependencies dynamic)
# hrp2-10 dependencies.
LIST(APPEND libs dynamic-hrp2_10)
SET (dynamic-hrp2_10_plugins_dependencies dynamic)
LIST(APPEND libs dynamic-hrp2_10_old)
SET (dynamic-hrp2_10_plugins_dependencies dynamic)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(unitTesting)
......
......@@ -20,21 +20,18 @@ IF(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
ENDIF(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
# provide path to libraries
LINK_DIRECTORIES(${DYNAMICSJRLJAPAN_LIBRARY_DIRS})
LINK_DIRECTORIES(${HRP2_DYNAMICS_LIBRARY_DIRS})
LINK_DIRECTORIES(${DYNAMIC_GRAPH_LIBRARY_DIRS})
LINK_DIRECTORIES(${SOT_CORE_LIBRARY_DIRS})
LINK_DIRECTORIES(${JRL_MAL_LIBRARY_DIRS})
# Add compilation flags
ADD_DEFINITIONS(${DYNAMICSJRLJAPAN_CFLAGS})
ADD_DEFINITIONS(${HRP2_DYNAMICS_CFLAGS})
ADD_DEFINITIONS(${DYNAMIC_GRAPH_CFLAGS})
ADD_DEFINITIONS(${SOT_CORE_CFLAGS})
ADD_DEFINITIONS(${JRL_MAL_CFLAGS})
foreach(dlink ${DYNAMICSJRLJAPAN_LDFLAGS}
${HRP2_DYNAMICS_LDFLAGS}
foreach(dlink ${HRP2_DYNAMICS_LDFLAGS}
${DYNAMIC_GRAPH_LDFLAGS}
${SOT_CORE_LDFLAGS}
${JRL_MAL_LDFLAGS}
......@@ -53,26 +50,24 @@ SET(libs
waist-attitude-from-sensor
)
IF(${DYNAMICSJRLJAPAN_FOUND})
LIST(APPEND libs dynamic)
IF(${HRP2_DYNAMICS_FOUND})
LIST(APPEND libs dynamic-hrp2)
SET (dynamic-hrp2_plugins_dependencies dynamic)
ENDIF(${HRP2_DYNAMICS_FOUND})
ENDIF(${DYNAMICSJRLJAPAN_FOUND})
# hrp2-14 dependencies.
LIST(APPEND libs dynamic)
LIST(APPEND libs dynamic-hrp2)
SET (dynamic-hrp2_plugins_dependencies dynamic)
IF(${_hrp210optimized_FOUND})
LIST(APPEND libs dynamic-hrp2_10)
SET (dynamic-hrp2_10_additional_libs ${_hrp210optimized_LIBRARIES})
SET (dynamic-hrp2_10_plugins_dependencies dynamic)
SET(dynamic-hrp2_10_plugins_compile_flags
${_dynamicsJRLJapan_CFLAGS} ${_hrp210optimized_CFLAGS})
${_hrp210optimized_CFLAGS})
LIST(APPEND libs dynamic-hrp2_10_old)
SET (dynamic-hrp2_10_old_additional_libs ${_hrp210optimized_LIBRARIES})
SET (dynamic-hrp2_10_old_plugins_dependencies dynamic)
SET (dynamic-hrp2_10_plugins_dependencies dynamic)
SET(dynamic-hrp2_10_old_plugins_compile_flags
${_dynamicsJRLJapan_CFLAGS} ${_hrp210optimized_CFLAGS})
${_hrp210optimized_CFLAGS})
ENDIF(${_hrp210optimized_FOUND})
......@@ -105,7 +100,6 @@ FOREACH(lib ${libs})
TARGET_LINK_LIBRARIES(${lib} ${SOT_CORE_LIBRARIES})
TARGET_LINK_LIBRARIES(${lib} ${JRL_MAL_LIBRARIES})
TARGET_LINK_LIBRARIES(${lib} ${HRP2_DYNAMICS_LIBRARIES})
TARGET_LINK_LIBRARIES(${lib} ${DYNAMICSJRLJAPAN_LIBRARIES})
TARGET_LINK_LIBRARIES(${lib} "${${lib}_additional_libs}")
ENDIF(UNIX)
......@@ -123,6 +117,8 @@ FOREACH(lib ${libs})
TARGET_LINK_LIBRARIES(${lib} "${${lib}_plugins_dependencies}")
ENDIF(${lib}_plugins_dependencies)
PKG_CONFIG_USE_DEPENDENCY(${lib} jrl-dynamics)
INSTALL(TARGETS ${lib}
DESTINATION lib/plugin)
ENDFOREACH(lib)
......@@ -29,8 +29,8 @@ LINK_DIRECTORIES(${${PROJECT_NAME}_BINARY_DIR}/src)
ADD_DEFINITIONS(${JRL_MAL_CFLAGS})
IF(WIN32)
foreach(dlink ${JRL_MAL_LDFLAGS} ${DYNAMICSJRLJAPAN_LDFLAGS}
${HRP2DYNAMICS_LDFLAGS} ${DYNAMIC_GRAPH_LDFLAGS} ${SOT_CORE_LDFLAGS})
foreach(dlink ${JRL_MAL_LDFLAGS}
${DYNAMIC_GRAPH_LDFLAGS} ${SOT_CORE_LDFLAGS})
SET ( ${PROJECT_NAME}_src_LDFLAGS "${${PROJECT_NAME}_src_LDFLAGS} ${dlink}")
endforeach(dlink)
ENDIF(WIN32)
......@@ -38,9 +38,11 @@ ENDIF(WIN32)
SET(tests
dummy
test_djj
test_dyn
test_dyn
test_results)
SET(test_dyn_plugins_dependencies dynamic)
FOREACH(test ${tests})
SET(EXECUTABLE_NAME "${test}_exe")
ADD_EXECUTABLE(${EXECUTABLE_NAME}
......@@ -61,23 +63,23 @@ FOREACH(test ${tests})
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${DYNAMIC_GRAPH_LIBRARIES})
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${SOT_CORE_LIBRARIES})
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${JRL_MAL_LIBRARIES})
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${HRP2DYNAMICS_LIBRARIES})
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${DYNAMICSJRLJAPAN_LIBRARIES})
ENDIF(UNIX)
IF(${DYNAMICSJRLJAPAN_FOUND})
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} dynamic)
IF(${_hrp2Dynamics_FOUND})
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} dynamic-hrp2)
ENDIF(${_hrp2Dynamics_FOUND})
ENDIF(${DYNAMICSJRLJAPAN_FOUND})
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} jrl-dynamics)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} hrp2-dynamics)
IF(WIN32)
SET_TARGET_PROPERTIES(${EXECUTABLE_NAME}
PROPERTIES
LINK_FLAGS "${${PROJECT_NAME}_src_LDFLAGS}"
)
ENDIF(WIN32)
ENDIF(WIN32)
IF(${test}_plugins_dependencies)
ADD_DEPENDENCIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}")
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}")
ENDIF(${test}_plugins_dependencies)
ADD_TEST(${test} ${EXECUTABLE_NAME})
ENDFOREACH(test)
Supports Markdown
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