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

cmake: Add install rules and option to use submodule dependencies #356

Merged
merged 3 commits into from
Nov 9, 2023

Commits on Nov 7, 2023

  1. cmake: Add install rules and option to use submodule dependencies

    Package ecosystems that know how to install CMake projects can now
    package nanobind for distribution without using submodule'd
    dependencies.
    
    nanobind does not install any compiled library artifacts. Instead, all
    necessary source files and supporting CMake files are installed to build
    nanobind within another CMake project.
    
    A CMake user can now adjust the CMake option `NB_USE_SUBMODULE_DEPS` to
    choose whether nanobind will use and/or install the submodule'd external
    dependencies. This is `ON` by default, allowing nanobind's CMake logic
    to continue operating as it did previously.
    
    Another CMake option was introduced, `NB_CREATE_INSTALL_RULES`, to allow
    users to choose whether to enable or disable the installation rules.
    Notably, if nanobind is added to a CMake project with
    `add_subdirectory`, the installation rules are disabled, because
    installing source files probably isn't the expected result of the parent
    project(s). Install-rule generation still respects the standard CMake
    `CMAKE_SKIP_INSTALL_RULES` variable.
    ekilmer committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    9270632 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2023

  1. Improve install rules a bit more

    Use CMake's `GNUInstallDirs` to provide initial variable values, then
    create a variable `NB_INSTALL_DATADIR` to allow a user to specify where
    nanobind's files are installed.
    ekilmer committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    7c61a09 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2023

  1. Address review comments

    ekilmer committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    e59cfe8 View commit details
    Browse the repository at this point in the history