Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake support #7

Closed
wants to merge 24 commits into from
Closed

Conversation

david-crouse
Copy link

@david-crouse david-crouse commented Aug 8, 2023

Add Cmake support. Tried to match the object names and dependencies of Bazel as much as possible.

To use:

Ensure CMake 3.11 or later is installed
Navigate to top-level directory
mkdir build; cd build; cmake ../; make; make test

This will build (and download all dependencies) and run all tests.

david-crouse and others added 8 commits August 8, 2023 16:48
* Test include file exporting

* Fix target_include_directories

* Move to canonical include_dirs. Trying w/o install since no install command is present

* Move include dir one level up

* Add var to get include dir right

* All exported targets now have include_dirs set
copybara-service bot pushed a commit that referenced this pull request Aug 11, 2023
Observed while locally testing #7:

```
In file included from /usr/local/google/home/rwgk/forked/pybind11_abseil/pybind11_abseil/tests/absl_example.cc:23:
/usr/local/google/home/rwgk/forked/pybind11_abseil/pybind11_abseil/absl_casters.h: In member function ‘bool pybind11::detail::type_caster<absl::lts_20211102::Duration>::load(pybind11::handle, bool)’:
/usr/local/google/home/rwgk/forked/pybind11_abseil/pybind11_abseil/absl_casters.h:194:48: warning: ‘bool pybind11::handle::operator==(const pybind11::handle&) const’ is deprecated: Use obj1.is(obj2) instead [-Wdeprecated-declarations]
  194 |     if (src == object(py_duration_t.attr("max"))) {
      |                                                ^
In file included from /usr/local/google/home/rwgk/forked/pybind11_abseil/tmp_build/_deps/pybind11-src/include/pybind11/detail/type_caster_base.h:12,
                 from /usr/local/google/home/rwgk/forked/pybind11_abseil/tmp_build/_deps/pybind11-src/include/pybind11/cast.h:15,
                 from /usr/local/google/home/rwgk/forked/pybind11_abseil/tmp_build/_deps/pybind11-src/include/pybind11/attr.h:14,
                 from /usr/local/google/home/rwgk/forked/pybind11_abseil/tmp_build/_deps/pybind11-src/include/pybind11/detail/class.h:1,
                 from /usr/local/google/home/rwgk/forked/pybind11_abseil/tmp_build/_deps/pybind11-src/include/pybind11/pybind11.h:13,
                 from /usr/local/google/home/rwgk/forked/pybind11_abseil/tmp_build/_deps/pybind11-src/include/pybind11/complex.h:12,
                 from /usr/local/google/home/rwgk/forked/pybind11_abseil/pybind11_abseil/tests/absl_example.cc:6:
/usr/local/google/home/rwgk/forked/pybind11_abseil/tmp_build/_deps/pybind11-src/include/pybind11/pytypes.h:290:10: note: declared here
  290 |     bool operator==(const handle &h) const { return m_ptr == h.m_ptr; }
      |          ^~~~~~~~
```

PiperOrigin-RevId: 555974032
copybara-service bot pushed a commit to pybind/pybind11_protobuf that referenced this pull request Aug 11, 2023
…e-commit-config.yaml

This is to help with whitespace cleanup in the cmake files currently under development under pybind/pybind11_abseil#7

PiperOrigin-RevId: 556012790
copybara-service bot pushed a commit to pybind/pybind11_protobuf that referenced this pull request Aug 11, 2023
…e-commit-config.yaml

This is to help with whitespace cleanup in the cmake files currently under development under pybind/pybind11_abseil#7

PiperOrigin-RevId: 556012790
copybara-service bot pushed a commit to pybind/pybind11_protobuf that referenced this pull request Aug 11, 2023
…e-commit-config.yaml

This is to help with whitespace cleanup in the cmake files currently under development under pybind/pybind11_abseil#7

PiperOrigin-RevId: 556026304
copybara-service bot pushed a commit that referenced this pull request Aug 11, 2023
…e-commit-config.yaml

This is to help with whitespace cleanup in the cmake files currently under development under #7

PiperOrigin-RevId: 556026304
@david-crouse david-crouse marked this pull request as ready for review August 11, 2023 21:54
@david-crouse david-crouse marked this pull request as draft August 11, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant