Added cmake config file
[libftdi] / examples / cmake_example / main.c
diff --git a/examples/cmake_example/main.c b/examples/cmake_example/main.c
new file mode 100644 (file)
index 0000000..93b3a79
--- /dev/null
@@ -0,0 +1,24 @@
+/* main.c
+
+   Example for ftdi_new()
+
+   This program is distributed under the GPL, version 2
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ftdi.h>
+
+int main(void)
+{
+  struct ftdi_context *ftdi;
+  int retval = EXIT_SUCCESS;
+
+  if ((ftdi = ftdi_new()) == 0)
+  {
+    fprintf(stderr, "ftdi_new failed\n");
+    return EXIT_FAILURE;
+  }
+  
+  return retval;
+}