-
Notifications
You must be signed in to change notification settings - Fork 309
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/CMakeLists.txt: Fix install destination #184
base: master
Are you sure you want to change the base?
python/CMakeLists.txt: Fix install destination #184
Conversation
src/python/CMakeLists.txt
Outdated
@@ -15,7 +15,10 @@ add_test(NAME pywraps2_test COMMAND | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what problem are you trying to solve? Use of this variable should also be documented somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to do something like there: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
Added CMAKE_INSTALL_PYLIBDIR cached variable. Default value retrivet from Python3_EXECUTABLE.
2fe6579
to
2ca43b5
Compare
Added
CMAKE_INSTALL_PYLIBDIR
cached variable.Default value retrivet from
Python3_EXECUTABLE
.Current install destination
Python3_SITELIB
(absolute path fromFindPython3
module).An absolute path is not acceptable when creating an installation package.