From 7479242adec3b4bf1309e58157b4fd56e6cc8852 Mon Sep 17 00:00:00 2001 From: John Ehresman Date: Tue, 17 Apr 2012 15:18:45 -0400 Subject: [PATCH 5/5] Install the shiboken module to site-packages --- CMakeLists.txt | 12 ++++++++++++ shibokenmodule/CMakeLists.txt | 1 + 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b03112d..6f65082 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,18 @@ else() find_package(PythonInterpWithDebug) endif() +if (NOT PYTHON_SITE_PACKAGES) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; \\ + print(sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_PREFIX}'))" + OUTPUT_VARIABLE PYTHON_SITE_PACKAGES + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (NOT PYTHON_SITE_PACKAGES) + message(FATAL_ERROR "Could not detect Python module installation directory.") + elseif (APPLE) + message(STATUS "!!! The generated bindings will be installed on ${PYTHON_SITE_PACKAGES}, is it right!?") + endif() +endif() if(MSVC) set(CMAKE_CXX_FLAGS "/Zc:wchar_t- /GR /EHsc /DWIN32 /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS") diff --git a/shibokenmodule/CMakeLists.txt b/shibokenmodule/CMakeLists.txt index f957e59..41b20cd 100644 --- a/shibokenmodule/CMakeLists.txt +++ b/shibokenmodule/CMakeLists.txt @@ -31,3 +31,4 @@ target_link_libraries(shibokenmodule add_dependencies(shibokenmodule shiboken) +install(TARGETS shibokenmodule DESTINATION ${PYTHON_SITE_PACKAGES}) \ No newline at end of file -- 1.7.9.msysgit.0