@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15..3.29)
3
3
# Set a name and a version number for your project:
4
4
project (
5
5
pybind11-numpy-example
6
- VERSION 0.0.12
6
+ VERSION 0.0.13
7
7
LANGUAGES CXX)
8
8
9
9
# Initialize some default paths
@@ -16,10 +16,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
16
16
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
17
17
18
18
# Configuration options
19
- option (BUILD_PYTHON "Enable building of Python bindings" ON )
19
+ option (BUILD_CPP "Enable building of C++ interface" ON )
20
+ option (BUILD_PYTHON "Enable building of Python interface" ON )
20
21
option (BUILD_DOCS "Enable building of documentation" ON )
21
22
22
- # Build the c++ library
23
+ # Build the core c++ library
23
24
add_subdirectory (lib)
24
25
25
26
# Build the c++ tests
@@ -35,31 +36,34 @@ if(BUILD_DOCS)
35
36
add_subdirectory (doc )
36
37
endif ()
37
38
38
- # Build the python bindings
39
+ # Build the python interface
39
40
if (BUILD_PYTHON)
40
41
add_subdirectory (src)
41
42
endif ()
42
43
43
- # Add an alias target for use if this project is included as a subproject in
44
- # another project
45
- add_library (pybind11_numpy_example::pybind11_numpy_example ALIAS
46
- pybind11_numpy_example)
44
+ # Install c++ interface
45
+ if (BUILD_CPP)
46
+ # Add an alias target for use if this project is included as a subproject in
47
+ # another project
48
+ add_library (pybind11_numpy_example::pybind11_numpy_example ALIAS
49
+ pybind11_numpy_example)
47
50
48
- # Install targets and configuration
49
- install (
50
- TARGETS pybind11_numpy_example
51
- EXPORT pybind11_numpy_example_config
52
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
53
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
54
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
51
+ # Install targets and configuration
52
+ install (
53
+ TARGETS pybind11_numpy_example
54
+ EXPORT pybind11_numpy_example_config
55
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
56
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
57
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
55
58
56
- install (
57
- EXPORT pybind11_numpy_example_config
58
- NAMESPACE pybind11_numpy_example::
59
- DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/pybind11_numpy_example)
59
+ install (
60
+ EXPORT pybind11_numpy_example_config
61
+ NAMESPACE pybind11_numpy_example::
62
+ DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/pybind11_numpy_example)
60
63
61
- install (DIRECTORY ${CMAKE_CURRENT_LIST_DIR} /include /
62
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
64
+ install (DIRECTORY ${CMAKE_CURRENT_LIST_DIR} /include /
65
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
66
+ endif ()
63
67
64
68
# This prints a summary of found dependencies
65
69
include (FeatureSummary)
0 commit comments