SmartLockerTools/Analyser/CMakeLists.txt

109 lines
2.9 KiB
CMake
Raw Normal View History

2024-07-23 20:03:19 +08:00
project(Analyser VERSION 0.3 LANGUAGES C CXX)
2024-06-21 18:08:23 +08:00
set(APPLICATION_NAME "掌静脉测试工具")
2024-06-21 11:33:11 +08:00
2024-10-25 17:18:09 +08:00
find_package(Boost REQUIRED COMPONENTS json)
2024-09-05 16:36:54 +08:00
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Quick QuickTemplates2 SerialPort JpegPrivate BundledLibjpeg)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick QuickTemplates2 SerialPort JpegPrivate BundledLibjpeg)
2024-05-21 21:09:55 +08:00
2024-08-29 11:12:14 +08:00
qt_standard_project_setup(REQUIRES 6.5)
2024-06-21 11:33:11 +08:00
configure_file(Configuration.h.in Configuration.h)
2024-10-03 20:47:45 +08:00
qt_add_executable(Analyser Analyser.rc
2024-05-21 21:09:55 +08:00
main.cpp
2024-06-13 15:41:40 +08:00
Application.h Application.cpp
2024-05-21 21:09:55 +08:00
CategoryLogSinkBackend.h CategoryLogSinkBackend.cpp
ImageDecoder.h ImageDecoder.cpp
2024-05-21 21:09:55 +08:00
ModuleCommunication.h ModuleCommunication.cpp
2024-05-24 10:23:05 +08:00
PalmFeatureTableModel.h PalmFeatureTableModel.cpp
2024-06-13 15:41:40 +08:00
VideoFrameProvider.h VideoFrameProvider.cpp
VideoPlayer.h VideoPlayer.cpp
)
qt_add_qml_module(Analyser
URI Analyser
VERSION 1.0
QML_FILES
2024-08-29 11:12:14 +08:00
qml/Main.qml
2024-06-13 15:41:40 +08:00
qml/ConnectionItem.qml
qml/OperationItem.qml
2024-08-05 17:42:27 +08:00
qml/OtaPage.qml
2024-09-25 18:44:04 +08:00
qml/EnrollVerifyOperations.qml
qml/ExtendedOperations.qml
2024-06-13 15:41:40 +08:00
RESOURCES
resources/successfull.svg
resources/warning.svg
2024-09-25 17:09:00 +08:00
resources/palm-middle.png
2024-11-05 00:23:54 +08:00
QML_FILES qml/LogView.qml
2024-06-13 15:41:40 +08:00
)
target_compile_definitions(Analyser
PRIVATE _CRT_SECURE_NO_WARNINGS
)
2024-09-05 22:33:07 +08:00
if(UNIX)
set_target_properties(Analyser PROPERTIES
SUFFIX .AppImage
)
2024-10-03 20:47:45 +08:00
set(EXECUTABLE_NAME Analyser.AppImage)
else()
set(EXECUTABLE_NAME Analyser.exe)
2024-09-05 22:33:07 +08:00
endif()
2024-06-13 15:41:40 +08:00
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_property(TARGET Analyser PROPERTY
WIN32_EXECUTABLE true
)
endif()
target_include_directories(Analyser
PRIVATE ${FFmpeg_INCLUDE_DIR}
2024-06-21 11:33:11 +08:00
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
2024-06-13 15:41:40 +08:00
)
target_link_directories(Analyser
PRIVATE ${FFmpeg_LIB_DIR}
2024-05-21 21:09:55 +08:00
)
target_link_libraries(Analyser
2024-08-29 11:12:14 +08:00
PRIVATE Fluent
PRIVATE Fluentplugin
2024-05-23 19:58:36 +08:00
PRIVATE Encrypt
PRIVATE Database
2024-06-13 15:41:40 +08:00
PRIVATE Peripheral
PRIVATE avcodec
PRIVATE swscale
PRIVATE avutil
PRIVATE avdevice
PRIVATE avformat
2024-09-05 22:33:07 +08:00
$<$<PLATFORM_ID:Windows>:Ws2_32>
2024-10-25 17:18:09 +08:00
PRIVATE Boost::json
2024-06-13 15:41:40 +08:00
PRIVATE Qt${QT_VERSION_MAJOR}::Quick
PRIVATE Qt${QT_VERSION_MAJOR}::QuickTemplates2
2024-05-21 21:09:55 +08:00
PRIVATE Qt${QT_VERSION_MAJOR}::SerialPort
PRIVATE Qt${QT_VERSION_MAJOR}::JpegPrivate
PRIVATE Qt${QT_VERSION_MAJOR}::BundledLibjpeg
2024-05-21 21:09:55 +08:00
)
2024-10-03 20:47:45 +08:00
install(TARGETS Analyser
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
configure_file(
${CMAKE_SOURCE_DIR}/resources/run.sh.in
${CMAKE_CURRENT_BINARY_DIR}/scripts/${EXECUTABLE_NAME}
@ONLY
)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/scripts/${EXECUTABLE_NAME} DESTINATION .)
qt_generate_deploy_qml_app_script(
TARGET Analyser
OUTPUT_SCRIPT deploy_script
NO_UNSUPPORTED_PLATFORM_ERROR
NO_TRANSLATIONS
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM
)
install(SCRIPT ${deploy_script})