blob: ea0c067af10fb46469c30da81bf67374e3cf3370 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
From cf4a369485736b7a901fa02bbc911f8d5dddab6a Mon Sep 17 00:00:00 2001
From: Christoph Junghans <junghans@votca.org>
Date: Tue, 21 Feb 2017 17:56:55 -0700
Subject: [PATCH] cmake: allow user to override PYTHON_INSTDIR
---
CMakeLists.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6ba209..88de171 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,9 +115,11 @@ if (WITH_PYTHON)
-c "import distutils.sysconfig as cg; print(cg.get_python_inc())"
OUTPUT_VARIABLE PYTHON_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE)
find_package(NumPy REQUIRED)
- execute_process(COMMAND ${PYTHON_EXECUTABLE}
+ if(NOT PYTHON_INSTDIR)
+ execute_process(COMMAND ${PYTHON_EXECUTABLE}
-c "import distutils.sysconfig as cg; print(cg.get_python_lib(1,0,prefix='${CMAKE_INSTALL_EXEC_PREFIX}'))"
OUTPUT_VARIABLE PYTHON_INSTDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+ endif(NOT PYTHON_INSTDIR)
if(PYTHON_VERSION_MAJOR EQUAL 2)
set(CYTHON_FLAGS "-2" CACHE STRING "Flags used by the Cython compiler during all build types.")
else()
|