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

Split bindings into separate targets. #41

Merged
merged 9 commits into from
Mar 20, 2025

Conversation

petrasvestartas
Copy link
Contributor

@petrasvestartas petrasvestartas commented Mar 19, 2025

Split bindings into separate targets using the following CMake workflow:

# Add the booleans module
nanobind_add_module(
    booleans_ext
    STABLE_ABI
    NB_STATIC
    src/booleans.cpp)

# Set include directories for the extension
target_include_directories(booleans_ext PRIVATE
    ${CGAL_INCLUDE_DIR}
    ${BOOST_INCLUDE_DIR}
    ${EIGEN_INCLUDE_DIR}
)

# Add the meshing module
nanobind_add_module(
    meshing_ext
    STABLE_ABI
    NB_STATIC
    src/meshing.cpp)

# Set include directories for the extension
target_include_directories(meshing_ext PRIVATE
    ${CGAL_INCLUDE_DIR}
    ${BOOST_INCLUDE_DIR}
    ${EIGEN_INCLUDE_DIR}
)

# Make sure external dependencies are downloaded before building the extension
add_dependencies(booleans_ext external_downloads)
add_dependencies(meshing_ext external_downloads)

# Install directive for scikit-build-core
install(TARGETS booleans_ext LIBRARY DESTINATION compas_cgal)
install(TARGETS meshing_ext LIBRARY DESTINATION compas_cgal)

@@ -3,7 +3,7 @@
import numpy as np
from compas.plugins import plugin

from compas_cgal.compas_cgal_ext import booleans
from compas_cgal import booleans_ext
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we not add this _ext suffix? it is ugly :)

@tomvanmele tomvanmele merged commit d1e86b1 into compas-dev:main Mar 20, 2025
5 checks passed
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.

2 participants