[Rdkit-devel] [PATCH 1/3] Locate python's sitearch directory and install python wrappers there
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Gianluca S. <gi...@gm...> - 2010-07-11 23:10:37
|
---
CMakeLists.txt | 13 +++++++++++++
Code/cmake/Modules/RDKitUtils.cmake | 2 +-
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0cfb0b6..8183c27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,6 +45,19 @@ if(RDK_BUILD_PYTHON_WRAPPERS)
find_package(NumPy REQUIRED)
include_directories(${PYTHON_NUMPY_INCLUDE_PATH})
find_package(Boost 1.39.0 COMPONENTS python REQUIRED)
+
+# Determine correct installation directory for Python bindings
+# From http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/cmake/modules/python.cmake?revision=11014
+ execute_process(
+ COMMAND
+ ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_PREFIX}')"
+ OUTPUT_VARIABLE PYTHON_INSTDIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ message("Python Install directory ${PYTHON_INSTDIR}")
+
+ install(DIRECTORY rdkit DESTINATION ${PYTHON_INSTDIR})
+
else(RDK_BUILD_PYTHON_WRAPPERS)
find_package(Boost 1.39.0 REQUIRED)
endif(RDK_BUILD_PYTHON_WRAPPERS)
diff --git a/Code/cmake/Modules/RDKitUtils.cmake b/Code/cmake/Modules/RDKitUtils.cmake
index 993488a..3bfcd6f 100644
--- a/Code/cmake/Modules/RDKitUtils.cmake
+++ b/Code/cmake/Modules/RDKitUtils.cmake
@@ -46,7 +46,7 @@ endif(MSVC)
${PYTHON_LIBRARIES} ${Boost_LIBRARIES})
INSTALL(TARGETS ${RDKPY_NAME}
- LIBRARY DESTINATION ${RDKit_PythonDir}/${RDKPY_DEST})
+ LIBRARY DESTINATION ${PYTHON_INSTDIR}/rdkit/${RDKPY_DEST})
endif(RDK_BUILD_PYTHON_WRAPPERS)
endmacro(rdkit_python_extension)
--
1.7.1.1
|