summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/cameras/uca_pco.c2
-rw-r--r--src/cameras/uca_pco.h2
-rw-r--r--src/uca.c1
-rw-r--r--test/CMakeLists.txt6
-rw-r--r--test/test.c12
7 files changed, 24 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 37efe2e..1d2fc2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,3 +2,4 @@ cmake_minimum_required(VERSION 2.8)
project(uca)
add_subdirectory(src)
+add_subdirectory(test)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0d6ce94..dde0a01 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -42,6 +42,8 @@ endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
# --- Build target ------------------------------------------------------------
add_library(uca SHARED ${uca_SRCS})
diff --git a/src/cameras/uca_pco.c b/src/cameras/uca_pco.c
index daba6f6..0359990 100644
--- a/src/cameras/uca_pco.c
+++ b/src/cameras/uca_pco.c
@@ -11,7 +11,7 @@ static void uca_pco_destroy(struct uca_t *uca)
pco_destroy(pco);
}
-uint8_t uca_pco_init(struct uca_t *uca)
+int uca_pco_init(struct uca_t *uca)
{
pco = pco_init();
if (!pco_active(pco)) {
diff --git a/src/cameras/uca_pco.h b/src/cameras/uca_pco.h
index c314ffe..f2e7174 100644
--- a/src/cameras/uca_pco.h
+++ b/src/cameras/uca_pco.h
@@ -3,6 +3,6 @@
struct uca_t;
-uint8_t uca_pco_init(struct uca_t *uca);
+int uca_pco_init(struct uca_t *uca);
#endif
diff --git a/src/uca.c b/src/uca.c
index 7889fe2..3549e60 100644
--- a/src/uca.c
+++ b/src/uca.c
@@ -1,5 +1,6 @@
#include <stdlib.h>
+#include "config.h"
#include "uca.h"
#ifdef HAVE_PCO_EDGE
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..f560df3
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 2.8)
+
+include_directories(${CMAKE_SOURCE_DIR}/src)
+add_executable(test test.c)
+
+target_link_libraries(test uca)
diff --git a/test/test.c b/test/test.c
new file mode 100644
index 0000000..a1689ef
--- /dev/null
+++ b/test/test.c
@@ -0,0 +1,12 @@
+
+#include <stdio.h>
+#include "uca.h"
+
+int main(int argc, char *argv[])
+{
+ struct uca_t *uca = uca_init();
+ if (uca == NULL) {
+ printf("Couldn't find a camera\n");
+ }
+ return 0;
+}