From 849c16c4fc37a8fb9dc3dac845c59fd3f9c86684 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Wed, 2 Mar 2016 15:47:14 +0000 Subject: [PATCH] Don't try to remove the CMAKE_INSTALL_PREFIX from the ``python_install_dir``. The implementation was broken because we would strip off ``/usr`` and then install into ``/lib/python-3.5/site-packages``. We could remove the leading slash to make sure we install into the CMAKE_INSTALL_PREFIX but doing so seems unnecessarily complicated given that DESTDIR still seems to be respected even when given absolute paths to the CMake ``install()``. --- src/api/python/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/api/python/CMakeLists.txt b/src/api/python/CMakeLists.txt index 16cd3d6de..2279be716 100644 --- a/src/api/python/CMakeLists.txt +++ b/src/api/python/CMakeLists.txt @@ -95,10 +95,9 @@ if (INSTALL_PYTHON_BINDINGS) "does not exist under the install prefix \"${CMAKE_INSTALL_PREFIX}\"." " Running the install target may lead to a broken installation." ) - set(python_install_dir "${python_pkg_dir}") - else() - string(REPLACE "${CMAKE_INSTALL_PREFIX}" "" python_install_dir "${python_pkg_dir}") endif() + # Using DESTDIR still seems to work even if we use an absolute path + set(python_install_dir "${python_pkg_dir}") message(STATUS "Python bindings will be installed to \"${python_install_dir}\"") install(FILES ${build_z3_python_bindings_target_depends} DESTINATION "${python_install_dir}"