Skip to content

Commit 587cf82

Browse files
committed
Move internal headers into detail subdirectory
1 parent 97aa54f commit 587cf82

File tree

12 files changed

+23
-24
lines changed

12 files changed

+23
-24
lines changed

CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ set(PYTHON_MODULE_EXTENSION ${PYTHON_MODULE_EXTENSION} CACHE INTERNAL "")
3636

3737
# NB: when adding a header don't forget to also add it to setup.py
3838
set(PYBIND11_HEADERS
39+
include/pybind11/detail/class.h
40+
include/pybind11/detail/common.h
41+
include/pybind11/detail/descr.h
42+
include/pybind11/detail/typeid.h
3943
include/pybind11/attr.h
4044
include/pybind11/buffer_info.h
4145
include/pybind11/cast.h
4246
include/pybind11/chrono.h
43-
include/pybind11/class_support.h
44-
include/pybind11/common.h
4547
include/pybind11/complex.h
46-
include/pybind11/descr.h
4748
include/pybind11/options.h
4849
include/pybind11/eigen.h
4950
include/pybind11/embed.h
@@ -55,7 +56,6 @@ set(PYBIND11_HEADERS
5556
include/pybind11/pytypes.h
5657
include/pybind11/stl.h
5758
include/pybind11/stl_bind.h
58-
include/pybind11/typeid.h
5959
)
6060
string(REPLACE "include/" "${CMAKE_CURRENT_SOURCE_DIR}/include/"
6161
PYBIND11_HEADERS "${PYBIND11_HEADERS}")
@@ -68,7 +68,7 @@ include(GNUInstallDirs)
6868
include(CMakePackageConfigHelpers)
6969

7070
# extract project version from source
71-
file(STRINGS "${PYBIND11_INCLUDE_DIR}/pybind11/common.h" pybind11_version_defines
71+
file(STRINGS "${PYBIND11_INCLUDE_DIR}/pybind11/detail/common.h" pybind11_version_defines
7272
REGEX "#define PYBIND11_VERSION_(MAJOR|MINOR|PATCH) ")
7373
foreach(ver ${pybind11_version_defines})
7474
if (ver MATCHES "#define PYBIND11_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$")
@@ -110,8 +110,7 @@ if(NOT (CMAKE_VERSION VERSION_LESS 3.0)) # CMake >= 3.0
110110
endif()
111111

112112
if (PYBIND11_INSTALL)
113-
install(FILES ${PYBIND11_HEADERS}
114-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pybind11)
113+
install(DIRECTORY ${PYBIND11_INCLUDE_DIR}/pybind11 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
115114
# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share".
116115
set(PYBIND11_CMAKECONFIG_INSTALL_DIR "share/cmake/${PROJECT_NAME}" CACHE STRING "install path for pybind11Config.cmake")
117116

include/pybind11/buffer_info.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#pragma once
1111

12-
#include "common.h"
12+
#include "detail/common.h"
1313

1414
NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
1515

include/pybind11/cast.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#pragma once
1212

1313
#include "pytypes.h"
14-
#include "typeid.h"
15-
#include "descr.h"
14+
#include "detail/typeid.h"
15+
#include "detail/descr.h"
1616
#include <array>
1717
#include <limits>
1818
#include <tuple>

include/pybind11/class_support.h renamed to include/pybind11/detail/class.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
pybind11/class_support.h: Python C API implementation details for py::class_
2+
pybind11/detail/class.h: Python C API implementation details for py::class_
33
44
Copyright (c) 2017 Wenzel Jakob <[email protected]>
55
@@ -9,7 +9,7 @@
99

1010
#pragma once
1111

12-
#include "attr.h"
12+
#include "../attr.h"
1313

1414
NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
1515
NAMESPACE_BEGIN(detail)

include/pybind11/common.h renamed to include/pybind11/detail/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
pybind11/common.h -- Basic macros
2+
pybind11/detail/common.h -- Basic macros
33
44
Copyright (c) 2016 Wenzel Jakob <[email protected]>
55

include/pybind11/descr.h renamed to include/pybind11/detail/descr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
pybind11/descr.h: Helper type for concatenating type signatures
2+
pybind11/detail/descr.h: Helper type for concatenating type signatures
33
either at runtime (C++11) or compile time (C++14)
44
55
Copyright (c) 2016 Wenzel Jakob <[email protected]>

include/pybind11/typeid.h renamed to include/pybind11/detail/typeid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
pybind11/typeid.h: Compiler-independent access to type identifiers
2+
pybind11/detail/typeid.h: Compiler-independent access to type identifiers
33
44
Copyright (c) 2016 Wenzel Jakob <[email protected]>
55

include/pybind11/options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#pragma once
1111

12-
#include "common.h"
12+
#include "detail/common.h"
1313

1414
NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
1515

include/pybind11/pybind11.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
#include "attr.h"
4444
#include "options.h"
45-
#include "class_support.h"
45+
#include "detail/class.h"
4646

4747
NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
4848

include/pybind11/pytypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
pybind11/typeid.h: Convenience wrapper classes for basic Python types
2+
pybind11/pytypes.h: Convenience wrapper classes for basic Python types
33
44
Copyright (c) 2016 Wenzel Jakob <[email protected]>
55
@@ -9,7 +9,7 @@
99

1010
#pragma once
1111

12-
#include "common.h"
12+
#include "detail/common.h"
1313
#include "buffer_info.h"
1414
#include <utility>
1515
#include <type_traits>

include/pybind11/stl_bind.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#pragma once
1111

12-
#include "common.h"
12+
#include "detail/common.h"
1313
#include "operators.h"
1414

1515
#include <algorithm>

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
headers = []
1313
else:
1414
headers = [
15+
'include/pybind11/detail/class.h',
16+
'include/pybind11/detail/common.h',
17+
'include/pybind11/detail/descr.h',
18+
'include/pybind11/detail/typeid.h'
1519
'include/pybind11/attr.h',
1620
'include/pybind11/buffer_info.h',
1721
'include/pybind11/cast.h',
1822
'include/pybind11/chrono.h',
19-
'include/pybind11/class_support.h',
20-
'include/pybind11/common.h',
2123
'include/pybind11/complex.h',
22-
'include/pybind11/descr.h',
2324
'include/pybind11/eigen.h',
2425
'include/pybind11/embed.h',
2526
'include/pybind11/eval.h',
@@ -31,7 +32,6 @@
3132
'include/pybind11/pytypes.h',
3233
'include/pybind11/stl.h',
3334
'include/pybind11/stl_bind.h',
34-
'include/pybind11/typeid.h'
3535
]
3636

3737
setup(

0 commit comments

Comments
 (0)