summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-x[-rw-r--r--]CMakeLists.txt135
1 files changed, 14 insertions, 121 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 67064d76..b48ac0cf 100644..100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,7 +28,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-find_package(OpenCV 3.0)
+find_package(OpenCV 3.0 REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Core Xml Network Widgets Gui QUIET)
find_package(Qt5 COMPONENTS SerialPort QUIET)
@@ -112,6 +112,10 @@ macro(opentrack_library n dir)
add_library(${n} ${link-mode} ${${n}-all})
target_link_libraries(${n} opentrack-api ${MY_QT_LIBS} opentrack-compat)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
+ set(visibility "-fvisibility=hidden -fvisibility-inlines-hidden")
+ if (foolib_STATIC)
+ set(visibility)
+ endif()
SET_TARGET_PROPERTIES(${n} PROPERTIES
LINK_FLAGS "${foolib_LINK} ${foolib_GNU-LINK} -Wl,--as-needed -Wl,--version-script=\"${CMAKE_SOURCE_DIR}/opentrack-compat/${version-script}-version-script.txt\""
COMPILE_FLAGS "${foolib_COMPILE} ${foolib_GNU-COMPILE} -fvisibility=hidden -fvisibility-inlines-hidden"
@@ -280,9 +284,8 @@ set_target_properties(opentrack-version PROPERTIES
COMPILE_DEFINITIONS
"OPENTRACK_VERSION=\"${OPENTRACK__COMMIT}\"")
-opentrack_library(opentrack-filter-accela ftnoir_filter_accela)
+opentrack_library(opentrack-filter-accela ftnoir_filter_accela STATIC TRUE)
target_link_libraries(opentrack-filter-accela opentrack-spline-widget)
-opentrack_library(opentrack-filter-ewma ftnoir_filter_ewma2)
opentrack_library(opentrack-proto-fgfs ftnoir_protocol_fg)
@@ -312,7 +315,6 @@ if(SDK_FSUIPC)
if(MSVC)
set_target_properties(opentrack-proto-fsuipc PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBC.lib")
endif()
- #target_link_directories(${SDK_FSUIPC})
endif()
if(WIN32)
@@ -327,17 +329,13 @@ endif()
opentrack_library(opentrack-proto-udp ftnoir_protocol_ftn)
-if(WIN32)
- opentrack_library(opentrack-tracker-joystick ftnoir_tracker_joystick)
-endif()
-
-if(Qt5SerialPort_FOUND)
+if(Qt5SerialPort_FOUND AND FALSE)
opentrack_library(opentrack-tracker-hatire ftnoir_tracker_hatire)
target_link_libraries(opentrack-tracker-hatire ${Qt5SerialPort_LIBRARIES})
target_include_directories(opentrack-tracker-hatire SYSTEM PUBLIC ${Qt5SerialPort_INCLUDE_DIRS})
endif()
-if(SDK_WINE_PREFIX)
+if(SDK_WINE_PREFIX AND FALSE)
opentrack_library(opentrack-proto-wine ftnoir_protocol_wine)
target_link_libraries(opentrack-proto-wine opentrack-compat opentrack-csv)
if(NOT SDK_WINE_NO_WRAPPER)
@@ -359,118 +357,14 @@ if(SDK_WINE_PREFIX)
endif()
endif()
-opentrack_library(opentrack-tracker-udp ftnoir_tracker_udp)
-opentrack_library(opentrack-tracker-freepie-udp ftnoir_tracker_freepie-udp)
-
-if(WIN32)
- opentrack_library(opentrack-tracker-rs ftnoir_tracker_rs)
-endif()
-
if(OpenCV_FOUND)
- opentrack_library(opentrack-tracker-pt ftnoir_tracker_pt)
+ opentrack_library(opentrack-tracker-pt ftnoir_tracker_pt STATIC YES)
target_link_libraries(opentrack-tracker-pt ${OpenCV_LIBS})
target_include_directories(opentrack-tracker-pt SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
link_with_dinput8(opentrack-tracker-pt)
-
- if(SDK_ARUCO_LIBPATH)
- opentrack_library(opentrack-tracker-aruco ftnoir_tracker_aruco)
- target_link_libraries(opentrack-tracker-aruco ${SDK_ARUCO_LIBPATH} ${OpenCV_LIBS})
- target_include_directories(opentrack-tracker-aruco SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
- link_with_dinput8(opentrack-tracker-aruco)
- endif()
-
- opentrack_library(opentrack-filter-kalman ftnoir_filter_kalman)
- target_link_libraries(opentrack-filter-kalman ${OpenCV_LIBS})
- target_include_directories(opentrack-filter-kalman SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
-
- if(SDK_HT AND SDK_HT_FLANDMARK)
- opentrack_library(opentrack-tracker-ht ftnoir_tracker_ht)
- target_link_libraries(opentrack-tracker-ht ${SDK_HT} ${SDK_HT_FLANDMARK} ${OpenCV_LIBS})
- link_with_dinput8(opentrack-tracker-ht)
- target_include_directories(opentrack-tracker-ht SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
- endif()
-endif()
-
-link_with_dinput8(opentrack-tracker-joystick)
-
-if(SDK_RIFT)
- set(link-flags)
- set(c-flags)
- if(APPLE)
- set(link-flags "-framework CoreFoundation -framework CoreGraphics -framework IOKit -framework Quartz")
- set(c-flags "-fno-strict-aliasing")
- else()
- if(NOT MSVC)
- set(c-flags "-fno-strict-aliasing")
- endif()
- endif()
- opentrack_library(opentrack-tracker-rift ftnoir_tracker_rift LINK ${link-flags} COMPILE ${c-flags})
- target_include_directories(opentrack-tracker-rift SYSTEM PUBLIC ${SDK_RIFT}/Include ${SDK_RIFT}/Src)
- if(WIN32)
- if(MSVC)
- set(ext lib)
- set(p)
- else()
- set(ext a)
- set(p lib)
- endif()
- target_link_libraries(opentrack-tracker-rift ${SDK_RIFT}/${p}LibOVR.${ext} winmm setupapi ws2_32 imagehlp wbemuuid)
- else()
- if(NOT APPLE)
- target_link_libraries(opentrack-tracker-rift ${SDK_RIFT}/libLibOVR.a udev Xinerama)
- else()
- target_link_libraries(opentrack-tracker-rift ${SDK_RIFT}/libLibOVR.a)
- endif()
- endif()
-endif()
-
-if(SDK_HYDRA)
- opentrack_library(opentrack-tracker-hydra ftnoir_tracker_hydra)
- target_include_directories(opentrack-tracker-hydra SYSTEM PUBLIC ${SDK_HYDRA}/include ${SDK_HYDRA}/include/sixense_utils)
- if(WIN32)
- if(MSVC)
- set(dir lib)
- set(ext lib)
- else()
- set(dir bin)
- set(ext dll)
- endif()
- target_link_libraries(opentrack-tracker-hydra
- "${SDK_HYDRA}/${dir}/win32/release_dll/sixense.${ext}"
- #"${SDK_HYDRA}/${dir}/win32/release_dll/sixense_utils.${ext}"
- )
- install(FILES "${SDK_HYDRA}/bin/win32/release_dll/sixense.dll"
- #"${SDK_HYDRA}/bin/win32/release_dll/sixense_utils.dll"
- DESTINATION . ${opentrack-perms})
- else()
- if(SDK_HYDRA_AMD64)
- set(underscore-sixtyfour _x64)
- else()
- set(underscore-sixtyfour)
- endif()
- if(APPLE)
- set(underscore-dll _dll)
- set(soext dylib)
- set(sixense-plat osx)
- else()
- set(underscore-dll)
- set(soext so)
- set(sixense-plat linux)
- endif()
- install(FILES
- "${SDK_HYDRA}/lib/${sixense-plat}${underscore-sixtyfour}/release${underscore-dll}/libsixense${underscore-sixtyfour}.${soext}"
- #"${SDK_HYDRA}/lib/${sixense-plat}${underscore-sixtyfour}/release${underscore-dll}/libsixense_utils${underscore-sixtyfour}.${soext}"
- DESTINATION .
- )
- target_link_libraries(opentrack-tracker-hydra
- "${SDK_HYDRA}/lib/${sixense-plat}${underscore-sixtyfour}/release${underscore-dll}/libsixense${underscore-sixtyfour}.${soext}"
- #"${SDK_HYDRA}/lib/${sixense-plat}${underscore-sixtyfour}/release${underscore-dll}/libsixense_utils${underscore-sixtyfour}.${soext}"
- )
- endif()
endif()
if(UNIX OR APPLE)
- # Qxt bundled :: sorry for this, but gentoo ebuild is broken
include_directories("qxt-mini/")
if(APPLE)
set(qxt-plat mac)
@@ -493,11 +387,13 @@ else()
endif()
opentrack_module(opentrack facetracknoir)
+
if(UNIX OR APPLE)
list(APPEND opentrack-c qxt-mini/qxtglobalshortcut.h)
endif()
opentrack_qt(opentrack)
add_executable(opentrack ${opentrack-win32-executable} ${opentrack-all})
+target_link_libraries(opentrack opentrack-filter-accela opentrack-tracker-pt)
opentrack_compat(opentrack)
if(NOT WIN32)
set_target_properties(opentrack PROPERTIES SUFFIX ".bin")
@@ -511,6 +407,8 @@ endif()
if(UNIX OR APPLE)
target_link_libraries(opentrack opentrack-qxt-mini)
endif()
+target_include_directories(opentrack SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
+target_link_libraries(opentrack ${OpenCV_LIBS})
link_with_dinput8(opentrack)
target_link_libraries(opentrack ${MY_QT_LIBS})
@@ -542,7 +440,7 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/3rdparty-notices DESTINATION .)
install(FILES "${CMAKE_SOURCE_DIR}/bin/freetrackclient.dll" DESTINATION . ${opentrack-perms})
install(FILES "${CMAKE_SOURCE_DIR}/bin/NPClient.dll" "${CMAKE_SOURCE_DIR}/bin/NPClient64.dll" "${CMAKE_SOURCE_DIR}/bin/TrackIR.exe" DESTINATION .
${opentrack-perms})
-install(DIRECTORY "${CMAKE_SOURCE_DIR}/bin/settings" "${CMAKE_SOURCE_DIR}/clientfiles" DESTINATION .)
+install(DIRECTORY "${CMAKE_SOURCE_DIR}/bin/settings" DESTINATION .)
if(NOT WIN32 AND SDK_WINE_PREFIX AND NOT SDK_WINE_NO_WRAPPER)
install(FILES "${CMAKE_BINARY_DIR}/opentrack-wrapper-wine.exe.so"
@@ -559,11 +457,6 @@ if(WIN32)
install(FILES "${CMAKE_SOURCE_DIR}/bin/cleye.config" DESTINATION .)
endif()
-if(WIN32)
- install(FILES "${CMAKE_SOURCE_DIR}/ftnoir_tracker_rs/rs_impl/bin/opentrack-tracker-rs-impl.exe" DESTINATION . ${opentrack-perms})
- install(FILES "${CMAKE_SOURCE_DIR}/ftnoir_tracker_rs/redist/intel_rs_sdk_runtime_websetup_6.0.21.6598.exe" DESTINATION ./clientfiles/ ${opentrack-perms})
-endif()
-
if(APPLE)
install(CODE "
execute_process(COMMAND /bin/sh \"${CMAKE_SOURCE_DIR}/macosx/make-app-bundle.sh\"