summaryrefslogtreecommitdiffstats
path: root/examples/sensors/grue
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sensors/grue')
-rw-r--r--examples/sensors/grue/CMakeLists.txt56
-rw-r--r--examples/sensors/grue/console_app/CMakeLists.txt36
-rw-r--r--examples/sensors/grue/import/import.pro1
-rw-r--r--examples/sensors/grue/lib/CMakeLists.txt38
-rw-r--r--examples/sensors/grue/plugin/CMakeLists.txt56
5 files changed, 187 insertions, 0 deletions
diff --git a/examples/sensors/grue/CMakeLists.txt b/examples/sensors/grue/CMakeLists.txt
new file mode 100644
index 00000000..043330d3
--- /dev/null
+++ b/examples/sensors/grue/CMakeLists.txt
@@ -0,0 +1,56 @@
+cmake_minimum_required(VERSION 3.14)
+project(grue_app LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/sensors/grue")
+
+find_package(Qt6 COMPONENTS Quick)
+
+qt_add_executable(grue_app
+ main.cpp
+)
+set_target_properties(grue_app PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+if(TARGET Qt::Quick)
+ target_link_libraries(grue_app PUBLIC
+ Qt::Quick
+ )
+endif()
+
+# Resources:
+set(qml_resource_files
+ "grue.png"
+ "grue.qml"
+)
+
+qt6_add_resources(grue_app "qml"
+ PREFIX
+ "/"
+ FILES
+ ${qml_resource_files}
+)
+
+install(TARGETS grue_app
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
+
+add_subdirectory(lib)
+add_subdirectory(plugin)
+add_subdirectory(console_app)
+if(TARGET Qt::Quick)
+ add_subdirectory(import)
+endif()
diff --git a/examples/sensors/grue/console_app/CMakeLists.txt b/examples/sensors/grue/console_app/CMakeLists.txt
new file mode 100644
index 00000000..e6364e48
--- /dev/null
+++ b/examples/sensors/grue/console_app/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from console_app.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(detect_grue LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/sensors/grue")
+
+find_package(Qt6 COMPONENTS Core Sensors)
+
+qt_add_executable(detect_grue
+ main.cpp
+)
+set_target_properties(detect_grue PROPERTIES
+ WIN32_EXECUTABLE FALSE
+ MACOSX_BUNDLE FALSE
+)
+target_link_libraries(detect_grue PUBLIC
+ Qt::Core
+ Qt::Sensors
+)
+
+install(TARGETS detect_grue
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sensors/grue/import/import.pro b/examples/sensors/grue/import/import.pro
index 17d7713e..f9d5108d 100644
--- a/examples/sensors/grue/import/import.pro
+++ b/examples/sensors/grue/import/import.pro
@@ -1,5 +1,6 @@
TEMPLATE = lib
CONFIG += plugin
+QML_IMPORT_VERSION = $$QT_VERSION
TARGET = $$qtLibraryTarget(declarative_grue)
diff --git a/examples/sensors/grue/lib/CMakeLists.txt b/examples/sensors/grue/lib/CMakeLists.txt
new file mode 100644
index 00000000..264ffd32
--- /dev/null
+++ b/examples/sensors/grue/lib/CMakeLists.txt
@@ -0,0 +1,38 @@
+cmake_minimum_required(VERSION 3.14)
+project(gruesensor LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/sensors/grue")
+
+find_package(Qt6 COMPONENTS Core Sensors)
+
+qt_add_executable(gruesensor
+ gruesensor.cpp gruesensor.h gruesensor_p.h
+)
+set_target_properties(gruesensor PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+target_compile_definitions(gruesensor PUBLIC
+ QT_BUILD_GRUE_LIB
+)
+
+target_link_libraries(gruesensor PUBLIC
+ Qt::Core
+ Qt::Sensors
+)
+
+install(TARGETS gruesensor
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sensors/grue/plugin/CMakeLists.txt b/examples/sensors/grue/plugin/CMakeLists.txt
new file mode 100644
index 00000000..d55cc2dc
--- /dev/null
+++ b/examples/sensors/grue/plugin/CMakeLists.txt
@@ -0,0 +1,56 @@
+# Generated from plugin.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(qtsensors_grue LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/sensors/grue/sensors")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Sensors)
+
+qt_add_plugin(qtsensors_grue)
+target_sources(qtsensors_grue PRIVATE
+ gruesensorimpl.cpp gruesensorimpl.h
+ main.cpp
+)
+set_target_properties(qtsensors_grue PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+target_include_directories(qtsensors_grue PUBLIC
+ ../lib
+)
+
+target_link_libraries(qtsensors_grue PUBLIC
+ Qt::Core
+ Qt::Sensors
+ gruesensor
+)
+
+if(MACOS)
+ target_link_libraries(qtsensors_grue PUBLIC
+ # Remove: L${CMAKE_CURRENT_BINARY_DIR}/../grue_app.app/Contents/Frameworks
+ )
+endif()
+
+if(NOT MACOS)
+ target_link_libraries(qtsensors_grue PUBLIC
+ # Remove: L${CMAKE_CURRENT_BINARY_DIR}/..
+ )
+endif()
+
+install(TARGETS qtsensors_grue
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)