Files
ts-qt/CMakeLists.txt
2025-10-23 17:22:22 +08:00

95 lines
2.1 KiB
CMake

cmake_minimum_required(VERSION 3.20)
project(touchsensor VERSION 2.0.0 LANGUAGES CXX)
set(BUILD_EXAMPLE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 23)
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)
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
)
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
)