| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- cmake_minimum_required(VERSION 3.16)
- project(q6_felgo_iot VERSION 0.1 LANGUAGES CXX)
- set(CMAKE_AUTOMOC ON)
- set(CMAKE_CXX_STANDARD 11)
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
- add_compile_definitions(QT_DEPRECATED_WARNINGS)
- add_compile_definitions(ACCESS_RAW_DESCRIPTORS)
- # 设置可能的库列表
- set(OPENCV_LIB_PATHS
- ##第三方库的绝对路径
- ${PROJECT_SOURCE_DIR}/../Lib/opencv451/staticlibs/arm64-v8a
- )
- set(OPENCV_LIB_3RDPATHS
- ##第三方库的绝对路径
- ${PROJECT_SOURCE_DIR}/../Lib/opencv451/3rdparty/libs/arm64-v8a
- )
- set(SPDLOG_LIB_PATHS
- ##第三方库的绝对路径/
- ${PROJECT_SOURCE_DIR}/../Lib/Spdlog/Android/felgo
- )
- set(CURL_LIB_PATHS
- ##第三方库的绝对路径/
- ${PROJECT_SOURCE_DIR}/../Lib/curl
- )
- set(MVS_LIB_PATHS
- ##第三方库的绝对路径
- ${PROJECT_SOURCE_DIR}/../Lib/mvs/arm64-v8a
- )
- set(LIBUVC_PATH
- #libuvc库路径
- ${PROJECT_SOURCE_DIR}/../Lib/libuvc/Android-Arm-v8a
- )
- find_package(Felgo REQUIRED)
- find_package(Qt6 COMPONENTS Core Quick SerialPort Sql Multimedia Mqtt TextToSpeech Positioning ShaderTools Widgets Svg REQUIRED)
- #find_package(FelgoLive REQUIRED)
- # Project identifier and version
- # More information: https://felgo.com/doc/felgo-publishing/#project-configuration
- set(PRODUCT_IDENTIFIER "com.yfkj.cb.Q6iot")
- set(PRODUCT_VERSION_NAME "1.0.0")
- set(PRODUCT_VERSION_CODE 1)
- # Set either "test" or "publish" stage:产品状态,测试?发布
- set(PRODUCT_STAGE "test")
- # Optionally set a license key that is used instead of the license key from
- # main.qml file (App::licenseKey for your app or GameWindow::licenseKey for your game)
- # Only used for local builds and Felgo Cloud Builds (https://felgo.com/cloud-builds)
- # Not used if using Felgo Live
- set(PRODUCT_LICENSE_KEY "7A0F7761276CA0ACFD172072656BA4B6567C0D73526F505C4383F731A317F0756F5FA09CD0B3CD0D0F30279EC5EA2D0FD851E07D4E59CDB32E3C5E26B341969809B11E2051E4881C86B38D72897C0808F5593230C44D3B5B3C4929986F4354F11BE16FB196173178BE2D52B4BD4803CCF2BC85B3E96B0023CA0904B3DEDEC45EC24ECD27EAABCE9DA4A1EB5CDA9B340C4691E6F8487D894BD777574A6A0FF22AAF95815969D68CC8C31798E2B0B5366346236DFAEF6CD2FE6596930C402195EAFA06ECB608B90947EA8CA20D97EC36A0D57B87288EBC33AEFFE2B124FB741972B70D8178E14690C4409774487F7F0C4A2B8F6C48CA3EC9A81075CB50EB46D9A6775DE013346B616165EDC9D2064C6DC3F5B51227B1685449BB441DFC11876CD23813C3737107B6BEC44EBC1B691A45E6")
- #set(FELGO_PLUGINS)
- # Find all QML/JS files for the QML compiler:
- file(GLOB_RECURSE QmlFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} qml/*.qml qml/*.js)
- # Find all non-QML/JS files in the qml and assets folder to add as resources:
- file(GLOB_RECURSE AssetsFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} assets/* qml/*)
- list(REMOVE_ITEM AssetsFiles ${QmlFiles})
- ## 头文件
- include_directories(header)
- include_directories(${PROJECT_SOURCE_DIR}/../Lib/opencv451/header)
- include_directories(${PROJECT_SOURCE_DIR}/../Lib/spdlog/header)
- include_directories(${PROJECT_SOURCE_DIR}/../Lib/curl/header)
- include_directories(${PROJECT_SOURCE_DIR}/../Lib/libuvc/Android-Arm-v8a/header)
- include_directories(${PROJECT_SOURCE_DIR}/../Lib/mvs/includes)
- qt_add_executable(q6_felgo_iot
- header/main.h
- #header/userfunc.h
- header/mserial.h
- header/ImageStitcher.h
- header/cameramanager.h
- header/SerialEvent.h
- header/m_opencv.h
- header/m_workthread.h
- header/m_json.h
- header/mqtthandler.h
- header/ymodem.h
- header/m_loger.h
- header/EasyTableModel.h
- header/mysql.h
- header/customitem.h
- header/TreeModel.h
- header/app_fileHandle.h
- header/app_curlFunc.h
- #header/camerahandler.h
- src/main.cpp
- src/mserial.cpp
- src/ImageStitcher.cpp
- #src/userfunc.cpp
- src/cameramanager.cpp
- src/m_opencv.cpp
- src/m_workthread.cpp
- src/m_json.cpp
- src/mqtthandler.cpp
- src/ymodem.cpp
- src/m_loger.cpp
- src/EasyTableModel.cpp
- src/mysql.cpp
- src/customitem.cpp
- src/app_curlFunc.cpp
- src/TreeModel.cpp
- ${QmlFiles}
- ${AssetsFiles}
- )
- felgo_configure_executable(q6_felgo_iot)
- # Deploy resources to build folder/package directly
- # comment for publishing
- deploy_resources("${QmlFiles};${AssetsFiles}")
- # Add QML files and resources to QML module to included them via QRC automatically:
- # 添加资源文件
- set(QRC_FILES
- resources.qrc
- )
- qt_add_resources(QRC_SOURCES ${QRC_FILES})
- qt_add_shaders(q6_felgo_iot "shaders"
- BATCHABLE
- PRECOMPILE
- OPTIMIZED
- PREFIX
- "/"
- FILES
- "shaders/mandelbrot.vert"
- "shaders/mandelbrot.frag"
- )
- ## 链接路径
- if(WIN32)
- message(STATUS ${PROJECT_SOURCE_DIR})
- message(STATUS "windows paltform.")
- link_directories(../Lib/Spdlog/win)
- link_directories(../Lib/opencv451/libs/x64/mingw/bin)
- link_directories(../Lib/curl/win)
- elseif(ANDROID)
- message(STATUS "android palform.")
- message(STATUS "${PROJECT_SOURCE_DIR}/Lib/Spdlog/Android")
- #link_directories(${PROJECT_SOURCE_DIR}/Lib/Spdlog/Android)
- link_directories(${PROJECT_SOURCE_DIR}/Lib/opencv451/staticlibs/arm64-v8a)
- link_directories(${OPENCV_LIB_3RDPATHS})
- link_directories(${PROJECT_SOURCE_DIR}/Lib/opencv451)
- link_directories(${PROJECT_SOURCE_DIR}/Lib/zlib)
- link_directories(${PROJECT_SOURCE_DIR}/Lib/libuvc/Android-Arm-v8a)
- endif()
- # NOTE: for PUBLISHING, perform the following steps:
- # 1. comment the deploy_resources line above, to avoid shipping your qml files with the application (instead they get compiled to the app binary)
- # 2. uncomment the QML_FILES and RESOURCES above; this compiles your qml files and js files to the app binary and protects your source code
- # 3. change the setMainQmlFile() call in main.cpp to the one starting with "qrc:/" - this loads the qml files from the resources
- # for more details see the "Deployment Guides" in the Felgo Documentation
- # during development, use the deploy_resources because you then get shorter compilation times (the qml files do not need to be compiled to the binary but are just copied)
- # also, for quickest deployment on Desktop disable the "Shadow Build" option in Projects/Builds - you can then select "Run Without Deployment" from the Build menu in Qt Creator if you only changed QML files; this speeds up application start, because your app is not copied & re-compiled but just re-interpreted
- target_compile_definitions(q6_felgo_iot
- PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
- target_link_libraries(q6_felgo_iot PRIVATE Felgo)
- target_link_libraries(q6_felgo_iot PRIVATE Qt6::Core Qt6::CorePrivate Qt6::Quick Qt6::SerialPort Qt6::Sql Qt6::Multimedia Qt6::Mqtt Qt6::TextToSpeech Qt6::Positioning Qt6::ShaderTools Qt6::Widgets Qt6::Svg mediandk)
- if (ANDROID)
- target_link_libraries(q6_felgo_iot
- PRIVATE ${CURL_LIB_PATHS}/libcurl.so)
- target_link_libraries(q6_felgo_iot PRIVATE ${SPDLOG_LIB_PATHS}/libspdlog.a)
- target_link_libraries(q6_felgo_iot
- PRIVATE libz.so)
- target_link_libraries(q6_felgo_iot
- PRIVATE ${LIBUVC_PATH}/libusb1.0.so ${LIBUVC_PATH}/libuvc.so)
- target_link_libraries(q6_felgo_iot
- PRIVATE
- ${MVS_LIB_PATHS}/libCppUnit_gcc49_v3_0.so
- ${MVS_LIB_PATHS}/libGCBase_gcc49_v3_0.so
- ${MVS_LIB_PATHS}/libGenApi_gcc49_v3_0.so
- ${MVS_LIB_PATHS}/libLog_gcc49_v3_0.so
- ${MVS_LIB_PATHS}/libMathParser_gcc49_v3_0.so
- ${MVS_LIB_PATHS}/libMediaProcess.so
- ${MVS_LIB_PATHS}/libMvCameraControl.so
- ${MVS_LIB_PATHS}/libMvCameraControlWrapper.so
- ${MVS_LIB_PATHS}/libMVGigEVisionSDK.so
- ${MVS_LIB_PATHS}/libMvUsb3vTL.so
- ${MVS_LIB_PATHS}/libNodeMapData_gcc49_v3_0.so
- ${MVS_LIB_PATHS}/libXmlParser_gcc49_v3_0.so)
- target_link_libraries(q6_felgo_iot
- PRIVATE
- ${OPENCV_LIB_3RDPATHS}/libade.a
- ${OPENCV_LIB_3RDPATHS}/libcpufeatures.a
- ${OPENCV_LIB_3RDPATHS}/libIlmImf.a
- ${OPENCV_LIB_3RDPATHS}/libittnotify.a
- ${OPENCV_LIB_3RDPATHS}/liblibjpeg-turbo.a
- ${OPENCV_LIB_3RDPATHS}/liblibopenjp2.a
- ${OPENCV_LIB_3RDPATHS}/liblibpng.a
- ${OPENCV_LIB_3RDPATHS}/liblibprotobuf.a
- ${OPENCV_LIB_3RDPATHS}/liblibtiff.a
- ${OPENCV_LIB_3RDPATHS}/liblibwebp.a
- ${OPENCV_LIB_3RDPATHS}/libquirc.a
- ${OPENCV_LIB_3RDPATHS}/libtegra_hal.a)
- target_link_libraries(q6_felgo_iot
- PRIVATE
- ${OPENCV_LIB_PATHS}/libopencv_calib3d.a
- ${OPENCV_LIB_PATHS}/libopencv_core.a
- ${OPENCV_LIB_PATHS}/libopencv_dnn.a
- ${OPENCV_LIB_PATHS}/libopencv_features2d.a
- ${OPENCV_LIB_PATHS}/libopencv_flann.a
- ${OPENCV_LIB_PATHS}/libopencv_gapi.a
- ${OPENCV_LIB_PATHS}/libopencv_highgui.a
- ${OPENCV_LIB_PATHS}/libopencv_imgcodecs.a
- ${OPENCV_LIB_PATHS}/libopencv_imgproc.a
- ${OPENCV_LIB_PATHS}/libopencv_ml.a
- ${OPENCV_LIB_PATHS}/libopencv_objdetect.a
- ${OPENCV_LIB_PATHS}/libopencv_photo.a
- ${OPENCV_LIB_PATHS}/libopencv_stitching.a
- ${OPENCV_LIB_PATHS}/libopencv_video.a
- ${OPENCV_LIB_PATHS}/libopencv_videoio.a
- ${OPENCV_LIB_PATHS}/libopencv_xfeatures2d.a
- )
- else()
- #target_link_libraries(appq6_felgo_iot
- # PRIVATE
- # libopencv_calib3d451.dll
- # libopencv_core451.dll
- # libopencv_dnn451.dll
- # libopencv_features2d451.dll
- # libopencv_flann451.dll
- # libopencv_gapi451.dll
- # libopencv_highgui451.dll
- # libopencv_imgcodecs451.dll
- # libopencv_imgproc451.dll
- # libopencv_ml451.dll
- # libopencv_objdetect451.dll
- # libopencv_photo451.dll
- # libopencv_stitching451.dll
- # libopencv_video451.dll
- # libopencv_videoio451.dll
- # libopencv_xfeatures2d451.dll)
- #target_link_libraries(appq6_felgo_iot
- # PRIVATE libcurl.dll)
- endif()
- # uncomment this line to add the Live Client Module and use live reloading with your custom C++ code
- # for the remaining steps to build a custom Live Code Reload app see here: https://felgo.com/custom-code-reload-app/
- #find_package(FelgoLive REQUIRED)
- #target_link_libraries(appq6_felgo_iot PRIVATE FelgoLive)
|