diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 67 |
1 files changed, 40 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 16f779d3..ee0e932c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,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) @@ -117,6 +117,10 @@ macro(opentrack_library n dir) add_library(${n} ${link-mode} ${${n}-all}) target_link_libraries(${n} opentrack-api ${MY_QT_LIBS}) 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/${version-script}-version-script.txt\"" COMPILE_FLAGS "${foolib_COMPILE} ${foolib_GNU-COMPILE} -fvisibility=hidden -fvisibility-inlines-hidden" @@ -128,7 +132,9 @@ macro(opentrack_library n dir) endif() set_target_properties(${n} PROPERTIES LINK_FLAGS "${link-flags} ${foolib_LINK}" COMPILE_FLAGS "${foolib_COMPILE}") endif() - install(TARGETS ${n} RUNTIME DESTINATION . LIBRARY DESTINATION .) + if (NOT foolib_STATIC) + install(TARGETS ${n} RUNTIME DESTINATION . LIBRARY DESTINATION .) + endif() endmacro() function(link_with_dinput8 n) @@ -277,9 +283,9 @@ 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-filter-ewma ftnoir_filter_ewma2) opentrack_library(opentrack-proto-fgfs ftnoir_protocol_fg) @@ -325,16 +331,16 @@ endif() opentrack_library(opentrack-proto-udp ftnoir_protocol_ftn) if(WIN32) - opentrack_library(opentrack-tracker-joystick ftnoir_tracker_joystick) + #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) @@ -356,37 +362,41 @@ if(SDK_WINE_PREFIX) endif() endif() -opentrack_library(opentrack-tracker-udp ftnoir_tracker_udp) -opentrack_library(opentrack-tracker-freepie-udp ftnoir_tracker_freepie-udp) +#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) + 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) + #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}) 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}) +#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 opentrack-compat ${SDK_HT} ${SDK_HT_FLANDMARK}) +#link_with_dinput8(opentrack-tracker-ht) +#target_link_libraries(opentrack-tracker-ht ${OpenCV_LIBS}) +#target_include_directories(opentrack-tracker-ht SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS}) +#endif() - if(SDK_HT AND SDK_HT_FLANDMARK) - opentrack_library(opentrack-tracker-ht ftnoir_tracker_ht) - target_link_libraries(opentrack-tracker-ht opentrack-compat ${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) +#opentrack_library(opentrack-tracker-ht ftnoir_tracker_ht) +#target_link_libraries(opentrack-tracker-ht opentrack-compat) +#link_with_dinput8(opentrack-tracker-ht) + +#link_with_dinput8(opentrack-tracker-joystick) -if(SDK_RIFT) +if(SDK_RIFT AND FALSE) set(link-flags) set(c-flags) if(APPLE) @@ -417,7 +427,7 @@ if(SDK_RIFT) endif() endif() -if(SDK_HYDRA) +if(SDK_HYDRA AND FALSE) 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) @@ -486,11 +496,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") @@ -504,6 +516,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}) @@ -529,7 +543,6 @@ 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 .) if(NOT WIN32 AND SDK_WINE_PREFIX AND NOT SDK_WINE_NO_WRAPPER) install(FILES "${CMAKE_BINARY_DIR}/opentrack-wrapper-wine.exe.so" |