diff options
author | Vasilii Chernov <vchernov@inr.ru> | 2016-02-26 11:01:39 +0100 |
---|---|---|
committer | Vasilii Chernov <vchernov@inr.ru> | 2016-02-26 11:01:39 +0100 |
commit | 0e584d07a0776454fd5487b7d23407c0624b56c2 (patch) | |
tree | 1e00cacf2077c5004c4e151d2bf3f9dddbb1b9ea /pywrap/CMakeLists.txt | |
parent | e2550e6df11558ccd6e8b95f489c0988b34347af (diff) | |
parent | 30d740cc6accc3bd477e6bc924d5b74dad71ee6d (diff) | |
download | pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.tar.gz pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.tar.bz2 pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.tar.xz pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.zip |
Merge with ufo.kit.edu/csa/pcitool 357 revision
Diffstat (limited to 'pywrap/CMakeLists.txt')
-rw-r--r-- | pywrap/CMakeLists.txt | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/pywrap/CMakeLists.txt b/pywrap/CMakeLists.txt index f77c2ff..b00fdb0 100644 --- a/pywrap/CMakeLists.txt +++ b/pywrap/CMakeLists.txt @@ -2,26 +2,29 @@ include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/pcilib + ${CMAKE_SOURCE_DIR}/pywrap ${CMAKE_BINARY_DIR}/pcilib ${LIBXML2_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIR} ${UTHASH_INCLUDE_DIRS} ) -set(HEADERS pcipywrap.h) - -#Creating python wrapping include(${SWIG_USE_FILE}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +set(HEADERS pcipywrap.h) set(CMAKE_SWIG_FLAGS "") swig_add_module(pcipywrap python pcipywrap.i pcipywrap.c) swig_link_libraries(pcipywrap ${PYTHON_LIBRARIES} pcilib) + #install pcilib python wrapper into Python site packages folder execute_process ( COMMAND python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE) + install(TARGETS ${SWIG_MODULE_pcipywrap_REAL_NAME} DESTINATION ${PYTHON_SITE_PACKAGES}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pcipywrap.py DESTINATION ${PYTHON_SITE_PACKAGES}) -configure_file(server.py server.py) -configure_file(test_pcipywrap.py test_pcipywrap.py) +if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/server.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test_pcipywrap.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +endif(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |