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/CMakeLists.txt: Fix install destination #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ add_test(NAME pywraps2_test COMMAND
set_property(TEST pywraps2_test PROPERTY ENVIRONMENT
"PYTHONPATH=$ENV{PYTHONPATH}:${PROJECT_BINARY_DIR}/python")

execute_process(COMMAND ${Python3_EXECUTABLE} -c
"from distutils import sysconfig; print(sysconfig.get_python_lib(prefix=''))"
OUTPUT_VARIABLE CMAKE_INSTALL_PYLIBDIR_DEFAULT
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(CMAKE_INSTALL_PYLIBDIR "${CMAKE_INSTALL_PYLIBDIR_DEFAULT}"
CACHE STRING "Python site-packages installation directory")

# Install the wrapper.
install(TARGETS _pywraps2 DESTINATION ${Python3_SITELIB})
install(TARGETS _pywraps2 DESTINATION "${CMAKE_INSTALL_PYLIBDIR}")
install(FILES "${PROJECT_BINARY_DIR}/python/pywraps2.py"
DESTINATION ${Python3_SITELIB})
DESTINATION "${CMAKE_INSTALL_PYLIBDIR}")