cmake support for the new python bindings
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 7 Apr 2009 17:30:20 +0000 (19:30 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 7 Apr 2009 17:30:20 +0000 (19:30 +0200)
CMakeLists.txt
bindings/CMakeLists.txt [new file with mode: 0644]

index dbf6052..9203c82 100644 (file)
@@ -76,6 +76,7 @@ endif(${UNIX})
 
 add_subdirectory(src)
 add_subdirectory(ftdipp)
+add_subdirectory(bindings)
 add_subdirectory(examples)
 add_subdirectory(packages)
 
diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5d1061e
--- /dev/null
@@ -0,0 +1,15 @@
+include(FindSWIG)
+include(FindPythonLibs)
+include(UseSWIG)
+
+if(SWIG_FOUND)
+if(PYTHONLIBS_FOUND)
+    INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../src)
+    INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
+
+    SWIG_ADD_MODULE(ftdi python ftdi.i)
+    SWIG_LINK_LIBRARIES(ftdi ${PYTHON_LIBRARIES})
+
+    message(STATUS "Building python bindings via swig")
+endif(PYTHONLIBS_FOUND)
+endif(SWIG_FOUND)