Skip to content

Commit 71ff956

Browse files
[cmake] Add the possibility to install only the python binding.
This is not enough to reflect all the patches from robotpkg about conflict when installing separatly python and C++ code.
1 parent fddb954 commit 71ff956

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ SEARCH_FOR_EIGEN()
4848
ADD_REQUIRED_DEPENDENCY("dynamic-graph >= 3.0.0")
4949

5050
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
51+
OPTION (INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python binding" OFF)
52+
5153
IF(BUILD_PYTHON_INTERFACE)
5254
FINDPYTHON(2.7 EXACT REQUIRED)
5355
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})

include/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ SET(NEWHEADERS
8080
sot/core/variadic-op.hh
8181
sot/core/robot-utils.hh
8282
)
83-
INSTALL(FILES ${NEWHEADERS}
84-
DESTINATION include/sot/core
85-
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
86-
)
83+
IF (NOT INSTALL_PYTHON_INTERFACE_ONLY)
84+
INSTALL(FILES ${NEWHEADERS}
85+
DESTINATION include/sot/core
86+
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
87+
)
88+
ENDIF (NOT INSTALL_PYTHON_INTERFACE_ONLY)

src/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,10 @@ ENDIF(UNIX AND NOT APPLE)
170170

171171
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
172172

173-
INSTALL(TARGETS ${LIBRARY_NAME}
174-
DESTINATION ${CMAKE_INSTALL_LIBDIR})
173+
IF (NOT INSTALL_PYTHON_INTERFACE_ONLY)
174+
INSTALL(TARGETS ${LIBRARY_NAME}
175+
DESTINATION ${CMAKE_INSTALL_LIBDIR})
176+
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
175177

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

0 commit comments

Comments
 (0)