summaryrefslogtreecommitdiffstats
path: root/cython/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'cython/CMakeLists.txt')
-rw-r--r--cython/CMakeLists.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/cython/CMakeLists.txt b/cython/CMakeLists.txt
new file mode 100644
index 0000000..eac6bee
--- /dev/null
+++ b/cython/CMakeLists.txt
@@ -0,0 +1,30 @@
+
+INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} ${CMAKE_CURRENT_SOURCE_DIR} )
+
+
+SET(plist_SRC
+ ${CMAKE_CURRENT_BINARY_DIR}/plist.c )
+
+SET(plist_HDR
+ ${CMAKE_CURRENT_SOURCE_DIR}/plist.pxd )
+
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plist.c
+ COMMAND ${CYTHON_EXECUTABLE} -o ${CMAKE_CURRENT_BINARY_DIR}/plist.c ${CMAKE_CURRENT_SOURCE_DIR}/plist.pyx
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/plist.pyx ${CMAKE_CURRENT_SOURCE_DIR}/plist.pxd
+)
+
+
+EXEC_PROGRAM("${PYTHON_EXECUTABLE}"
+ ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1,0,\"${CMAKE_INSTALL_PREFIX}\")\nexcept: pass\n'"
+ OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH
+ )
+
+PYTHON_ADD_MODULE(cython_plist plist.c plist_util.c)
+SET_TARGET_PROPERTIES(cython_plist PROPERTIES PREFIX "" OUTPUT_NAME plist)
+TARGET_LINK_LIBRARIES(cython_plist plist ${PYTHON_LIBRARIES})
+
+INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/plist${CMAKE_SHARED_MODULE_SUFFIX}
+ DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH} )
+INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/plist.pxd
+ DESTINATION include/plist/cython COMPONENT dev)