Commit 316b1214 authored by olivier stasse's avatar olivier stasse
Browse files

Fix link problem with plugin sot-dynamic and portability issues.

Pb and solution pointed out and provided by F. Keith.
parent 16ca6f24
......@@ -14,6 +14,8 @@
# sot-hrp2. If not, see <http://www.gnu.org/licenses/>.
INCLUDE(../cmake/python.cmake)
FINDPYTHON()
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
FUNCTION(COMPILE_PLUGIN NAME SOURCES ENTITIES)
ADD_LIBRARY(${NAME} SHARED ${SOURCES})
......@@ -26,20 +28,21 @@ FUNCTION(COMPILE_PLUGIN NAME SOURCES ENTITIES)
PKG_CONFIG_USE_DEPENDENCY(${NAME} jrl-mal)
PKG_CONFIG_USE_DEPENDENCY(${NAME} sot-core)
PKG_CONFIG_USE_DEPENDENCY(${NAME} jrl-dynamics)
PKG_CONFIG_USE_DEPENDENCY(${NAME} sot-dynamic)
IF (WIN32)
TARGET_LINK_LIBRARIES(${NAME} ${CMAKE_INSTALL_PREFIX}/lib/plugin/dynamic${CMAKE_LINK_LIBRARY_SUFFIX})
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${NAME} ${CMAKE_INSTALL_PREFIX}/lib/plugin/dynamic${CMAKE_SHARED_LIBRARY_SUFFIX})
ENDIF(WIN32)
INSTALL(TARGETS ${NAME} DESTINATION lib/plugin)
# build python submodule
STRING(REPLACE - _ PYTHON_LIBRARY_NAME ${NAME})
ADD_DEPENDENCIES(${NAME} MKDIR_${PYTHON_LIBRARY_NAME})
ADD_CUSTOM_TARGET(MKDIR_${PYTHON_LIBRARY_NAME}
mkdir -p dynamic_graph/sot/hrp2/${PYTHON_LIBRARY_NAME}
)
SET(NEW_ENTITY_CLASS ${ENTITIES})
DYNAMIC_GRAPH_PYTHON_MODULE("sot/hrp2/${PYTHON_LIBRARY_NAME}"
${NAME}
sot/hrp2/${PYTHON_LIBRARY_NAME}/wrap
sot-hrp2-${PYTHON_LIBRARY_NAME}-wrap
)
ENDFUNCTION()
......@@ -48,6 +51,7 @@ COMPILE_PLUGIN(dynamic-hrp2_14 dynamic-hrp2_14.cc DynamicHrp2_14)
PKG_CONFIG_USE_DEPENDENCY(dynamic-hrp2_14 hrp2-dynamics)
COMPILE_PLUGIN(dynamic-hrp2_10 dynamic-hrp2_10.cc DynamicHrp2_10)
PKG_CONFIG_USE_DEPENDENCY(dynamic-hrp2_10 hrp2-10-optimized)
CONFIG_FILES(dynamic_graph/sot/hrp2_10/robot.py)
CONFIG_FILES(dynamic_graph/sot/hrp2_14/robot.py)
......@@ -97,14 +101,10 @@ MACRO(build_hrp2_controller robotnumber)
# build python submodule
STRING(REPLACE - _ PYTHON_LIBRARY_NAME ${CONTROLLER_NAME})
ADD_DEPENDENCIES(${CONTROLLER_NAME} MKDIR_${PYTHON_LIBRARY_NAME})
ADD_CUSTOM_TARGET(MKDIR_${PYTHON_LIBRARY_NAME}
mkdir -p dynamic_graph/sot/hrp2/${PYTHON_LIBRARY_NAME}
)
SET(NEW_ENTITY_CLASS ${ENTITIES})
DYNAMIC_GRAPH_PYTHON_MODULE("sot/hrp2/${PYTHON_LIBRARY_NAME}"
${CONTROLLER_NAME}
sot/hrp2/${PYTHON_LIBRARY_NAME}/wrap
sot-hrp2-${PYTHON_LIBRARY_NAME}-wrap
)
ENDMACRO()
......
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