pybind11/tests/test_cmake_build
Dean Moldovan 443ab5946b Replace PYBIND11_PLUGIN with PYBIND11_MODULE
This commit also adds `doc()` to `object_api` as a shortcut for the
`attr("__doc__")` accessor.

The module macro changes from:
```c++
PYBIND11_PLUGIN(example) {
    pybind11::module m("example", "pybind11 example plugin");
    m.def("add", [](int a, int b) { return a + b; });
    return m.ptr();
}
```

to:

```c++
PYBIND11_MODULE(example, m) {
    m.doc() = "pybind11 example plugin";
    m.def("add", [](int a, int b) { return a + b; });
}
```

Using the old macro results in a deprecation warning. The warning
actually points to the `pybind11_init` function (since attributes
don't bind to macros), but the message should be quite clear:
"PYBIND11_PLUGIN is deprecated, use PYBIND11_MODULE".
2017-05-29 03:21:19 +02:00
..
installed_embed Add CMake target for embedding the Python interpreter 2017-05-28 02:12:24 +02:00
installed_function Add new options and docs for pybind11_add_module 2016-12-19 16:34:48 +01:00
installed_target Test with debug build of Python when DEBUG=1 on Travis 2017-02-28 00:27:26 +01:00
subdirectory_embed Add CMake target for embedding the Python interpreter 2017-05-28 02:12:24 +02:00
subdirectory_function Add new options and docs for pybind11_add_module 2016-12-19 16:34:48 +01:00
subdirectory_target Rename target from pybind11::pybind11 to pybind11::module 2016-12-19 16:34:48 +01:00
embed.cpp Add C++ interface for the Python interpreter 2017-05-28 02:12:24 +02:00
main.cpp Replace PYBIND11_PLUGIN with PYBIND11_MODULE 2017-05-29 03:21:19 +02:00
test.py Make sure add_subdirectory and find_package behave identically 2016-12-19 16:34:48 +01:00