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

python/regina/CMakeLists.txt does not honor CMAKE_INSTALL_PREFIX #84

Open
fogti opened this issue Mar 20, 2024 · 1 comment
Open

python/regina/CMakeLists.txt does not honor CMAKE_INSTALL_PREFIX #84

fogti opened this issue Mar 20, 2024 · 1 comment

Comments

@fogti
Copy link

fogti commented Mar 20, 2024

when "just" setting CMAKE_INSTALL_PREFIX when invoking cmake, installation of regina-python fails with

CMake Error at python/regina/cmake_install.cmake:54 (file):
  file cannot create directory: /usr/lib/python3.12/site-packages/regina.
  Maybe need administrative privileges.
Call Stack (most recent call first):
  python/cmake_install.cmake:83 (include)
  cmake_install.cmake:50 (include)

when it should actually install into $CMAKE_INSTALL_PREFIX/lib/python3.12/site-packages/regina...

(REGINA_INSTALL_TYPE is set to XDG, but DESTDIR is unset)

@fogti
Copy link
Author

fogti commented Apr 30, 2024

By now, I use the following patch to work around this:

diff --git a/python/regina/CMakeLists.txt b/python/regina/CMakeLists.txt
index 1d86fa74c..5263f984a 100644
--- a/python/regina/CMakeLists.txt
+++ b/python/regina/CMakeLists.txt
@@ -42,7 +42,7 @@ IF (${REGINA_INSTALL_TYPE} STREQUAL XDG)
   # Install the module in python's standard site-packages location.
   # However, we do it directly ourselves (not via distutils), since we
   # want the files to show up in cmake's install_manifest.txt.
-  SET(MODULEDIR $ENV{DESTDIR}${Python_SITELIB}/regina)
+  SET(MODULEDIR ${CMAKE_INSTALL_PREFIX}/${Python_SITELIB}/regina)
 ELSE (${REGINA_INSTALL_TYPE} STREQUAL XDG)
   # Install the module directly ourselves.
   SET(MODULEDIR "${PYLIBDIR}/regina")

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

No branches or pull requests

1 participant