summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/python/CMakeLists.txt36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
index 7f0cdd1..ac5deed 100644
--- a/src/python/CMakeLists.txt
+++ b/src/python/CMakeLists.txt
@@ -15,25 +15,29 @@ ADD_CUSTOM_TARGET(generate_python_bindings ALL DEPENDS ${KOLAB_SWIG_PYTHON_SOURC
# Compile Python Bindings
find_package(PythonLibs)
-include_directories(${PYTHON_INCLUDE_DIRS})
-# python_add_module(kolabformat ${KOLAB_SWIG_PYTHON_SOURCE_FILE})
+if (PythonLibs_FOUND)
+ include_directories(${PYTHON_INCLUDE_DIRS})
-add_library(pythonbindings SHARED ${KOLAB_SWIG_PYTHON_SOURCE_FILE})
-target_link_libraries(pythonbindings kolabxml ${PYTHON_LIBRARY})
-SET_TARGET_PROPERTIES(pythonbindings PROPERTIES OUTPUT_NAME "_kolabformat")
-SET_TARGET_PROPERTIES(pythonbindings PROPERTIES PREFIX "")
+ # python_add_module(kolabformat ${KOLAB_SWIG_PYTHON_SOURCE_FILE})
-configure_file(test.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+ add_library(pythonbindings SHARED ${KOLAB_SWIG_PYTHON_SOURCE_FILE})
+ target_link_libraries(pythonbindings kolabxml ${PYTHON_LIBRARY})
+ SET_TARGET_PROPERTIES(pythonbindings PROPERTIES OUTPUT_NAME "_kolabformat")
+ SET_TARGET_PROPERTIES(pythonbindings PROPERTIES PREFIX "")
-if (KOLAB_PYTHON_INSTALL_DIR)
- set(PYTHON_INSTALL_DIR ${KOLAB_PYTHON_INSTALL_DIR})
-else (KOLAB_PYTHON_INSTALL_DIR)
- set(PYTHON_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/pythonbindings)
-endif (KOLAB_PYTHON_INSTALL_DIR)
+ configure_file(test.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
-install(TARGETS pythonbindings LIBRARY DESTINATION ${PYTHON_INSTALL_DIR})
+ if (KOLAB_PYTHON_INSTALL_DIR)
+ set(PYTHON_INSTALL_DIR ${KOLAB_PYTHON_INSTALL_DIR})
+ else (KOLAB_PYTHON_INSTALL_DIR)
+ set(PYTHON_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/pythonbindings)
+ endif (KOLAB_PYTHON_INSTALL_DIR)
-install( FILES
- ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.py
- DESTINATION ${PYTHON_INSTALL_DIR}) \ No newline at end of file
+ install(TARGETS pythonbindings LIBRARY DESTINATION ${PYTHON_INSTALL_DIR})
+
+ install( FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.py
+ DESTINATION ${PYTHON_INSTALL_DIR}
+ )
+endif (PythonLibs_FOUND)