diff options
author | Stéphane Lenclud <github@lenclud.com> | 2019-02-02 17:36:05 +0100 |
---|---|---|
committer | Stéphane Lenclud <github@lenclud.com> | 2019-02-07 13:24:13 +0100 |
commit | ba8796acda06c9ae5f528dbbf655c714844d5429 (patch) | |
tree | 15745d28c13bc1b71f514403d637faf273f16b4b /tracker-kinect-face/CMakeLists.txt | |
parent | 388a876b68a83956b687100007aab7afafbb08ab (diff) |
Various fixes from code review.
Diffstat (limited to 'tracker-kinect-face/CMakeLists.txt')
-rw-r--r-- | tracker-kinect-face/CMakeLists.txt | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/tracker-kinect-face/CMakeLists.txt b/tracker-kinect-face/CMakeLists.txt index 9a37f2d8..fca1e495 100644 --- a/tracker-kinect-face/CMakeLists.txt +++ b/tracker-kinect-face/CMakeLists.txt @@ -1,29 +1,32 @@ +# Kinect SDK is Windows only +if (WIN32) + # 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() -# 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) -# If we have a valid SDK path, try build that tracker -if(EXISTS ${KINECTSDK20_DIR}) - # Register our module - otr_module(tracker-kinect-face) - - # Add include path to Kinect SDK - target_include_directories(opentrack-tracker-kinect-face SYSTEM PUBLIC ${KINECTSDK20_DIR}/inc) + # 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() + # 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) + # 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() -endif() +endif()
\ No newline at end of file |