|
| 1 | +cmake_minimum_required(VERSION 3.16) |
| 2 | + |
| 3 | +project(FelgoCV VERSION 0.1 LANGUAGES CXX) |
| 4 | + |
| 5 | +set(CMAKE_AUTOMOC ON) |
| 6 | +set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 7 | + |
| 8 | +find_package(Felgo REQUIRED) |
| 9 | + |
| 10 | +# Project identifier and version |
| 11 | +# More information: https://felgo.com/doc/felgo-publishing/#project-configuration |
| 12 | +set(PRODUCT_IDENTIFIER "com.yourcompany.wizardEVAP.FelgoCV") |
| 13 | +set(PRODUCT_VERSION_NAME "1.0.0") |
| 14 | +set(PRODUCT_VERSION_CODE 1) |
| 15 | + |
| 16 | +# Set either "test" or "publish" stage: |
| 17 | +set(PRODUCT_STAGE "test") |
| 18 | + |
| 19 | +# Optionally set a license key that is used instead of the license key from |
| 20 | +# main.qml file (App::licenseKey for your app or GameWindow::licenseKey for your game) |
| 21 | +# Only used for local builds and Felgo Cloud Builds (https://felgo.com/cloud-builds) |
| 22 | +# Not used if using Felgo Live |
| 23 | +set(PRODUCT_LICENSE_KEY "") |
| 24 | + |
| 25 | +set(FELGO_PLUGINS |
| 26 | +) |
| 27 | + |
| 28 | +# Find all QML/JS files for the QML compiler: |
| 29 | +file(GLOB_RECURSE QmlFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} qml/*.qml qml/*.js) |
| 30 | + |
| 31 | +# Find all non-QML/JS files in the qml and assets folder to add as resources: |
| 32 | +file(GLOB_RECURSE AssetsFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} assets/* qml/*) |
| 33 | +list(REMOVE_ITEM AssetsFiles ${QmlFiles}) |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +qt_add_executable(appFelgoCV |
| 39 | + main.cpp |
| 40 | + ${QmlFiles} |
| 41 | + ${AssetsFiles} |
| 42 | +) |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +felgo_configure_executable(appFelgoCV) |
| 47 | + |
| 48 | +# Deploy resources to build folder/package directly |
| 49 | +# comment for publishing |
| 50 | +deploy_resources("${QmlFiles};${AssetsFiles}") |
| 51 | + |
| 52 | +# Add QML files and resources to QML module to included them via QRC automatically: |
| 53 | +qt_add_qml_module(appFelgoCV |
| 54 | + URI FelgoCV |
| 55 | + VERSION 1.0 |
| 56 | +# uncomment for publishing: |
| 57 | +# QML_FILES ${QmlFiles} |
| 58 | +# RESOURCES ${AssetsFiles} |
| 59 | + NO_RESOURCE_TARGET_PATH |
| 60 | +) |
| 61 | + |
| 62 | +add_subdirectory(ocvdecoder ${CMAKE_BINARY_DIR}/ocvdecoder) |
| 63 | + |
| 64 | + |
| 65 | +# NOTE: for PUBLISHING, perform the following steps: |
| 66 | +# 1. comment the deploy_resources line above, to avoid shipping your qml files with the application (instead they get compiled to the app binary) |
| 67 | +# 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 |
| 68 | +# 3. change the setMainQmlFile() call in main.cpp to the one starting with "qrc:/" - this loads the qml files from the resources |
| 69 | +# for more details see the "Deployment Guides" in the Felgo Documentation |
| 70 | + |
| 71 | +# 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) |
| 72 | +# 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 |
| 73 | + |
| 74 | +target_compile_definitions(appFelgoCV |
| 75 | + PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>) |
| 76 | + |
| 77 | +target_link_libraries(appFelgoCV PRIVATE Felgo ocvdecoder) |
| 78 | + |
| 79 | +target_include_directories(appFelgoCV PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/vendor/opencv/include/) |
| 80 | + |
| 81 | +#target_link_libraries(appFelgoCV PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/vendor/opencv/ios/libfatstatic.a) |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | +# uncomment this line to add the Live Client Module and use live reloading with your custom C++ code |
| 86 | +# for the remaining steps to build a custom Live Code Reload app see here: https://felgo.com/custom-code-reload-app/ |
| 87 | +#find_package(FelgoLive REQUIRED) |
| 88 | +#target_link_libraries(appFelgoCV PRIVATE FelgoLive) |
0 commit comments