summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-03-02 08:48:24 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-03-02 08:48:24 +0100
commit8eca0564a1dd6aac125086a244687b4813a1fd86 (patch)
tree462919b3c3a3ebe833b3b7215c5a9399e5da7f60 /CMakeLists.txt
parent269b0985bd5830e27f6dedb04a05d76f52acb68c (diff)
parentadc657ebcd01ecc2cc5f110453ef00dffde2d5c0 (diff)
downloadpcitool-8eca0564a1dd6aac125086a244687b4813a1fd86.tar.gz
pcitool-8eca0564a1dd6aac125086a244687b4813a1fd86.tar.bz2
pcitool-8eca0564a1dd6aac125086a244687b4813a1fd86.tar.xz
pcitool-8eca0564a1dd6aac125086a244687b4813a1fd86.zip
1. Merge with http://ufo.kit.edu/ufo/log/csa/pcitool 359 revision
2. Move api_server to html server
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 20 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4445af7..856e23c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,8 +38,26 @@ find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
if (NOT DISABLE_PYTHON)
- find_package(PythonLibs 2 REQUIRED)
+
+ find_package(PythonLibs 2.7 REQUIRED)
+ find_package(PythonInterp 2 REQUIRED)
+
find_package(SWIG REQUIRED)
+ if (NOT PYTHON_VERSION_STRING VERSION_EQUAL PYTHONLIBS_VERSION_STRING)
+ message (FATAL_ERROR "Version mismatch between python interpreter and libraries")
+ endif (NOT PYTHON_VERSION_STRING VERSION_EQUAL PYTHONLIBS_VERSION_STRING)
+
+# execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sysconfig import get_path; print get_path('platlib')" OUTPUT_VARIABLE PYTHON_INSTALL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "import site; print site.PREFIXES[-1]" OUTPUT_VARIABLE PYTHON_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
+ file (TO_CMAKE_PATH "${PYTHON_PREFIX}" PYTHON_PREFIX)
+ execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "import site; print site.getsitepackages()[0]" OUTPUT_VARIABLE PYTHON_SITE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+ file (TO_CMAKE_PATH "${PYTHON_SITE_DIR}" PYTHON_SITE_DIR)
+
+ string (REGEX REPLACE "^${PYTHON_PREFIX}/" "${CMAKE_INSTALL_PREFIX}/" PYTHON_SITE_DIR "${PYTHON_SITE_DIR}")
+
+ set(PYTHON_INSTALL_DIR ${PYTHON_SITE_DIR} CACHE PATH "path to install python module")
+ message(${PYTHON_INSTALL_DIR})
set(HAVE_PYTHON TRUE)
include(FindPythonInterp)
endif (NOT DISABLE_PYTHON)
@@ -114,7 +132,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINA
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
file(COPY ${CMAKE_SOURCE_DIR}/xml DESTINATION ${CMAKE_BINARY_DIR})
- file(COPY ${CMAKE_SOURCE_DIR}/html_server DESTINATION ${CMAKE_BINARY_DIR})
+ file(COPY ${CMAKE_SOURCE_DIR}/pyserver DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/pci
DESTINATION ${CMAKE_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE