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

Expose CMake binaries #14

Merged
merged 4 commits into from
May 28, 2021
Merged

Expose CMake binaries #14

merged 4 commits into from
May 28, 2021

Conversation

diegoferigo
Copy link
Owner

@diegoferigo diegoferigo commented May 27, 2021

Fixes #13

This PR introduces a new expose_binaries option that allows specifying a relative path to binaries built with CMake to expose to the Python environment. It is implemented with a generic __main__.py magic file that calls the C++ executable.

Projects that want to expose a binary just need to:

  1. Use the new option as expose_binaries=["bin/<executable_name>"]
  2. Create a new entrypoint:
    [options.entry_points]
    console_scripts =
        executable_name = package_name.bin.__main__:main

Check the SWIG example for a MWE.

@diegoferigo diegoferigo self-assigned this May 27, 2021
@diegoferigo diegoferigo force-pushed the feature/expose_binaries branch 9 times, most recently from 723d528 to 995bcd1 Compare May 28, 2021 07:52
@diegoferigo diegoferigo force-pushed the feature/expose_binaries branch 2 times, most recently from de1509d to 149a6be Compare May 28, 2021 08:21
@diegoferigo diegoferigo marked this pull request as ready for review May 28, 2021 08:22
@diegoferigo diegoferigo added the enhancement New feature or request label May 28, 2021
@diegoferigo diegoferigo force-pushed the feature/expose_binaries branch from 149a6be to bd23fc9 Compare May 28, 2021 08:23
@diegoferigo diegoferigo force-pushed the feature/expose_binaries branch from bd23fc9 to a42742b Compare May 28, 2021 08:29
@diegoferigo diegoferigo merged commit 6363e56 into master May 28, 2021
@diegoferigo diegoferigo deleted the feature/expose_binaries branch May 28, 2021 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose binaries of the CMake project
1 participant