From dac3858e7db9d7c3b8dbe471ee545e7bd80b0955 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Thu, 29 Sep 2016 21:30:00 +0200 Subject: [PATCH] Make header files viewable in IDEs (fixes #424) --- CMakeLists.txt | 39 +++++++++++++++++++++------------------ tests/CMakeLists.txt | 4 +++- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6124cf052..48d3cc7e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,28 +153,31 @@ function(pybind11_enable_warnings target_name) endif() endfunction() +set(PYBIND11_HEADERS + include/pybind11/attr.h + include/pybind11/cast.h + include/pybind11/chrono.h + include/pybind11/common.h + include/pybind11/complex.h + include/pybind11/descr.h + include/pybind11/eigen.h + include/pybind11/eval.h + include/pybind11/functional.h + include/pybind11/numpy.h + include/pybind11/operators.h + include/pybind11/pybind11.h + include/pybind11/pytypes.h + include/pybind11/stl.h + include/pybind11/stl_bind.h + include/pybind11/typeid.h +) +string(REPLACE "include/" "${CMAKE_CURRENT_SOURCE_DIR}/include/" + PYBIND11_HEADERS "${PYBIND11_HEADERS}") + if (PYBIND11_TEST) add_subdirectory(tests) endif() if (PYBIND11_INSTALL) - set(PYBIND11_HEADERS - include/pybind11/attr.h - include/pybind11/cast.h - include/pybind11/chrono.h - include/pybind11/common.h - include/pybind11/complex.h - include/pybind11/descr.h - include/pybind11/eigen.h - include/pybind11/functional.h - include/pybind11/numpy.h - include/pybind11/operators.h - include/pybind11/pybind11.h - include/pybind11/pytypes.h - include/pybind11/stl.h - include/pybind11/stl_bind.h - include/pybind11/typeid.h - ) - install(FILES ${PYBIND11_HEADERS} DESTINATION include/pybind11) endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b0f243715..7193b9e75 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -54,7 +54,9 @@ if(PYBIND11_TEST_FILES_EIGEN_I GREATER -1) endif() # Create the binding library -pybind11_add_module(pybind11_tests pybind11_tests.cpp ${PYBIND11_TEST_FILES}) +pybind11_add_module(pybind11_tests pybind11_tests.cpp + ${PYBIND11_TEST_FILES} ${PYBIND11_HEADERS}) + pybind11_enable_warnings(pybind11_tests) if(EIGEN3_FOUND)