Commit 950cdc75 authored by jcarpent's avatar jcarpent Committed by Florian Valenza
Browse files

[Fix bug][Python] Define flag in order to control Lua inclusion

parent 57c3d9a0
......@@ -18,6 +18,11 @@ MACRO(ADD_SOURCE_GROUP FILENAMES)
ADD_GROUP("Source Files" ${FILENAMES})
ENDMACRO(ADD_SOURCE_GROUP FILENAMES)
MACRO(ADD_TARGET_CFLAGS target flag)
GET_TARGET_PROPERTY(${target}_CFLAGS ${target} COMPILE_FLAGS)
SET_PROPERTY(TARGET ${target} PROPERTY COMPILE_FLAGS "${${target}_CFLAGS} ${flag}")
ENDMACRO(ADD_TARGET_CFLAGS)
# ----------------------------------------------------
# --- C++ --------------------------------------------
# ----------------------------------------------------
......@@ -70,6 +75,9 @@ IF(EIGENPY_FOUND)
TARGET_LINK_LIBRARIES(${PYWRAP} ${Boost_LIBRARIES} ${PROJECT_NAME})
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/python/${PROJECT_NAME}")
IF(LUA5_1_FOUND)
ADD_TARGET_CFLAGS (${PYWRAP} "-DWITH_LUA")
ENDIF(LUA5_1_FOUND)
INSTALL(FILES
"${CMAKE_BINARY_DIR}/lib/python/${PROJECT_NAME}/lib${PYWRAP}.so"
DESTINATION ${PYTHON_SITELIB}/${PROJECT_NAME})
......
......@@ -8,7 +8,10 @@
#include "pinocchio/python/data.hpp"
#include "pinocchio/multibody/parser/urdf.hpp"
#include "pinocchio/multibody/parser/lua.hpp"
#ifdef WITH_LUA
#include "pinocchio/multibody/parser/lua.hpp"
#endif // #ifdef WITH_LUA
namespace se3
{
......@@ -24,6 +27,7 @@ namespace se3
return ModelHandler(model,true);
}
#ifdef WITH_LUA
static ModelHandler buildModelFromLua(const std::string & filename,
bool ff,
bool verbose
......@@ -33,6 +37,7 @@ namespace se3
*model = se3::lua::buildModel (filename, ff, verbose);
return ModelHandler (model,true);
}
#endif // #ifdef WITH_LUA
/* --- Expose --------------------------------------------------------- */
static void expose()
......@@ -43,17 +48,19 @@ namespace se3
"Parse the urdf file given in input and return a proper pinocchio model "
"(remember to create the corresponding data structure).");
#ifdef WITH_LUA
bp::def("buildModelFromLua",buildModelFromLua,
bp::args("Filename (string)",
"Free flyer (bool, false for a fixed robot)",
"Verbose option "),
"Parse the urdf file given in input and return a proper pinocchio model "
"(remember to create the corresponding data structure).");
#endif // #ifdef WITH_LUA
}
};
}} // namespace se3::python
#endif // ifndef __se3_python_data_hpp__
#endif // ifndef __se3_python_parsers_hpp__
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