summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tracker-kinect-face/CMakeLists.txt27
-rw-r--r--tracker-kinect-face/tracker.cpp2
-rw-r--r--tracker-kinect-face/tracker.h2
3 files changed, 27 insertions, 4 deletions
diff --git a/tracker-kinect-face/CMakeLists.txt b/tracker-kinect-face/CMakeLists.txt
index d139b445..9a37f2d8 100644
--- a/tracker-kinect-face/CMakeLists.txt
+++ b/tracker-kinect-face/CMakeLists.txt
@@ -1,6 +1,29 @@
+# Setup cache variable to Kinect SDK path
if(DEFINED ENV{KINECTSDK20_DIR})
+ set(KINECTSDK20_DIR $ENV{KINECTSDK20_DIR} CACHE PATH $ENV{KINECTSDK20_DIR})
+else()
+ set(KINECTSDK20_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "")
+endif()
+
+# If we have a valid SDK path, try build that tracker
+if(EXISTS ${KINECTSDK20_DIR})
+ # Register our module
otr_module(tracker-kinect-face)
- target_include_directories(opentrack-tracker-kinect-face SYSTEM PUBLIC $ENV{KINECTSDK20_DIR}inc)
- target_link_libraries(opentrack-tracker-kinect-face $ENV{KINECTSDK20_DIR}lib/x86/kinect20.lib $ENV{KINECTSDK20_DIR}lib/x86/kinect20.face.lib)
+
+ # Add include path to Kinect SDK
+ target_include_directories(opentrack-tracker-kinect-face SYSTEM PUBLIC ${KINECTSDK20_DIR}/inc)
+
+ # Check processor architecture
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ # 32 bits
+ set (kinect-arch-dir "x86")
+ elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ # 64 bits
+ set (kinect-arch-dir "x64")
+ endif()
+
+ # Link against Kinect SDK libraries
+ target_link_libraries(opentrack-tracker-kinect-face ${KINECTSDK20_DIR}/lib/${kinect-arch-dir}/kinect20.lib ${KINECTSDK20_DIR}/lib/${kinect-arch-dir}/kinect20.face.lib)
+
endif()
diff --git a/tracker-kinect-face/tracker.cpp b/tracker-kinect-face/tracker.cpp
index 1ab14c87..407557f0 100644
--- a/tracker-kinect-face/tracker.cpp
+++ b/tracker-kinect-face/tracker.cpp
@@ -132,7 +132,7 @@ KinectFaceTracker::~KinectFaceTracker()
SafeRelease(m_pKinectSensor);
}
-module_status KinectFaceTracker::start_tracker(QFrame*)
+module_status KinectFaceTracker::start_tracker(QFrame* aFrame)
{
t.start();
diff --git a/tracker-kinect-face/tracker.h b/tracker-kinect-face/tracker.h
index 162e1cff..1f986e22 100644
--- a/tracker-kinect-face/tracker.h
+++ b/tracker-kinect-face/tracker.h
@@ -30,7 +30,7 @@ class KinectFaceTracker : public ITracker
public:
KinectFaceTracker();
~KinectFaceTracker() override;
- module_status start_tracker(QFrame *) override;
+ module_status start_tracker(QFrame* aFrame) override;
void data(double *data) override;
bool center() override;