Commit 078bc3bf authored by Olivier Stasse's avatar Olivier Stasse

[cmake] Add INSTALL_PYTHON_INTERFACE_ONLY

parent 71f0168e
......@@ -58,6 +58,7 @@ SET(BOOST_COMPONENTS thread filesystem program_options unit_test_framework syste
OPTION (BUILD_ROS_PACKAGES "Build ros packages" ON)
OPTION (BUILD_PYTHON_INTERFACE "Build the python bindings" ON)
OPTION (INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python binding" OFF)
OPTION (BUILD_TEST "Build tests" ON)
# name of the python module
......@@ -142,7 +143,9 @@ ENDIF(UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
IF (NOT INSTALL_PYTHON_INTERFACE_ONLY)
INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
IF(BUILD_PYTHON_INTERFACE)
INSTALL(FILES python/${SOTTALOSBALANCE_PYNAME}/__init__.py
......@@ -241,8 +244,10 @@ MACRO(DYNAMIC_GRAPH_CUSTOM_PYTHON_MODULE MODULENAME SUBMODULENAME LIBRARYNAME TA
)
CMAKE_POLICY(POP)
TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${PUBLIC_KEYWORD} "-Wl,--no-as-needed")
TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${PUBLIC_KEYWORD} ${LIBRARYNAME} ${PYTHON_LIBRARY})
TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${PUBLIC_KEYWORD}
"-Wl,--no-as-needed")
TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${PUBLIC_KEYWORD}
${LIBRARYNAME} ${PYTHON_LIBRARY})
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
......@@ -278,7 +283,8 @@ MACRO(DYNAMIC_GRAPH_CUSTOM_PYTHON_MODULE MODULENAME SUBMODULENAME LIBRARYNAME TA
ENDMACRO(DYNAMIC_GRAPH_CUSTOM_PYTHON_MODULE)
MACRO(SOT_TALOS_BALANCE_PYTHON_MODULE SUBMODULENAME LIBRARYNAME TARGETNAME)
DYNAMIC_GRAPH_CUSTOM_PYTHON_MODULE("${SOTTALOSBALANCE_PYNAME}" "${SUBMODULENAME}" "${LIBRARYNAME}" "${TARGETNAME}")
DYNAMIC_GRAPH_CUSTOM_PYTHON_MODULE
("${SOTTALOSBALANCE_PYNAME}" "${SUBMODULENAME}" "${LIBRARYNAME}" "${TARGETNAME}")
ENDMACRO(SOT_TALOS_BALANCE_PYTHON_MODULE)
ADD_SUBDIRECTORY(src)
......
......@@ -91,7 +91,7 @@ FOREACH(plugin ${plugins})
ADD_DEPENDENCIES(${LIBRARY_NAME} ${SOTTALOSBALANCE_LIB_NAME})
IF(ADDITIONAL_${LIBRARY_NAME}_LIBS)
ADD_DEPENDENCIES(${LIBRARY_NAME} ${ADDITIONAL_${LIBRARY_NAME}_LIBS})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${ADDITIONAL_${LIBRARY_NAME}_LIBS})
......@@ -121,8 +121,10 @@ FOREACH(plugin ${plugins})
)
ENDIF(BUILD_PYTHON_INTERFACE)
# Install plugins
INSTALL(TARGETS ${LIBRARY_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/plugin)
IF (NOT INSTALL_PYTHON_INTERFACE_ONLY)
INSTALL(TARGETS ${LIBRARY_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/plugin)
ENDIF (NOT INSTALL_PYTHON_INTERFACE_ONLY)
ENDFOREACH(plugin)
# Bindings Python
......
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