From 71ff956c52e1753f2ca5505276221c29dcc260e9 Mon Sep 17 00:00:00 2001 From: Olivier Stasse Date: Wed, 20 Mar 2019 07:42:07 +0200 Subject: [PATCH] [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. --- CMakeLists.txt | 2 ++ include/CMakeLists.txt | 10 ++++++---- src/CMakeLists.txt | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef46f3b54..f9842049e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 4d1c952d7..22ca1c26e 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a69f65e2f..6a22bbd4e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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}