-
Notifications
You must be signed in to change notification settings - Fork 68
Description
This is a quick but rather subtle issue. My CMake list file goes like:
if (NOT TARGET 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?
I believe the issue is with:
scikit-build-core/src/scikit_build_core/builder/builder.py
Lines 133 to 139 in 4f06e8c
# Add site-packages to the prefix path for CMake | |
site_packages = Path(sysconfig.get_path("purelib")) | |
self.config.prefix_dirs.append(site_packages) | |
logger.debug("SITE_PACKAGES: {}", site_packages) | |
if site_packages != DIR.parent.parent: | |
self.config.prefix_dirs.append(DIR.parent.parent) | |
logger.debug("Extra SITE_PACKAGES: {}", site_packages) |