python/CMakeLists.txt: Fix install destination#184
python/CMakeLists.txt: Fix install destination#184podsvirov wants to merge 1 commit intogoogle:masterfrom
Conversation
src/python/CMakeLists.txt
Outdated
| set_property(TEST pywraps2_test PROPERTY ENVIRONMENT | ||
| "PYTHONPATH=$ENV{PYTHONPATH}:${PROJECT_BINARY_DIR}/python") | ||
|
|
||
| set(CMAKE_INSTALL_SITELIBDIR "${Python3_SITELIB}" |
There was a problem hiding this comment.
Calling this CMAKE_ seems a bit strange. I would assume that's only for variables defined by CMake itself.
Can you point me at some CMake Python documentation or a canonical example? It seems no one has used this variable name before.
https://www.google.com/search?q=%22CMAKE_INSTALL_SITELIBDIR%22
https://github.com/search?q=CMAKE_INSTALL_SITELIBDIR
There was a problem hiding this comment.
Also, what problem are you trying to solve? Use of this variable should also be documented somewhere.
There was a problem hiding this comment.
I'm trying to do something like there: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html.
There was a problem hiding this comment.
It seems like there should be a relevant directory somewhere here:
https://cmake.org/cmake/help/latest/module/FindPython3.html
How do other swig/python/windows/cmake projects do it?
|
Does #186 make this unnecessary? |
|
These changes are not directly related to the #186. These changes solve the problem of hard-coded absolute installation path for the python module. Absolute install paths add additional problems when creating packages for distribution (in this case, it becomes necessary to install to a path other than the default). |
2fe6579 to
2ca43b5
Compare
|
This has merge conflicts. Is it still relevant? |
2ca43b5 to
893680d
Compare
893680d to
cc27ffc
Compare
|
What do other Python people think? @andyneff |
|
It seems fine to me. Normally I would try to do the string manipulation in cmake, but I don't see an obvious way to have the python's |
Added
CMAKE_INSTALL_PYLIBDIRcached variable.Default value retrivet from
Python3_EXECUTABLE.Current install destination
Python3_SITELIB(absolute path fromFindPython3module).An absolute path is not acceptable when creating an installation package.