forked from pybind/pybind11
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pybind#3 from dean0x7d/master
General improvements
- Loading branch information
Showing
12 changed files
with
126 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build/ | ||
dist/ | ||
*.so | ||
*.py[cod] | ||
*.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
project(pybind11_cmake_example) | ||
project(cmake_example) | ||
|
||
add_subdirectory(pybind11) | ||
|
||
pybind11_add_module(cmake_example src/main.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include README.md LICENSE | ||
global-include CMakeLists.txt *.cmake | ||
recursive-include src * | ||
recursive-include pybind11/include *.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# cmake_example for pybind11 | ||
|
||
[![Build Status](https://travis-ci.org/pybind/cmake_example.svg?branch=master)](https://travis-ci.org/pybind/cmake_example) | ||
[![Build status](https://ci.appveyor.com/api/projects/status/8gtjyogdmy9amqm1/branch/master?svg=true)](https://ci.appveyor.com/project/dean0x7d/cmake-example/branch/master) | ||
|
||
An example [pybind11](https://github.com/pybind/pybind11) module built with a | ||
CMake-based build system. This is useful for C++ codebases that have an existing | ||
CMake project structure. | ||
|
||
|
||
## Prerequisites | ||
|
||
**On Unix (Linux, OS X)** | ||
|
||
* A compiler with C++11 support | ||
* CMake >= 2.8.12 | ||
|
||
**On Windows** | ||
|
||
* Visual Studio 2015 (required for all Python versions, see notes below) | ||
* CMake >= 3.1 | ||
|
||
|
||
## Installation | ||
|
||
Just clone this repository and pip install. Note the `--recursive` option which is | ||
needed for the pybind11 submodule: | ||
|
||
```bash | ||
git clone --recursive https://github.com/pybind/cmake_example.git | ||
pip install ./cmake_example | ||
``` | ||
|
||
With the `setup.py` file included in this example, the `pip install` command will | ||
invoke CMake and build the pybind11 module as specified in `CMakeLists.txt`. | ||
|
||
|
||
## Special notes for Windows | ||
|
||
**Compiler requirements** | ||
|
||
Pybind11 requires a C++11 compliant compiler, i.e Visual Studio 2015 on Windows. | ||
This applies to all Python versions, including 2.7. Unlike regular C extension | ||
modules, it's perfectly fine to compile a pybind11 module with a VS version newer | ||
than the target Python's VS version. See the [FAQ] for more details. | ||
|
||
**Runtime requirements** | ||
|
||
The Visual C++ 2015 redistributable packages are a runtime requirement for this | ||
project. It can be found [here][vs2015_runtime]. If you use the Anaconda Python | ||
distribution, you can add `vs2015_runtime` as a platform-dependent runtime | ||
requirement for you package: see the `conda.recipe/meta.yaml` file in this example. | ||
|
||
|
||
## License | ||
|
||
Pybind11 is provided under a BSD-style license that can be found in the LICENSE | ||
file. By using, distributing, or contributing to this project, you agree to the | ||
terms and conditions of this license. | ||
|
||
|
||
## Test call | ||
|
||
```python | ||
import cmake_example | ||
cmake_example.add(1, 2) | ||
``` | ||
|
||
|
||
[FAQ]: http://pybind11.rtfd.io/en/latest/faq.html#working-with-ancient-visual-studio-2009-builds-on-windows | ||
[vs2015_runtime]: https://www.microsoft.com/en-us/download/details.aspx?id=48145 |
This file was deleted.
Oops, something went wrong.
Submodule pybind11
updated
25 files
+2 −4 | .appveyor.yml | |
+1 −1 | .gitignore | |
+6 −6 | .travis.yml | |
+2 −1 | CMakeLists.txt | |
+1 −1 | README.md | |
+28 −16 | docs/advanced.rst | |
+28 −5 | docs/basics.rst | |
+2 −1 | docs/changelog.rst | |
+7 −7 | docs/classes.rst | |
+3 −3 | docs/compiling.rst | |
+7 −14 | docs/faq.rst | |
+3 −0 | example/example11.cpp | |
+4 −1 | example/example11.py | |
+7 −0 | example/example11.ref | |
+1 −0 | example/example17.cpp | |
+9 −1 | example/example17.py | |
+1 −0 | example/example17.ref | |
+1 −1 | example/example2.cpp | |
+7 −0 | example/issues.cpp | |
+6 −5 | example/run_test.py | |
+26 −7 | include/pybind11/attr.h | |
+1 −1 | include/pybind11/descr.h | |
+1 −0 | include/pybind11/eigen.h | |
+29 −11 | include/pybind11/pybind11.h | |
+6 −3 | include/pybind11/stl_bind.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from cmake_example import add | ||
|
||
assert add(1, 2) == 3 |