Skip to content

Commit

Permalink
Fix MY_INSTALL_PREFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
tpeulen committed Jan 30, 2024
1 parent f87f02d commit 02d7d3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ IF(BUILD_PYTHON_INTERFACE)
if(CALL_FROM_SETUP_PY)
# The CMakeExtension will set CMAKE_INSTALL_PREFIX to the root
# of the resulting wheel archive
MESSAGE(STATUS "MY_INSTALL_PREFIX: CMAKE_INSTALL_PREFIX")
SET(MODULE_NAME ${PROJECT_NAME})
SET(MY_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
else()
# The Python package is installed directly in the folder of the
# detected interpreter (system, user, or virtualenv)
MESSAGE(STATUS "MY_INSTALL_PREFIX: Python3_SITELIB")
set(MY_INSTALL_PREFIX ${Python3_SITELIB})
endif()
# Did not find installation prefix library location of python
if(NOT MY_INSTALL_PREFIX)
MESSAGE(STATUS "MY_INSTALL_PREFIX: sysconfig.get_path('platlib')")
execute_process(COMMAND ${Python3_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_path('platlib'))"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
OUTPUT_VARIABLE MY_INSTALL_PREFIX
Expand Down

0 comments on commit 02d7d3c

Please sign in to comment.