Commit 9a3d867b by pybind11_abseil authors Committed by Copybara-Service

Add CMake install for applicable libraries

Originally developed under https://github.com/pybind/pybind11_abseil/pull/8

PiperOrigin-RevId: 557837688
parent 87838338
......@@ -75,6 +75,10 @@ FetchContent_Declare {
FetchContent_MakeAvailable(pybind11 abseil-cpp pybind11_abseil)
```
To install the package so that it is accessible from system Python, run cmake
with the flag `-DCMAKE_INSTALL_PYDIR` set to a directory on your PYTHONPATH and
subsequently run `make install`.
## absl::Duration
`absl::Duration` objects are converted to/ from python datetime.timedelta objects.
......
......@@ -178,3 +178,14 @@ target_link_libraries(status_casters INTERFACE import_status_module
status_caster statusor_caster)
add_subdirectory(tests)
if(CMAKE_INSTALL_PYDIR)
install(
TARGETS status ok_status_singleton
EXPORT pybind11_abseilTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_PYDIR}/pybind11_abseil
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYDIR}/pybind11_abseil
RUNTIME DESTINATION ${CMAKE_INSTALL_PYDIR}/pybind11_abseil)
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment