summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt189
1 files changed, 37 insertions, 152 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8b36cb27..aa551885 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,8 @@ if(GIT_FOUND)
git_describe(OPENTRACK__COMMIT --tags --always)
endif()
+include_directories(${CMAKE_SOURCE_DIR})
+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_COMPILER_IS_GNUCC TRUE)
set(CMAKE_COMPILER_IS_GNUCXX TRUE)
@@ -39,6 +41,7 @@ SET(CMAKE_SKIP_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOMOC_RELAXED_MODE ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_definitions(-DOPENTRACK_API -DIN_OPENTRACK)
@@ -174,171 +177,53 @@ else()
include_directories("qxt-mini/")
endif()
endif()
-# main app
-file(GLOB opentrack-lib-c "opentrack-api/*.cpp" "facetracknoir/global-settings.cpp")
-file(GLOB opentrack-lib-h "opentrack-api/*.h" "facetracknoir/global-settings.h")
+# qt being broken as usual
+set(EXTRA-MOCS "${CMAKE_SOURCE_DIR}/facetracknoir/options.h")
-file(GLOB opentrack-bin-c "facetracknoir/*.cpp" "facetracknoir/*.rc")
-file(GLOB opentrack-bin-h "facetracknoir/*.h" "facetracknoir/*.hpp")
-file(GLOB opentrack-bin-ui "facetracknoir/*.ui")
-file(GLOB opentrack-bin-rc "facetracknoir/*.qrc")
-QT5_WRAP_UI(opentrack-bin-uih ${opentrack-bin-ui})
-QT5_ADD_RESOURCES(opentrack-bin-rcc ${opentrack-bin-rc})
+macro(opentrack_module n dir)
+ file(GLOB ${n}-c "${dir}/*.cpp" "${dir}/*.h" ${EXTRA-MOCS})
+ file(GLOB ${n}-ui "${dir}/*.ui")
+ file(GLOB ${n}-rc "${dir}/*.qrc")
+ QT5_WRAP_UI(${n}-uih ${${n}-ui})
+ QT5_ADD_RESOURCES(${n}-rcc ${${n}-rc})
+endmacro()
-file(GLOB opentrack-pose-widget-c "ftnoir_posewidget/*.cpp")
-file(GLOB opentrack-pose-widget-h "ftnoir_posewidget/*.h")
-file(GLOB opentrack-pose-widget-rc "ftnoir_posewidget/*.qrc")
-QT5_ADD_RESOURCES(opentrack-pose-widget-rcc ${opentrack-pose-widget-rc})
+file(GLOB opentrack-lib-c "opentrack-api/*.cpp" "facetracknoir/global-settings.cpp")
+file(GLOB opentrack-lib-h "opentrack-api/*.h" "facetracknoir/global-settings.h")
-file(GLOB opentrack-spline-widget-c "qfunctionconfigurator/*.cpp")
-file(GLOB opentrack-spline-widget-h "qfunctionconfigurator/*.h")
+opentrack_module(opentrack-bin facetracknoir)
+opentrack_module(opentrack-pose-widget ftnoir_posewidget)
+opentrack_module(opentrack-spline-widget qfunctionconfigurator)
# filters
-file(GLOB opentrack-filter-accela-c "ftnoir_filter_accela/*.cpp")
-file(GLOB opentrack-filter-accela-h "ftnoir_filter_accela/*.h")
-file(GLOB opentrack-filter-accela-ui "ftnoir_filter_accela/*.ui")
-file(GLOB opentrack-filter-accela-rc "ftnoir_filter_accela/*.qrc")
-QT5_WRAP_UI(opentrack-filter-accela-uih ${opentrack-filter-accela-ui})
-QT5_ADD_RESOURCES(opentrack-filter-accela-rcc ${opentrack-filter-accela-rc})
-
-file(GLOB opentrack-filter-kalman-c "ftnoir_filter_kalman/*.cpp")
-file(GLOB opentrack-filter-kalman-h "ftnoir_filter_kalman/*.h")
-file(GLOB opentrack-filter-kalman-ui "ftnoir_filter_kalman/*.ui")
-file(GLOB opentrack-filter-kalman-rc "ftnoir_filter_kalman/*.qrc")
-QT5_WRAP_UI(opentrack-filter-kalman-uih ${opentrack-filter-kalman-ui})
-QT5_ADD_RESOURCES(opentrack-filter-kalman-rcc ${opentrack-filter-kalman-rc})
-
-file(GLOB opentrack-filter-ewma-c "ftnoir_filter_ewma2/*.cpp")
-file(GLOB opentrack-filter-ewma-h "ftnoir_filter_ewma2/*.h")
-file(GLOB opentrack-filter-ewma-ui "ftnoir_filter_ewma2/*.ui")
-file(GLOB opentrack-filter-ewma-rc "ftnoir_filter_ewma2/*.qrc")
-QT5_WRAP_UI(opentrack-filter-ewma-uih ${opentrack-filter-ewma-ui})
-QT5_ADD_RESOURCES(opentrack-filter-ewma-rcc ${opentrack-filter-ewma-rc})
+opentrack_module(opentrack-filter-accela ftnoir_filter_accela)
+opentrack_module(opentrack-filter-kalman ftnoir_filter_kalman)
+opentrack_module(opentrack-filter-ewma ftnoir_filter_ewma2)
# protocols
-file(GLOB opentrack-proto-fgfs-c "ftnoir_protocol_fg/*.cpp")
-file(GLOB opentrack-proto-fgfs-h "ftnoir_protocol_fg/*.h")
-file(GLOB opentrack-proto-fgfs-ui "ftnoir_protocol_fg/*.ui")
-file(GLOB opentrack-proto-fgfs-rc "ftnoir_protocol_fg/*.qrc")
-QT5_WRAP_UI(opentrack-proto-fgfs-uih ${opentrack-proto-fgfs-ui})
-QT5_ADD_RESOURCES(opentrack-proto-fgfs-rcc ${opentrack-proto-fgfs-rc})
-
-file(GLOB opentrack-proto-fsuipc-c "ftnoir_protocol_fsuipc/*.cpp")
-file(GLOB opentrack-proto-fsuipc-h "ftnoir_protocol_fsuipc/*.h")
-file(GLOB opentrack-proto-fsuipc-ui "ftnoir_protocol_fsuipc/*.ui")
-file(GLOB opentrack-proto-fsuipc-rc "ftnoir_protocol_fsuipc/*.qrc")
-QT5_WRAP_UI(opentrack-proto-fsuipc-uih ${opentrack-proto-fsuipc-ui})
-QT5_ADD_RESOURCES(opentrack-proto-fsuipc-rcc ${opentrack-proto-fsuipc-rc})
-
-file(GLOB opentrack-proto-freetrack-c "ftnoir_protocol_ft/*.cpp")
-file(GLOB opentrack-proto-freetrack-h "ftnoir_protocol_ft/*.h")
-file(GLOB opentrack-proto-freetrack-ui "ftnoir_protocol_ft/*.ui")
-file(GLOB opentrack-proto-freetrack-rc "ftnoir_protocol_ft/*.qrc")
-QT5_WRAP_UI(opentrack-proto-freetrack-uih ${opentrack-proto-freetrack-ui})
-QT5_ADD_RESOURCES(opentrack-proto-freetrack-rcc ${opentrack-proto-freetrack-rc})
-
-file(GLOB opentrack-proto-udp-c "ftnoir_protocol_ftn/*.cpp")
-file(GLOB opentrack-proto-udp-h "ftnoir_protocol_ftn/*.h")
-file(GLOB opentrack-proto-udp-ui "ftnoir_protocol_ftn/*.ui")
-file(GLOB opentrack-proto-udp-rc "ftnoir_protocol_ftn/*.qrc")
-QT5_WRAP_UI(opentrack-proto-udp-uih ${opentrack-proto-udp-ui})
-QT5_ADD_RESOURCES(opentrack-proto-udp-rcc ${opentrack-proto-udp-rc})
-
-file(GLOB opentrack-proto-wine-c "ftnoir_protocol_wine/*.cpp")
-file(GLOB opentrack-proto-wine-h "ftnoir_protocol_wine/*.h")
-file(GLOB opentrack-proto-wine-ui "ftnoir_protocol_wine/*.ui")
-file(GLOB opentrack-proto-wine-rc "ftnoir_protocol_wine/*.qrc")
-QT5_WRAP_UI(opentrack-proto-wine-uih ${opentrack-proto-wine-ui})
-QT5_ADD_RESOURCES(opentrack-proto-wine-rcc ${opentrack-proto-wine-rc})
-
-file(GLOB opentrack-proto-win32-mouse-c "ftnoir_protocol_mouse/*.cpp")
-file(GLOB opentrack-proto-win32-mouse-h "ftnoir_protocol_mouse/*.h")
-file(GLOB opentrack-proto-win32-mouse-ui "ftnoir_protocol_mouse/*.ui")
-file(GLOB opentrack-proto-win32-mouse-rc "ftnoir_protocol_mouse/*.qrc")
-QT5_WRAP_UI(opentrack-proto-win32-mouse-uih ${opentrack-proto-win32-mouse-ui})
-QT5_ADD_RESOURCES(opentrack-proto-win32-mouse-rcc ${opentrack-proto-win32-mouse-rc})
-
-file(GLOB opentrack-proto-simconnect-c "ftnoir_protocol_sc/*.cpp" "ftnoir_protocol_sc/ftnoir-protocol-sc.rc")
-file(GLOB opentrack-proto-simconnect-h "ftnoir_protocol_sc/*.h")
-file(GLOB opentrack-proto-simconnect-ui "ftnoir_protocol_sc/*.ui")
-file(GLOB opentrack-proto-simconnect-rc "ftnoir_protocol_sc/*.qrc")
-QT5_WRAP_UI(opentrack-proto-simconnect-uih ${opentrack-proto-simconnect-ui})
-QT5_ADD_RESOURCES(opentrack-proto-simconnect-rcc ${opentrack-proto-simconnect-rc})
-
-file(GLOB opentrack-proto-vjoy-c "ftnoir_protocol_vjoy/*.cpp")
-file(GLOB opentrack-proto-vjoy-h "ftnoir_protocol_vjoy/*.h")
-file(GLOB opentrack-proto-vjoy-ui "ftnoir_protocol_vjoy/*.ui")
-file(GLOB opentrack-proto-vjoy-rc "ftnoir_protocol_vjoy/*.qrc")
-QT5_WRAP_UI(opentrack-proto-vjoy-uih ${opentrack-proto-vjoy-ui})
-QT5_ADD_RESOURCES(opentrack-proto-vjoy-rcc ${opentrack-proto-vjoy-rc})
-
-file(GLOB opentrack-proto-libevdev-c "ftnoir_protocol_libevdev/*.cpp")
-file(GLOB opentrack-proto-libevdev-h "ftnoir_protocol_libevdev/*.h")
-file(GLOB opentrack-proto-libevdev-ui "ftnoir_protocol_libevdev/*.ui")
-file(GLOB opentrack-proto-libevdev-rc "ftnoir_protocol_libevdev/*.qrc")
-QT5_WRAP_UI(opentrack-proto-libevdev-uih ${opentrack-proto-libevdev-ui})
-QT5_ADD_RESOURCES(opentrack-proto-libevdev-rcc ${opentrack-proto-libevdev-rc})
+opentrack_module(opentrack-proto-fgfs ftnoir_protocol_fg)
+opentrack_module(opentrack-proto-fsuipc ftnoir_protocol_fsuipc)
+opentrack_module(opentrack-proto-freetrack ftnoir_protocol_ft)
+opentrack_module(opentrack-proto-udp ftnoir_protocol_ftn)
+opentrack_module(opentrack-proto-wine ftnoir_protocol_wine)
+opentrack_module(opentrack-proto-win32-mouse ftnoir_protocol_mouse)
+opentrack_module(opentrack-proto-simconnect ftnoir_protocol_sc)
+opentrack_module(opentrack-proto-vjoy ftnoir_protocol_vjoy)
+opentrack_module(opentrack-proto-libevdev ftnoir_protocol_libevdev)
# trackers
-file(GLOB opentrack-tracker-ht-c "ftnoir_tracker_ht/*.cpp")
-file(GLOB opentrack-tracker-ht-h "ftnoir_tracker_ht/*.h")
-file(GLOB opentrack-tracker-ht-ui "ftnoir_tracker_ht/*.ui")
-file(GLOB opentrack-tracker-ht-rc "ftnoir_tracker_ht/*.qrc")
-QT5_WRAP_UI(opentrack-tracker-ht-uih ${opentrack-tracker-ht-ui})
-QT5_ADD_RESOURCES(opentrack-tracker-ht-rcc ${opentrack-tracker-ht-rc})
-
-file(GLOB opentrack-tracker-aruco-c "ftnoir_tracker_aruco/*.cpp")
-file(GLOB opentrack-tracker-aruco-h "ftnoir_tracker_aruco/*.h")
-file(GLOB opentrack-tracker-aruco-ui "ftnoir_tracker_aruco/*.ui")
-file(GLOB opentrack-tracker-aruco-rc "ftnoir_tracker_aruco/*.qrc")
-QT5_WRAP_UI(opentrack-tracker-aruco-uih ${opentrack-tracker-aruco-ui})
-QT5_ADD_RESOURCES(opentrack-tracker-aruco-rcc ${opentrack-tracker-aruco-rc})
-
-file(GLOB opentrack-tracker-pt-c "FTNoIR_Tracker_PT/*.cpp")
-file(GLOB opentrack-tracker-pt-h "FTNoIR_Tracker_PT/*.h")
-file(GLOB opentrack-tracker-pt-ui "FTNoIR_Tracker_PT/*.ui")
-file(GLOB opentrack-tracker-pt-rc "FTNoIR_Tracker_PT/*.qrc")
-QT5_WRAP_UI(opentrack-tracker-pt-uih ${opentrack-tracker-pt-ui})
-QT5_ADD_RESOURCES(opentrack-tracker-pt-rcc ${opentrack-tracker-pt-rc})
-
-file(GLOB opentrack-tracker-udp-c "ftnoir_tracker_udp/*.cpp")
-file(GLOB opentrack-tracker-udp-h "ftnoir_tracker_udp/*.h")
-file(GLOB opentrack-tracker-udp-ui "ftnoir_tracker_udp/*.ui")
-file(GLOB opentrack-tracker-udp-rc "ftnoir_tracker_udp/*.qrc")
-QT5_WRAP_UI(opentrack-tracker-udp-uih ${opentrack-tracker-udp-ui})
-QT5_ADD_RESOURCES(opentrack-tracker-udp-rcc ${opentrack-tracker-udp-rc})
-
-file(GLOB opentrack-tracker-joystick-c "ftnoir_tracker_joystick/*.cpp")
-file(GLOB opentrack-tracker-joystick-h "ftnoir_tracker_joystick/*.h")
-file(GLOB opentrack-tracker-joystick-ui "ftnoir_tracker_joystick/*.ui")
-file(GLOB opentrack-tracker-joystick-rc "ftnoir_tracker_joystick/*.qrc")
-QT5_WRAP_UI(opentrack-tracker-joystick-uih ${opentrack-tracker-joystick-ui})
-QT5_ADD_RESOURCES(opentrack-tracker-joystick-rcc ${opentrack-tracker-joystick-rc})
-
-file(GLOB opentrack-tracker-rift-c "ftnoir_tracker_rift/*.cpp")
-file(GLOB opentrack-tracker-rift-h "ftnoir_tracker_rift/*.h")
-file(GLOB opentrack-tracker-rift-ui "ftnoir_tracker_rift/*.ui")
-file(GLOB opentrack-tracker-rift-rc "ftnoir_tracker_rift/*.qrc")
-QT5_WRAP_UI(opentrack-tracker-rift-uih ${opentrack-tracker-rift-ui})
-QT5_ADD_RESOURCES(opentrack-tracker-rift-rcc ${opentrack-tracker-rift-rc})
-
-file(GLOB opentrack-tracker-hydra-c "ftnoir_tracker_hydra/*.cpp")
-file(GLOB opentrack-tracker-hydra-h "ftnoir_tracker_hydra/*.h")
-file(GLOB opentrack-tracker-hydra-ui "ftnoir_tracker_hydra/*.ui")
-file(GLOB opentrack-tracker-hydra-rc "ftnoir_tracker_hydra/*.qrc")
-QT5_WRAP_UI(opentrack-tracker-hydra-uih ${opentrack-tracker-hydra-ui})
-QT5_ADD_RESOURCES(opentrack-tracker-hydra-rcc ${opentrack-tracker-hydra-rc})
-
-file(GLOB opentrack-tracker-hatire-c "ftnoir_tracker_hatire/*.cpp")
-file(GLOB opentrack-tracker-hatire-h "ftnoir_tracker_hatire/*.h")
-file(GLOB opentrack-tracker-hatire-ui "ftnoir_tracker_hatire/*.ui")
-file(GLOB opentrack-tracker-hatire-rc "ftnoir_tracker_hatire/*.qrc")
-QT5_WRAP_UI(opentrack-tracker-hatire-uih ${opentrack-tracker-hatire-ui})
-QT5_ADD_RESOURCES(opentrack-tracker-hatire-rcc ${opentrack-tracker-hatire-rc})
+opentrack_module(opentrack-tracker-ht ftnoir_tracker_ht)
+opentrack_module(opentrack-tracker-aruco ftnoir_tracker_aruco)
+opentrack_module(opentrack-tracker-pt FTNoIR_Tracker_PT)
+opentrack_module(opentrack-tracker-udp ftnoir_tracker_udp)
+opentrack_module(opentrack-tracker-joystick ftnoir_tracker_joystick)
+opentrack_module(opentrack-tracker-rift ftnoir_tracker_rift)
+opentrack_module(opentrack-tracker-hydra ftnoir_tracker_hydra)
+opentrack_module(opentrack-tracker-hatire ftnoir_tracker_hatire)
file(GLOB opentrack-csv-c "ftnoir_csv/*.cpp")