diff options
-rw-r--r-- | CMakeLists.txt | 23 | ||||
-rw-r--r-- | opentrack/tracker.cpp | 3 |
2 files changed, 13 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d0e7a6e6..e64ca0c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC OFF) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -find_package(OpenCV REQUIRED) +find_package(OpenCV) include_directories(${OpenCV_INCLUDE_DIRS}) find_package(Qt5 REQUIRED COMPONENTS Core Xml Network Widgets Gui ${maybe-serial-port} QUIET) @@ -166,7 +166,7 @@ add_custom_target(tarball DEPENDS ${filename}) opentrack_module(opentrack-api opentrack) opentrack_qt(opentrack-api) add_library(opentrack-api STATIC ${opentrack-api-all}) -target_link_libraries(opentrack-api ${OpenCV_LIBS} ${MY_QT_LIBS}) +target_link_libraries(opentrack-api ${MY_QT_LIBS}) if(NOT WIN32) target_link_libraries(opentrack-api dl) @@ -252,8 +252,6 @@ opentrack_library(opentrack-filter-accela ftnoir_filter_accela) opentrack_library(opentrack-filter-kalman ftnoir_filter_kalman) opentrack_library(opentrack-filter-ewma ftnoir_filter_ewma2) -target_link_libraries(opentrack-filter-kalman ${OpenCV_LIBS}) - opentrack_library(opentrack-proto-fgfs ftnoir_protocol_fg) if(SDK_VJOY) @@ -330,16 +328,19 @@ endif() opentrack_library(opentrack-tracker-ht ftnoir_tracker_ht) target_link_libraries(opentrack-tracker-ht opentrack-compat) -if(SDK_ARUCO_LIBPATH) - opentrack_library(opentrack-tracker-aruco ftnoir_tracker_aruco) - target_link_libraries(opentrack-tracker-aruco ${SDK_ARUCO_LIBPATH} ${OpenCV_LIBS}) -endif() - -opentrack_library(opentrack-tracker-pt ftnoir_tracker_pt) -target_link_libraries(opentrack-tracker-pt ${OpenCV_LIBS}) opentrack_library(opentrack-tracker-udp ftnoir_tracker_udp) opentrack_library(opentrack-tracker-freepie-udp ftnoir_tracker_freepie-udp) +if(OpenCV_FOUND) + opentrack_library(opentrack-tracker-pt ftnoir_tracker_pt) + target_link_libraries(opentrack-tracker-pt ${OpenCV_LIBS}) + if(SDK_ARUCO_LIBPATH) + opentrack_library(opentrack-tracker-aruco ftnoir_tracker_aruco) + target_link_libraries(opentrack-tracker-aruco ${SDK_ARUCO_LIBPATH} ${OpenCV_LIBS}) + endif() + target_link_libraries(opentrack-filter-kalman ${OpenCV_LIBS}) +endif() + link_with_dinput8(opentrack-tracker-ht) link_with_dinput8(opentrack-tracker-joystick) link_with_dinput8(opentrack-tracker-pt) diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index 8c0ef842..6e26755c 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -48,8 +48,6 @@ double Tracker::map(double pos, bool invertp, Mapping& axis) return fc.getValue(pos) + axis.opts.zero; } -static constexpr int x = 1, y = 0, z = 2; - // http://stackoverflow.com/a/18436193 static dmat<3, 1> rmat_to_euler(const dmat<3, 3>& R) { @@ -64,6 +62,7 @@ static dmat<3, 1> rmat_to_euler(const dmat<3, 3>& R) // tait-bryan angles, not euler static dmat<3, 3> euler_to_rmat(const double* input) { + static constexpr int x = 1, y = 0, z = 2; static constexpr double pi = 3.141592653; const auto H = input[1] * pi / 180; const auto P = input[0] * pi / 180; |