From 513980d224bf53383fdd0e536371a0a5c098376b Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 13 Feb 2020 14:05:04 +0100 Subject: [PATCH] [CMake] put python header in include Otherwise, this header is installed if BUILD_PYTHON_INTERFACE, and not if INSTALL_PYTHON_INTERFACE_ONLY. But if we want to be able to have binary packages for: - the main curve package - its bindings for python 2 - its bindings for python 3 this header will be installed in the 2 last cases, which will conflict. In short: if we set INSTALL_PYTHON_INTERFACE_ONLY, there should be only stuff installed in PYTHON_SITELIB. --- include/curves/CMakeLists.txt | 1 + include/curves/python/CMakeLists.txt | 8 ++++++++ .../curves/python}/python_definitions.h | 0 python/curves/CMakeLists.txt | 9 --------- python/curves/python_variables.cpp | 2 +- python/curves/python_variables.h | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 include/curves/python/CMakeLists.txt rename {python/curves => include/curves/python}/python_definitions.h (100%) diff --git a/include/curves/CMakeLists.txt b/include/curves/CMakeLists.txt index ffdcfa4d..5e33097c 100644 --- a/include/curves/CMakeLists.txt +++ b/include/curves/CMakeLists.txt @@ -25,4 +25,5 @@ INSTALL(FILES ADD_SUBDIRECTORY(helpers) ADD_SUBDIRECTORY(optimization) +ADD_SUBDIRECTORY(python) ADD_SUBDIRECTORY(serialization) diff --git a/include/curves/python/CMakeLists.txt b/include/curves/python/CMakeLists.txt new file mode 100644 index 00000000..d298812b --- /dev/null +++ b/include/curves/python/CMakeLists.txt @@ -0,0 +1,8 @@ +SET(${PROJECT_NAME}_PYTHON_HEADERS + python_definitions.h + ) + +INSTALL(FILES + ${${PROJECT_NAME}_PYTHON_HEADERS} + DESTINATION include/${PROJECT_NAME}/python + ) diff --git a/python/curves/python_definitions.h b/include/curves/python/python_definitions.h similarity index 100% rename from python/curves/python_definitions.h rename to include/curves/python/python_definitions.h diff --git a/python/curves/CMakeLists.txt b/python/curves/CMakeLists.txt index 4e2a08ef..604c9731 100644 --- a/python/curves/CMakeLists.txt +++ b/python/curves/CMakeLists.txt @@ -8,15 +8,6 @@ SET(${PY_NAME}_BINDINGS_SOURCES namespace.h ) -SET(${PROJECT_NAME}_PYTHON_HEADERS - python_definitions.h - ) - -INSTALL(FILES - ${${PROJECT_NAME}_PYTHON_HEADERS} - DESTINATION include/${PROJECT_NAME}/python - ) - ADD_LIBRARY(${PY_NAME} SHARED ${${PY_NAME}_BINDINGS_SOURCES}) SET_TARGET_PROPERTIES(${PY_NAME} PROPERTIES PREFIX "") TARGET_COMPILE_OPTIONS(${PY_NAME} PRIVATE "-Wno-conversion") diff --git a/python/curves/python_variables.cpp b/python/curves/python_variables.cpp index 9c6bcbbd..88cebd2e 100644 --- a/python/curves/python_variables.cpp +++ b/python/curves/python_variables.cpp @@ -1,5 +1,5 @@ #include "python_variables.h" -#include "python_definitions.h" +#include "curves/python/python_definitions.h" #include diff --git a/python/curves/python_variables.h b/python/curves/python_variables.h index 132d9cdc..1e4cea81 100644 --- a/python/curves/python_variables.h +++ b/python/curves/python_variables.h @@ -10,7 +10,7 @@ #include "curves/piecewise_curve.h" #include "curves/so3_linear.h" #include "curves/se3_curve.h" -#include "python_definitions.h" +#include "curves/python/python_definitions.h" #include #include #include