feat: integrate tactile stream decoding
This commit is contained in:
187
CMakeLists.txt
187
CMakeLists.txt
@@ -1,94 +1,129 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(touchsensor VERSION 2.0.0 LANGUAGES CXX)
|
||||
|
||||
set(BUILD_EXAMPLE ON)
|
||||
option(BUILD_EXAMPLE "Build the cpstream demo executable" ON)
|
||||
set(QT_VERSION Qt6 CACHE STRING "Qt major version to use")
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
add_compile_options(-Os -O3)
|
||||
add_subdirectory("serial")
|
||||
|
||||
set(QT_VERSION Qt6)
|
||||
list(APPEND CMAKE_PREFIX_PATH
|
||||
"D:/Environment/include"
|
||||
"D:/Environment/lib"
|
||||
)
|
||||
|
||||
find_package(${QT_VERSION} REQUIRED COMPONENTS Widgets Network PrintSupport)
|
||||
find_package(Eigen3 REQUIRED)
|
||||
|
||||
include_directories(.)
|
||||
|
||||
file(
|
||||
GLOB_RECURSE PROJECT_SOURCE
|
||||
CONFIGURE_DEPENDS
|
||||
# Project source
|
||||
"modern-qt/*.cc"
|
||||
# Custom signals
|
||||
"modern-qt/widget/sliders.hh"
|
||||
)
|
||||
add_library(
|
||||
modern-qt SHARED
|
||||
${PROJECT_SOURCE}
|
||||
modern-qt/widget/select.hh
|
||||
modern-qt/widget/select.impl.hh
|
||||
)
|
||||
target_link_libraries(
|
||||
modern-qt PUBLIC
|
||||
${QT_VERSION}::Widgets
|
||||
${QT_VERSION}::Network
|
||||
)
|
||||
|
||||
file(
|
||||
GLOB_RECURSE WIDGETS_CC
|
||||
CONFIGURE_DEPENDS "components/*.cc"
|
||||
)
|
||||
|
||||
file(
|
||||
GLOB_RECURSE QCUSTOMPLOT_SOURCE
|
||||
CONFIGURE_DEPENDS
|
||||
"qcustomplot/*.cpp"
|
||||
"qcustomplot/*.h"
|
||||
)
|
||||
add_library(
|
||||
qcustomplot SHARED
|
||||
${QCUSTOMPLOT_SOURCE}
|
||||
)
|
||||
target_link_libraries(
|
||||
qcustomplot PUBLIC
|
||||
${QT_VERSION}::Core
|
||||
${QT_VERSION}::Gui
|
||||
${QT_VERSION}::PrintSupport
|
||||
)
|
||||
|
||||
qt_standard_project_setup()
|
||||
add_executable(
|
||||
${PROJECT_NAME}
|
||||
${WIDGETS_CC}
|
||||
main.cc
|
||||
component.hh
|
||||
resources.qrc
|
||||
components/view.cc
|
||||
modern-qt/widget/select.cc
|
||||
components/charts/heatmap.cc
|
||||
components/charts/heatmap.hh
|
||||
components/charts/heatmap.impl.hh
|
||||
dlog/dlog.hh
|
||||
dlog/dlog.cc
|
||||
components/ffmsep/cpdecoder.hh
|
||||
components/ffmsep/cpdecoder.cc
|
||||
components/ffmsep/tactile/tacdec.h
|
||||
components/ffmsep/tactile/tecdec.cc
|
||||
|
||||
file(
|
||||
GLOB_RECURSE MODERN_QT_SOURCES
|
||||
CONFIGURE_DEPENDS
|
||||
"modern-qt/*.cc"
|
||||
)
|
||||
qt6_add_resources(QRC_FILES resources.qrc)
|
||||
target_sources(${PROJECT_NAME} PRIVATE ${QRC_FILES})
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
${QT_VERSION}::Widgets
|
||||
${QT_VERSION}::Network
|
||||
modern-qt
|
||||
qcustomplot
|
||||
serial
|
||||
spdlog
|
||||
set(MODERN_QT_HEADERS
|
||||
modern-qt/widget/select.hh
|
||||
modern-qt/widget/select.impl.hh
|
||||
modern-qt/widget/sliders.hh
|
||||
)
|
||||
add_library(modern-qt SHARED ${MODERN_QT_SOURCES} ${MODERN_QT_HEADERS})
|
||||
target_include_directories(modern-qt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(modern-qt
|
||||
PUBLIC
|
||||
${QT_VERSION}::Widgets
|
||||
${QT_VERSION}::Network
|
||||
Eigen3::Eigen
|
||||
)
|
||||
|
||||
file(
|
||||
GLOB_RECURSE QCUSTOMPLOT_SOURCES
|
||||
CONFIGURE_DEPENDS
|
||||
"qcustomplot/*.cpp"
|
||||
"qcustomplot/*.h"
|
||||
)
|
||||
add_library(qcustomplot SHARED ${QCUSTOMPLOT_SOURCES})
|
||||
target_include_directories(qcustomplot PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(qcustomplot
|
||||
PUBLIC
|
||||
${QT_VERSION}::Core
|
||||
${QT_VERSION}::Gui
|
||||
${QT_VERSION}::PrintSupport
|
||||
)
|
||||
|
||||
file(
|
||||
GLOB_RECURSE COMPONENT_SOURCES
|
||||
CONFIGURE_DEPENDS
|
||||
"components/*.cc"
|
||||
)
|
||||
file(
|
||||
GLOB_RECURSE UTILITY_SOURCES
|
||||
CONFIGURE_DEPENDS
|
||||
"dlog/*.cc"
|
||||
)
|
||||
|
||||
set(FFMSEP_SOURCES
|
||||
components/ffmsep/cpdecoder.cc
|
||||
components/ffmsep/cpstream_core.cc
|
||||
components/ffmsep/tactile/tacdec.cc
|
||||
)
|
||||
set(FFMSEP_HEADERS
|
||||
components/ffmsep/cpdecoder.hh
|
||||
components/ffmsep/cpstream_core.hh
|
||||
components/ffmsep/tactile/tacdec.hh
|
||||
)
|
||||
set(FFMSEP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/components/ffmsep")
|
||||
|
||||
set(TOUCHSENSOR_HEADERS
|
||||
component.hh
|
||||
components/charts/heatmap.hh
|
||||
components/charts/heatmap.impl.hh
|
||||
dlog/dlog.hh
|
||||
${FFMSEP_HEADERS}
|
||||
)
|
||||
|
||||
qt6_add_resources(APP_RESOURCES resources.qrc)
|
||||
|
||||
add_executable(${PROJECT_NAME}
|
||||
${COMPONENT_SOURCES}
|
||||
${UTILITY_SOURCES}
|
||||
${TOUCHSENSOR_HEADERS}
|
||||
main.cc
|
||||
)
|
||||
target_sources(${PROJECT_NAME} PRIVATE ${APP_RESOURCES})
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${FFMSEP_INCLUDE_DIR}
|
||||
)
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${QT_VERSION}::Widgets
|
||||
${QT_VERSION}::Network
|
||||
modern-qt
|
||||
qcustomplot
|
||||
serial
|
||||
setupapi
|
||||
spdlog
|
||||
)
|
||||
|
||||
if(BUILD_EXAMPLE)
|
||||
add_executable(cpstream_demo
|
||||
examples/cpstream_demo.cc
|
||||
${FFMSEP_SOURCES}
|
||||
)
|
||||
target_include_directories(cpstream_demo
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${FFMSEP_INCLUDE_DIR}
|
||||
)
|
||||
target_link_libraries(cpstream_demo PRIVATE serial)
|
||||
target_link_libraries(cpstream_demo PRIVATE setupapi)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user