File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,8 +8,18 @@ if(${pybind11_FOUND} AND ${COMPILE_PYTHON_BINDINGS})
88
99 message (STATUS "Found python (${Python3_EXECUTABLE} ) will compile python bindings" )
1010
11+ # Check if we install into system pathes ( something /usr/* )
12+ # In Debian/Ubuntu site-packages are named dist-packages there
13+ # Otherwise install as site-packages
14+ string (REGEX MATCH "^/usr/" IS_ROOT_USR_PATH ${CMAKE_INSTALL_PREFIX} )
15+ if ("${IS_ROOT_USR_PATH} " STREQUAL "/usr/" )
16+ set (SITE_DIRECTORY_NAME "dist-packages" )
17+ else ()
18+ set (SITE_DIRECTORY_NAME "site-packages" )
19+ endif ()
20+
1121 # get python install path
12- set (PYTHON_SITE "lib/python${Python3_VERSION_MAJOR} .${Python3_VERSION_MINOR} /dist-packages " )
22+ set (PYTHON_SITE "lib/python${Python3_VERSION_MAJOR} .${Python3_VERSION_MINOR} /${SITE_DIRECTORY_NAME} " )
1323 message (STATUS "Python install dir: ${PYTHON_SITE} " )
1424
1525 include_directories (${CMAKE_CURRENT_SOURCE_DIR} )
You can’t perform that action at this time.
0 commit comments