Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Building units within a Python Package via scikit-build #389

@thorstenhater

Description

@thorstenhater

Hi,

since units has a Python package, building it as a dependency within another Python package
leads to unexpected behaviour, namely units no longer installing into the package.

I am currently using a workaround

# This is highly annoying...
set(skbuild_original ${SKBUILD})
unset(SKBUILD CACHE)
CPMFindPackage(NAME units
               GITHUB_REPOSITORY llnl/units
               VERSION 0.13.1
               OPTIONS "UNITS_CMAKE_PROJECT_NAME units"
                       "UNITS_INSTALL ON"
                       "UNITS_BUILD_STATIC_LIBRARY ON"
                       "UNITS_BUILD_SHARED_LIBRARY OFF"
                       "UNITS_BUILD_OBJECT_LIBRARY OFF"
                       "UNITS_ENABLE_TESTS OFF"
                       "UNITS_BUILD_CONVERTER_APP OFF"
                       "UNITS_BUILD_WEBSERVER OFF")
target_link_libraries(arbor-public-deps INTERFACE units::units)
if(units_ADDED)
    install(TARGETS units compile_flags_target EXPORT arbor-targets)
endif()
list(APPEND arbor_export_dependencies units)
set(SKBUILD ${skbuild_original} CACHE INTERNAL "" FORCE)

These are the kinds of problem I wanted to avoid as mentioned in #374 ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions