From 3b5d342899613b8afd247eeb5a10d49d898d7a6c Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 29 Oct 2019 21:54:42 +0100 Subject: [PATCH] [CMake] add INSTALL_PYTHON_INTERFACE_ONLY option --- CMakeLists.txt | 5 +++-- src/CMakeLists.txt | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36a9bb6..653d5ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,9 +16,11 @@ INCLUDE(cmake/eigen.cmake) SET(CUSTOM_HEADER_DIR sot/tools) SET(${PROJECT_NAME}_HEADERS) - SET(DOXYGEN_USE_MATHJAX YES) +OPTION(BUILD_PYTHON_INTERFACE "Build the python bindings" ON) +OPTION(INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python binding" OFF) + CMAKE_POLICY(SET CMP0048 OLD) PROJECT(${PROJECT_NAME} CXX) @@ -31,7 +33,6 @@ ADD_REQUIRED_DEPENDENCY("sot-core >= 3.0") # Search for dependencies. SEARCH_FOR_EIGEN() -OPTION(BUILD_PYTHON_INTERFACE "Build the python bindings" ON) IF(BUILD_PYTHON_INTERFACE) FINDPYTHON () FIND_NUMPY () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 75ee868..f1178a2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,7 +26,9 @@ SET_TARGET_PROPERTIES(${LIBRARY_NAME} SOVERSION ${PROJECT_VERSION} INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) -INSTALL (TARGETS ${LIBRARY_NAME} DESTINATION lib) +IF(NOT INSTALL_PYTHON_INTERFACE_ONLY) + INSTALL (TARGETS ${LIBRARY_NAME} DESTINATION lib) +ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY) IF(BUILD_PYTHON_INTERFACE) DYNAMIC_GRAPH_PYTHON_MODULE ("sot/tools" ${LIBRARY_NAME} wrap)