Commit bdb99fc2 authored by Valenza Florian's avatar Valenza Florian
Browse files

[cmake][C++][bug fix] Moved initialization of static const variable gravity...

[cmake][C++][bug fix] Moved initialization of static const variable gravity 981 from model.hpp to model.cpp. libpinocchio.so is no more empty. Caution : Pinocchio is more a header-only library. One should alwais link against shared library
parent 9f19fd2f
......@@ -5,5 +5,6 @@
ADD_EXECUTABLE(timings timings.cpp)
PKG_CONFIG_USE_DEPENDENCY(timings eigen3)
PKG_CONFIG_USE_DEPENDENCY(timings urdfdom)
TARGET_LINK_LIBRARIES(timings ${PROJECT_NAME})
SET_TARGET_PROPERTIES (timings PROPERTIES COMPILE_DEFINITIONS PINOCCHIO_SOURCE_DIR="${${PROJECT_NAME}_SOURCE_DIR}")
......@@ -43,17 +43,24 @@ ENDMACRO(ADD_TARGET_CFLAGS)
# --- C++ --------------------------------------------
# ----------------------------------------------------
SET(${PROJECT_NAME}_MULTIBODY_SOURCES
multibody/model.cpp
)
SET(${PROJECT_NAME}_SOURCES
${${PROJECT_NAME}_MULTIBODY_SOURCES}
)
IF(LUA5_1_FOUND)
SET(${PROJECT_NAME}_MULTIBODY_PARSER_LUA_SOURCES
multibody/parser/lua/lua_tables.cpp
multibody/parser/lua.cpp
)
SET(BUILD_MAIN_LIBRARY True)
LIST(APPEND ${PROJECT_NAME}_SOURCES ${PROJECT_NAME}_MULTIBODY_PARSER_LUA_SOURCES)
ENDIF(LUA5_1_FOUND)
SET(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_MULTIBODY_PARSER_LUA_SOURCES})
IF (UNIX AND BUILD_MAIN_LIBRARY)
IF (UNIX)
# Create target libpinocchio.so
ADD_LIBRARY ( ${PROJECT_NAME} SHARED ${HEADERS} ${${PROJECT_NAME}_SOURCES} )
SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
......
#include "pinocchio/multibody/model.hpp"
namespace se3
{
const Eigen::Vector3d Model::gravity981 (0,0,-9.81);
}
......@@ -162,7 +162,7 @@ namespace se3
};
const Eigen::Vector3d Model::gravity981 (0,0,-9.81);
} // namespace se3
......
......@@ -27,7 +27,7 @@ MACRO(ADD_UNIT_TEST NAME PKGS)
FOREACH(PKG ${PKGS})
PKG_CONFIG_USE_DEPENDENCY(${NAME} ${PKG})
ENDFOREACH(PKG)
TARGET_LINK_LIBRARIES (${NAME} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES (${NAME} ${Boost_LIBRARIES} ${PROJECT_NAME})
ADD_TEST(NAME ${NAME} COMMAND ${NAME})
ADD_DEPENDENCIES(check ${NAME})
ENDMACRO(ADD_UNIT_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