From 9119f1307256ac71b0b44f8c98280eb39ba8575f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trygve=20Laugst=C3=B8l?= Date: Mon, 1 Aug 2016 09:14:54 +0200 Subject: [PATCH] Improving support for installing pybind11. Mark the pybind11 headers as private to the target. Fixes #305 --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d2c991ab..47131e7f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,9 @@ set(PYTHON_MODULE_EXTENSION ${PYTHON_MODULE_EXTENSION} CACHE INTERNAL "") # function(pybind11_add_module target_name) add_library(${target_name} MODULE ${ARGN}) - target_include_directories(${target_name} PUBLIC ${PYBIND11_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS}) + target_include_directories(${target_name} + PRIVATE ${PYBIND11_INCLUDE_DIR} + PUBLIC ${PYTHON_INCLUDE_DIRS}) # The prefix and extension are provided by FindPythonLibsNew.cmake set_target_properties(${target_name} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")