Skip to content

Commit

Permalink
[cmake] Add the possibility to install only the python binding.
Browse files Browse the repository at this point in the history
This is not enough to reflect all the patches from robotpkg
about conflict when installing separatly python and C++ code.
  • Loading branch information
olivier-stasse committed Mar 20, 2019
1 parent fddb954 commit 71ff956
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ SEARCH_FOR_EIGEN()
ADD_REQUIRED_DEPENDENCY("dynamic-graph >= 3.0.0")

OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
OPTION (INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python binding" OFF)

IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON(2.7 EXACT REQUIRED)
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
Expand Down
10 changes: 6 additions & 4 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ SET(NEWHEADERS
sot/core/variadic-op.hh
sot/core/robot-utils.hh
)
INSTALL(FILES ${NEWHEADERS}
DESTINATION include/sot/core
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
)
IF (NOT INSTALL_PYTHON_INTERFACE_ONLY)
INSTALL(FILES ${NEWHEADERS}
DESTINATION include/sot/core
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
)
ENDIF (NOT INSTALL_PYTHON_INTERFACE_ONLY)
6 changes: 4 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ 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)

#Plugins compilation, link, and installation
#Compiles a plugin. The plugin library is ${LIBRARY_NAME}
Expand Down

0 comments on commit 71ff956

Please sign in to comment.