You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a quick but rather subtle issue. My CMake list file goes like:
if (NOTTARGET Spglib::symspg)
find_package(Spglib CONFIG)
if (NOT Spglib_FOUND)
message(STATUS "Using bundled spglib sources")
add_subdirectory(${PROJECT_SOURCE_DIR}/.. _deps/spglib-build)
endif ()
endif ()
If I pip install from scratch it works just fine, i.e. the add_subdirectory is used. But if I run pip install again, then it picks up the current installation and it goes through find_package even though it is later removed at the install stage when the previous version is uninstalled.
I think the issue is with working around NO_CMAKE_INSTALL_PREFIX, but it is weird, shouldn't that point to tmp folder that would not interfere? Otherwise I did not configure any prefix for it to use. Any clues on what's happening here and how to work around it?
CMAKE_EXPORT_PACKAGE_REGISTRY nope not setup, on the pyproject.toml everything is rather vanilla, and the current CMakeLists.txt does not mess with anything related to find_package.
The CMake way to do this is with the new-ish (3.24 IIRC) FindPackage + FetchContent integration:
Yeah, for proper dependencies I do use the FetchContent approach. But this is a special case where I want to use the bundled project instead, i.e. Spglib_python where that snippet is in is just the python bindings and it is a subproject/subdir of Spglib so that if the system installed Spglib is found use and link to it, otherwise use the bundled source files commit-locked to the current sources.
This is a quick but rather subtle issue. My CMake list file goes like:
If I
pip install
from scratch it works just fine, i.e. theadd_subdirectory
is used. But if I runpip install
again, then it picks up the current installation and it goes throughfind_package
even though it is later removed at the install stage when the previous version is uninstalled.I think the issue is with working around
NO_CMAKE_INSTALL_PREFIX
, but it is weird, shouldn't that point totmp
folder that would not interfere? Otherwise I did not configure anyprefix
for it to use. Any clues on what's happening here and how to work around it?I believe the issue is with:
scikit-build-core/src/scikit_build_core/builder/builder.py
Lines 133 to 139 in 4f06e8c
The text was updated successfully, but these errors were encountered: