first commit
This commit is contained in:
commit
9bfa1e11fe
1 changed files with 1751 additions and 0 deletions
97
CMakeLists.txt
Normal file
97
CMakeLists.txt
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(waterLevelSensor VERSION 0.1 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Quick Network)
|
||||
|
||||
qt_standard_project_setup(REQUIRES 6.9)
|
||||
|
||||
qt_add_executable(appwaterLevelSensor
|
||||
main.cpp
|
||||
images.qrc
|
||||
)
|
||||
|
||||
|
||||
if(ANDROID)
|
||||
qt_add_library(service SHARED
|
||||
servicemain.cpp
|
||||
service.h service.cpp
|
||||
)
|
||||
set_property(TARGET appwaterLevelSensor APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/android)
|
||||
set_property(TARGET service APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/android)
|
||||
|
||||
|
||||
target_link_libraries(service
|
||||
PRIVATE
|
||||
Qt::Core
|
||||
Qt::CorePrivate
|
||||
Qt::Network
|
||||
Qt::Quick
|
||||
)
|
||||
qt_add_qml_module(appwaterLevelSensor
|
||||
URI waterLevelSensor
|
||||
QML_FILES
|
||||
Main.qml
|
||||
RESOURCES
|
||||
RESOURCES images.qrc
|
||||
SOURCES moving_container.h
|
||||
SOURCES configinterface.h configinterface.cpp
|
||||
SOURCES udplistener.h udplistener.cpp
|
||||
SOURCES service.h
|
||||
)
|
||||
target_link_libraries(appwaterLevelSensor
|
||||
PRIVATE Qt6::Quick Qt6::Network service
|
||||
)
|
||||
|
||||
qt_finalize_executable(appwaterLevelSensor)
|
||||
add_dependencies(appwaterLevelSensor service)
|
||||
|
||||
qt_generate_deploy_app_script(
|
||||
TARGET appwaterLevelSensor
|
||||
OUTPUT_SCRIPT deploy_script
|
||||
NO_UNSUPPORTED_PLATFORM_ERROR
|
||||
)
|
||||
install(SCRIPT ${deploy_script})
|
||||
|
||||
endif()
|
||||
if(NOT ANDROID)
|
||||
qt_add_qml_module(appwaterLevelSensor
|
||||
URI waterLevelSensor
|
||||
QML_FILES
|
||||
Main.qml
|
||||
RESOURCES
|
||||
RESOURCES images.qrc
|
||||
SOURCES udplistener.h udplistener.cpp
|
||||
SOURCES moving_container.h
|
||||
SOURCES configinterface.h configinterface.cpp
|
||||
)
|
||||
|
||||
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
||||
# If you are developing for iOS or macOS you should consider setting an
|
||||
# explicit, fixed bundle identifier manu ally though.
|
||||
set_target_properties(appwaterLevelSensor PROPERTIES
|
||||
# MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appwaterLevelSensor
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||
MACOSX_BUNDLE TRUE
|
||||
WIN32_EXECUTABLE TRUE
|
||||
)
|
||||
|
||||
target_link_libraries(appwaterLevelSensor
|
||||
PRIVATE Qt6::Quick Qt6::Network
|
||||
)
|
||||
|
||||
qt_finalize_executable(appwaterLevelSensor)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS appwaterLevelSensor
|
||||
BUNDLE DESTINATION .
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
endif()
|
||||
Loading…
Reference in a new issue