summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-10 17:31:54 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-10 17:31:54 +0100
commita1e34e365b84d5a1c47dbcffa4141303533a55e7 (patch)
treefd2370fe9e1ec6695fd04554cc73454d8baba610 /src/CMakeLists.txt
parent423e180f3a55cd4b3350d0f50d71685f3052d145 (diff)
downloaduca-a1e34e365b84d5a1c47dbcffa4141303533a55e7.tar.gz
uca-a1e34e365b84d5a1c47dbcffa4141303533a55e7.tar.bz2
uca-a1e34e365b84d5a1c47dbcffa4141303533a55e7.tar.xz
uca-a1e34e365b84d5a1c47dbcffa4141303533a55e7.zip
Use SWIG for easy language binding creation
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3ae6394..7a69ed4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -33,8 +33,12 @@ find_package(IPE)
find_package(FgLib5)
find_package(ClSerMe4)
-# --- Add sources if camera/framegrabber access sources are available ---------
+# --- Miscellanous packages
+find_package(SWIG)
+find_package(PythonLibs)
+
+# --- Add sources if camera/framegrabber access sources are available ---------
if (PF_FOUND)
set(HAVE_PHOTON_FOCUS TRUE)
@@ -112,11 +116,22 @@ if(CLSERME4_FOUND AND FGLIB5_FOUND)
)
endif()
+# --- Configure step
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
+# --- Build language bindings via SWIG
+if(SWIG_FOUND AND PYTHONLIBS_FOUND)
+ include(${SWIG_USE_FILE})
+ include_directories(${PYTHON_INCLUDE_DIR})
+ set(CMAKE_SWIG_FLAGS "")
+
+ set_source_files_properties(uca.i PROPERTIES CPLUSPLUS ON)
+ SWIG_ADD_MODULE(uca python uca.i ${uca_SRCS})
+ SWIG_LINK_LIBRARIES(uca ${PYTHON_LIBRARIES} ${uca_LIBS})
+endif()
# --- Build target ------------------------------------------------------------
add_definitions("-std=c99 -Wall")