From 9ff40ad1b2376e66a1af81fb8cd5b7991820d00a Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Wed, 26 May 2021 10:30:58 +0200 Subject: Make the ivicore examples to be fully functional again * Generation of QML Plugins fixed to work out of the box * Use correct folder structure for executables and plugins * Add optional DBus dependency for qface-tutorial * Remove the shader-effect from the qface-tutorial Change-Id: I212eade621ac9d741e1f0fe75ceef2c59c312865 Reviewed-by: Qt CI Bot Reviewed-by: Robert Griebl --- examples/CMakeLists.txt | 6 ++-- examples/ivicore/CMakeLists.txt | 3 ++ .../ivicore/qface-ivi-addressbook/CMakeLists.txt | 2 ++ .../backend_simulator/CMakeLists.txt | 23 ++++-------- .../qface-ivi-addressbook/demo/CMakeLists.txt | 9 +---- .../qface-ivi-addressbook/frontend/CMakeLists.txt | 10 +++--- examples/ivicore/qface-ivi-climate/CMakeLists.txt | 2 ++ .../backend_simulator/CMakeLists.txt | 21 +++-------- .../ivicore/qface-ivi-climate/demo/CMakeLists.txt | 9 +---- .../qface-ivi-climate/frontend/CMakeLists.txt | 10 +++--- examples/ivicore/qface-ivi-remote/CMakeLists.txt | 2 ++ .../qface-ivi-remote/backend_qtro/CMakeLists.txt | 20 +++-------- .../ivicore/qface-ivi-remote/demo/CMakeLists.txt | 4 +-- .../qface-ivi-remote/frontend/CMakeLists.txt | 11 +++--- .../qface-ivi-remote/server_qtro/CMakeLists.txt | 6 ++-- examples/ivicore/qface-tutorial/CMakeLists.txt | 2 ++ .../qface-tutorial/chapter1-basics/CMakeLists.txt | 2 ++ .../chapter1-basics/frontend/CMakeLists.txt | 14 +++----- .../instrument-cluster/CMakeLists.txt | 8 +---- .../chapter1-basics/instrument-cluster/Dial.qml | 41 ---------------------- .../instrument-cluster/LeftDial.qml | 1 - .../chapter2-enums-structs/CMakeLists.txt | 2 ++ .../chapter2-enums-structs/frontend/CMakeLists.txt | 14 +++----- .../instrument-cluster/CMakeLists.txt | 8 +---- .../instrument-cluster/Dial.qml | 41 ---------------------- .../instrument-cluster/LeftDial.qml | 1 - .../chapter3-simulation-backend/CMakeLists.txt | 2 ++ .../backend_simulator/CMakeLists.txt | 12 +------ .../frontend/CMakeLists.txt | 14 +++----- .../imports/CMakeLists.txt | 11 ------ .../instrument-cluster/CMakeLists.txt | 9 +---- .../instrument-cluster/Dial.qml | 41 ---------------------- .../instrument-cluster/LeftDial.qml | 1 - .../chapter4-simulation-behavior/CMakeLists.txt | 2 ++ .../backend_simulator/CMakeLists.txt | 12 +------ .../frontend/CMakeLists.txt | 14 +++----- .../imports/CMakeLists.txt | 11 ------ .../instrument-cluster/CMakeLists.txt | 9 +---- .../instrument-cluster/Dial.qml | 41 ---------------------- .../instrument-cluster/LeftDial.qml | 1 - .../qface-tutorial/chapter5-ipc/CMakeLists.txt | 2 ++ .../chapter5-ipc/backend_qtro/CMakeLists.txt | 12 +------ .../chapter5-ipc/backend_simulator/CMakeLists.txt | 12 +------ .../chapter5-ipc/frontend/CMakeLists.txt | 14 +++----- .../chapter5-ipc/imports/CMakeLists.txt | 11 ------ .../chapter5-ipc/instrument-cluster/CMakeLists.txt | 9 +---- .../chapter5-ipc/instrument-cluster/Dial.qml | 41 ---------------------- .../chapter5-ipc/instrument-cluster/LeftDial.qml | 1 - .../chapter5-ipc/simulation_server/CMakeLists.txt | 8 +---- .../chapter6-own-backend/CMakeLists.txt | 2 ++ .../backend_dbus/CMakeLists.txt | 22 ++++++------ .../backend_simulator/CMakeLists.txt | 22 ++++-------- .../demo_server/CMakeLists.txt | 20 ++++++----- .../chapter6-own-backend/frontend/CMakeLists.txt | 10 +++--- .../chapter6-own-backend/imports/CMakeLists.txt | 11 ------ .../instrument-cluster/CMakeLists.txt | 9 +---- .../instrument-cluster/Dial.qml | 41 ---------------------- .../instrument-cluster/LeftDial.qml | 1 - .../qface-tutorial/instrument-cluster/Dial.qml | 41 ---------------------- .../qface-tutorial/instrument-cluster/LeftDial.qml | 1 - 60 files changed, 130 insertions(+), 612 deletions(-) (limited to 'examples') diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index cfe681e..f703cb6 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -2,9 +2,9 @@ qt_examples_build_begin() -#if(TARGET Qt::Gui AND TARGET Qt::IviCore) -# add_subdirectory(ivicore) -#endif() +if(TARGET Qt::Gui AND TARGET Qt::IviCore) + add_subdirectory(ivicore) +endif() if(TARGET Qt::Gui AND TARGET Qt::IviVehicleFunctions) add_subdirectory(ivivehiclefunctions) endif() diff --git a/examples/ivicore/CMakeLists.txt b/examples/ivicore/CMakeLists.txt index 23d44bc..23af9f7 100644 --- a/examples/ivicore/CMakeLists.txt +++ b/examples/ivicore/CMakeLists.txt @@ -1,5 +1,8 @@ # Generated from ivicore.pro. +cmake_minimum_required(VERSION 3.14) +project(example LANGUAGES CXX) + if(QT_FEATURE_ivigenerator) add_subdirectory(qface-ivi-climate) add_subdirectory(qface-ivi-addressbook) diff --git a/examples/ivicore/qface-ivi-addressbook/CMakeLists.txt b/examples/ivicore/qface-ivi-addressbook/CMakeLists.txt index e32e6eb..40cc567 100644 --- a/examples/ivicore/qface-ivi-addressbook/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-addressbook/CMakeLists.txt @@ -1,4 +1,6 @@ # Generated from qface-ivi-addressbook.pro. +cmake_minimum_required(VERSION 3.14) +project(example_ivi_addressbook LANGUAGES CXX) add_subdirectory(frontend) add_subdirectory(backend_simulator) diff --git a/examples/ivicore/qface-ivi-addressbook/backend_simulator/CMakeLists.txt b/examples/ivicore/qface-ivi-addressbook/backend_simulator/CMakeLists.txt index a4b21ce..759b488 100644 --- a/examples/ivicore/qface-ivi-addressbook/backend_simulator/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-addressbook/backend_simulator/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from backend_simulator.pro. - -cmake_minimum_required(VERSION 3.14) -project(example_ivi_addressbook LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -19,23 +15,16 @@ find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS IviCore) -qt_add_plugin(example_ivi_addressbook) +qt_add_plugin(addressbook_backend_simulator) +set_target_properties(addressbook_backend_simulator PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../qtivi) # IVI Generator: -qt6_ivigenerator(example_ivi_addressbook +qt6_ivigenerator(addressbook_backend_simulator QFACE_SOURCES ../example-ivi-addressbook.qface QFACE_FORMAT backend_simulator ) -set_target_properties(example_ivi_addressbook PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(example_ivi_addressbook PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) -target_link_libraries(example_ivi_addressbook PUBLIC - # Remove: L${CMAKE_CURRENT_BINARY_DIR}/../ +target_link_libraries(addressbook_backend_simulator PUBLIC QtIviAdressBookExample Qt::Core Qt::Gui @@ -48,14 +37,14 @@ set(plugin_resource_resource_files "simulation.qml" ) -qt6_add_resources(example_ivi_addressbook "plugin_resource" +qt6_add_resources(addressbook_backend_simulator "plugin_resource" PREFIX "/plugin_resource" FILES ${plugin_resource_resource_files} ) -install(TARGETS example_ivi_addressbook +install(TARGETS addressbook_backend_simulator RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/ivicore/qface-ivi-addressbook/demo/CMakeLists.txt b/examples/ivicore/qface-ivi-addressbook/demo/CMakeLists.txt index 4d4dbad..892db14 100644 --- a/examples/ivicore/qface-ivi-addressbook/demo/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-addressbook/demo/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from demo.pro. - -cmake_minimum_required(VERSION 3.14) -project(qface-ivi-addressbook LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -23,20 +19,17 @@ find_package(Qt6 COMPONENTS Quick) qt_add_executable(qface-ivi-addressbook main.cpp ) +set_target_properties(qface-ivi-addressbook PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) set_target_properties(qface-ivi-addressbook PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(qface-ivi-addressbook PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_compile_definitions(qface-ivi-addressbook PUBLIC QT_DEPRECATED_WARNINGS ) target_link_libraries(qface-ivi-addressbook PUBLIC - # Remove: L${CMAKE_CURRENT_BINARY_DIR}/../ QtIviAdressBookExample Qt::Core Qt::Gui diff --git a/examples/ivicore/qface-ivi-addressbook/frontend/CMakeLists.txt b/examples/ivicore/qface-ivi-addressbook/frontend/CMakeLists.txt index b27c013..b5e14fb 100644 --- a/examples/ivicore/qface-ivi-addressbook/frontend/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-addressbook/frontend/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from frontend.pro. - -cmake_minimum_required(VERSION 3.14) -project(QtIviAdressBookExample LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -29,6 +25,12 @@ qt6_ivigenerator(QtIviAdressBookExample QFACE_FORMAT frontend ) +set_target_properties(QtIviAdressBookExample PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) + +target_include_directories(QtIviAdressBookExample PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} +) + target_link_libraries(QtIviAdressBookExample PUBLIC Qt::Core Qt::Gui diff --git a/examples/ivicore/qface-ivi-climate/CMakeLists.txt b/examples/ivicore/qface-ivi-climate/CMakeLists.txt index c908371..4dae99a 100644 --- a/examples/ivicore/qface-ivi-climate/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-climate/CMakeLists.txt @@ -1,4 +1,6 @@ # Generated from qface-ivi-climate.pro. +cmake_minimum_required(VERSION 3.14) +project(example_ivi_climate LANGUAGES CXX) add_subdirectory(frontend) add_subdirectory(backend_simulator) diff --git a/examples/ivicore/qface-ivi-climate/backend_simulator/CMakeLists.txt b/examples/ivicore/qface-ivi-climate/backend_simulator/CMakeLists.txt index 577ba27..6b0aa62 100644 --- a/examples/ivicore/qface-ivi-climate/backend_simulator/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-climate/backend_simulator/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from backend_simulator.pro. - -cmake_minimum_required(VERSION 3.14) -project(example_ivi_climate LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -19,30 +15,23 @@ find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS IviCore) -qt_add_plugin(example_ivi_climate) +qt_add_plugin(climate_backend_simulator) +set_target_properties(climate_backend_simulator PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../qtivi) # IVI Generator: -qt6_ivigenerator(example_ivi_climate +qt6_ivigenerator(climate_backend_simulator QFACE_SOURCES ../example-ivi-climate.qface QFACE_FORMAT backend_simulator ) -set_target_properties(example_ivi_climate PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(example_ivi_climate PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) -target_link_libraries(example_ivi_climate PUBLIC - # Remove: L${CMAKE_CURRENT_BINARY_DIR}/../ +target_link_libraries(climate_backend_simulator PUBLIC QtIviClimateExample Qt::Core Qt::Gui Qt::IviCore ) -install(TARGETS example_ivi_climate +install(TARGETS climate_backend_simulator RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/ivicore/qface-ivi-climate/demo/CMakeLists.txt b/examples/ivicore/qface-ivi-climate/demo/CMakeLists.txt index 8dd6fff..0365a87 100644 --- a/examples/ivicore/qface-ivi-climate/demo/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-climate/demo/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from demo.pro. - -cmake_minimum_required(VERSION 3.14) -project(qface-ivi-climate LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -23,20 +19,17 @@ find_package(Qt6 COMPONENTS Quick) qt_add_executable(qface-ivi-climate main.cpp ) +set_target_properties(qface-ivi-climate PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..) set_target_properties(qface-ivi-climate PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(qface-ivi-climate PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_compile_definitions(qface-ivi-climate PUBLIC QT_DEPRECATED_WARNINGS ) target_link_libraries(qface-ivi-climate PUBLIC - # Remove: L${CMAKE_CURRENT_BINARY_DIR}/../ QtIviClimateExample Qt::Core Qt::Gui diff --git a/examples/ivicore/qface-ivi-climate/frontend/CMakeLists.txt b/examples/ivicore/qface-ivi-climate/frontend/CMakeLists.txt index 9a36218..f8c7063 100644 --- a/examples/ivicore/qface-ivi-climate/frontend/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-climate/frontend/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from frontend.pro. - -cmake_minimum_required(VERSION 3.14) -project(QtIviClimateExample LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -29,6 +25,12 @@ qt6_ivigenerator(QtIviClimateExample QFACE_FORMAT frontend ) +set_target_properties(QtIviClimateExample PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..) + +target_include_directories(QtIviClimateExample PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} +) + target_link_libraries(QtIviClimateExample PUBLIC Qt::Core Qt::Gui diff --git a/examples/ivicore/qface-ivi-remote/CMakeLists.txt b/examples/ivicore/qface-ivi-remote/CMakeLists.txt index a528b62..958e853 100644 --- a/examples/ivicore/qface-ivi-remote/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-remote/CMakeLists.txt @@ -1,4 +1,6 @@ # Generated from qface-ivi-remote.pro. +cmake_minimum_required(VERSION 3.14) +project(example_ivi_remote LANGUAGES CXX) add_subdirectory(frontend) add_subdirectory(backend_qtro) diff --git a/examples/ivicore/qface-ivi-remote/backend_qtro/CMakeLists.txt b/examples/ivicore/qface-ivi-remote/backend_qtro/CMakeLists.txt index 90ec5d8..497c040 100644 --- a/examples/ivicore/qface-ivi-remote/backend_qtro/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-remote/backend_qtro/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from backend_qtro.pro. - -cmake_minimum_required(VERSION 3.14) -project(example_ivi_remote LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -19,29 +15,23 @@ find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS IviCore) -qt_add_plugin(example_ivi_remote) +qt_add_plugin(remote_backend_qtro) +set_target_properties(remote_backend_qtro PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../qtivi) # IVI Generator: -qt6_ivigenerator(example_ivi_remote +qt6_ivigenerator(remote_backend_qtro QFACE_SOURCES ../example-ivi-remote.qface QFACE_FORMAT backend_qtro ) -set_target_properties(example_ivi_remote PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(example_ivi_remote PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) -target_link_libraries(example_ivi_remote PUBLIC +target_link_libraries(remote_backend_qtro PUBLIC QtIviRemoteExample Qt::Core Qt::Gui Qt::IviCore ) -install(TARGETS example_ivi_remote +install(TARGETS remote_backend_qtro RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/ivicore/qface-ivi-remote/demo/CMakeLists.txt b/examples/ivicore/qface-ivi-remote/demo/CMakeLists.txt index 09de96e..1be10a2 100644 --- a/examples/ivicore/qface-ivi-remote/demo/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-remote/demo/CMakeLists.txt @@ -23,13 +23,11 @@ find_package(Qt6 COMPONENTS Quick) qt_add_executable(qface-ivi-remote main.cpp ) +set_target_properties(qface-ivi-remote PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..) set_target_properties(qface-ivi-remote PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(qface-ivi-remote PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_compile_definitions(qface-ivi-remote PUBLIC QT_DEPRECATED_WARNINGS diff --git a/examples/ivicore/qface-ivi-remote/frontend/CMakeLists.txt b/examples/ivicore/qface-ivi-remote/frontend/CMakeLists.txt index 1fb9b77..4257aa2 100644 --- a/examples/ivicore/qface-ivi-remote/frontend/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-remote/frontend/CMakeLists.txt @@ -28,12 +28,11 @@ qt6_ivigenerator(QtIviRemoteExample QFACE_SOURCES ../example-ivi-remote.qface QFACE_FORMAT frontend ) -set_target_properties(QtIviRemoteExample PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_compile_definitions(QtIviRemoteExample PUBLIC - QT_BUILD_EXAMPLE_IVI_REMOTE_LIB + +set_target_properties(QtIviRemoteExample PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..) + +target_include_directories(QtIviRemoteExample PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} ) target_link_libraries(QtIviRemoteExample PUBLIC diff --git a/examples/ivicore/qface-ivi-remote/server_qtro/CMakeLists.txt b/examples/ivicore/qface-ivi-remote/server_qtro/CMakeLists.txt index 6b29361..5038033 100644 --- a/examples/ivicore/qface-ivi-remote/server_qtro/CMakeLists.txt +++ b/examples/ivicore/qface-ivi-remote/server_qtro/CMakeLists.txt @@ -27,13 +27,13 @@ qt6_ivigenerator(qface-ivi-remote-server QFACE_SOURCES ../example-ivi-remote.qface QFACE_FORMAT server_qtro ) + +set_target_properties(qface-ivi-remote-server PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..) + set_target_properties(qface-ivi-remote-server PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(qface-ivi-remote-server PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_compile_definitions(qface-ivi-remote-server PUBLIC QT_DEPRECATED_WARNINGS diff --git a/examples/ivicore/qface-tutorial/CMakeLists.txt b/examples/ivicore/qface-tutorial/CMakeLists.txt index f1f014f..a37f869 100644 --- a/examples/ivicore/qface-tutorial/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/CMakeLists.txt @@ -1,4 +1,6 @@ # Generated from qface-tutorial.pro. +cmake_minimum_required(VERSION 3.14) +project(qface-tutorial LANGUAGES CXX) add_subdirectory(instrument-cluster) add_subdirectory(chapter1-basics) diff --git a/examples/ivicore/qface-tutorial/chapter1-basics/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter1-basics/CMakeLists.txt index 154a126..7a9e3c8 100644 --- a/examples/ivicore/qface-tutorial/chapter1-basics/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter1-basics/CMakeLists.txt @@ -1,4 +1,6 @@ # Generated from chapter1-basics.pro. +cmake_minimum_required(VERSION 3.14) +project(qface-chapter1-basics LANGUAGES CXX) add_subdirectory(instrument-cluster) add_subdirectory(frontend) diff --git a/examples/ivicore/qface-tutorial/chapter1-basics/frontend/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter1-basics/frontend/CMakeLists.txt index 37afc5e..739876e 100644 --- a/examples/ivicore/qface-tutorial/chapter1-basics/frontend/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter1-basics/frontend/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from frontend.pro. - -cmake_minimum_required(VERSION 3.14) -project(QtIviInstrumentCluster LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -22,18 +18,16 @@ find_package(Qt6 COMPONENTS Qml) find_package(Qt6 COMPONENTS Quick) add_library(QtIviInstrumentCluster_Chapter1) +set_target_properties(QtIviInstrumentCluster_Chapter1 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) # IVI Generator: qt6_ivigenerator(QtIviInstrumentCluster_Chapter1 QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT frontend ) -set_target_properties(QtIviInstrumentCluster_Chapter1 PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_compile_definitions(QtIviInstrumentCluster_Chapter1 PUBLIC - QT_BUILD_EXAMPLE_IVI_INSTRUMENTCLUSTER_LIB + +target_include_directories(QtIviInstrumentCluster_Chapter1 PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} ) target_link_libraries(QtIviInstrumentCluster_Chapter1 PUBLIC diff --git a/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/CMakeLists.txt index f1b9eba..bf9295d 100644 --- a/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from instrument-cluster.pro. - -cmake_minimum_required(VERSION 3.14) -project(chapter1-basics LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -23,13 +19,11 @@ find_package(Qt6 COMPONENTS Quick) qt_add_executable(chapter1-basics main.cpp ) +set_target_properties(chapter1-basics PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) set_target_properties(chapter1-basics PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(chapter1-basics PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(chapter1-basics PUBLIC QtIviInstrumentCluster_Chapter1 diff --git a/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/Dial.qml b/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/Dial.qml index a4b5c3f..af44cbe 100644 --- a/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/Dial.qml +++ b/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/Dial.qml @@ -75,45 +75,4 @@ Item { rotation: min + (max - min) * root.value source: Qt.resolvedUrl(root.dialCursor) } - - ShaderEffect { - anchors.fill: meter - property var pattern: Image { - source: Qt.resolvedUrl("images/dial_pattern.png") - } - property var fill: Image { - source: Qt.resolvedUrl(root.fillImage) - } - property real value: root.value - - fragmentShader: " -#define M_PI 3.141592653589793 -#define INNER " + root.circleRadius + " - -varying highp vec2 qt_TexCoord0; -uniform lowp float qt_Opacity; -uniform sampler2D pattern; -uniform sampler2D fill; -uniform lowp float value; - -void main() { - lowp vec4 pattern = texture2D(pattern, qt_TexCoord0); - lowp vec4 fill = texture2D(fill, qt_TexCoord0); - - lowp vec2 pos = vec2(qt_TexCoord0.x - 0.5, 0.501 - qt_TexCoord0.y); - lowp float d = length(pos); - lowp float angle = atan(pos.x, pos.y) / (2.0 * M_PI); - lowp float v = 0.66 * value - 0.33; - - // Flare pattern - lowp vec4 color = mix(pattern, vec4(0.0), smoothstep(v, v + 0.1, angle)); - // Gradient fill color - color += mix(fill, vec4(0.0), step(v, angle)); - // Punch out the center hole - color = mix(vec4(0.0), color, smoothstep(INNER - 0.001, INNER + 0.001, d)); - // Fade out below 0 - gl_FragColor = mix(color, vec4(0.0), smoothstep(-0.35, -0.5, angle)); -} - " - } } diff --git a/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/LeftDial.qml b/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/LeftDial.qml index f57b8af..0cae23f 100644 --- a/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/LeftDial.qml +++ b/examples/ivicore/qface-tutorial/chapter1-basics/instrument-cluster/LeftDial.qml @@ -52,7 +52,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtGraphicalEffects 1.0 Item { id: root diff --git a/examples/ivicore/qface-tutorial/chapter2-enums-structs/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter2-enums-structs/CMakeLists.txt index d305589..0bbabe4 100644 --- a/examples/ivicore/qface-tutorial/chapter2-enums-structs/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter2-enums-structs/CMakeLists.txt @@ -1,4 +1,6 @@ # Generated from chapter2-enums-structs.pro. +cmake_minimum_required(VERSION 3.14) +project(qface-chapter2-enums-structs LANGUAGES CXX) add_subdirectory(instrument-cluster) add_subdirectory(frontend) diff --git a/examples/ivicore/qface-tutorial/chapter2-enums-structs/frontend/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter2-enums-structs/frontend/CMakeLists.txt index 39ff7a5..beef4ec 100644 --- a/examples/ivicore/qface-tutorial/chapter2-enums-structs/frontend/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter2-enums-structs/frontend/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from frontend.pro. - -cmake_minimum_required(VERSION 3.14) -project(QtIviInstrumentCluster LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -22,18 +18,16 @@ find_package(Qt6 COMPONENTS Qml) find_package(Qt6 COMPONENTS Quick) add_library(QtIviInstrumentCluster_Chapter2) +set_target_properties(QtIviInstrumentCluster_Chapter2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) # IVI Generator: qt6_ivigenerator(QtIviInstrumentCluster_Chapter2 QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT frontend ) -set_target_properties(QtIviInstrumentCluster_Chapter2 PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_compile_definitions(QtIviInstrumentCluster_Chapter2 PUBLIC - QT_BUILD_EXAMPLE_IVI_INSTRUMENTCLUSTER_LIB + +target_include_directories(QtIviInstrumentCluster_Chapter2 PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} ) target_link_libraries(QtIviInstrumentCluster_Chapter2 PUBLIC diff --git a/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/CMakeLists.txt index 40ea623..7ff6cab 100644 --- a/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from instrument-cluster.pro. - -cmake_minimum_required(VERSION 3.14) -project(chapter2-enums-structs LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -23,13 +19,11 @@ find_package(Qt6 COMPONENTS Quick) qt_add_executable(chapter2-enums-structs main.cpp ) +set_target_properties(chapter2-enums-structs PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) set_target_properties(chapter2-enums-structs PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(chapter2-enums-structs PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(chapter2-enums-structs PUBLIC QtIviInstrumentCluster_Chapter2 diff --git a/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/Dial.qml b/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/Dial.qml index a4b5c3f..af44cbe 100644 --- a/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/Dial.qml +++ b/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/Dial.qml @@ -75,45 +75,4 @@ Item { rotation: min + (max - min) * root.value source: Qt.resolvedUrl(root.dialCursor) } - - ShaderEffect { - anchors.fill: meter - property var pattern: Image { - source: Qt.resolvedUrl("images/dial_pattern.png") - } - property var fill: Image { - source: Qt.resolvedUrl(root.fillImage) - } - property real value: root.value - - fragmentShader: " -#define M_PI 3.141592653589793 -#define INNER " + root.circleRadius + " - -varying highp vec2 qt_TexCoord0; -uniform lowp float qt_Opacity; -uniform sampler2D pattern; -uniform sampler2D fill; -uniform lowp float value; - -void main() { - lowp vec4 pattern = texture2D(pattern, qt_TexCoord0); - lowp vec4 fill = texture2D(fill, qt_TexCoord0); - - lowp vec2 pos = vec2(qt_TexCoord0.x - 0.5, 0.501 - qt_TexCoord0.y); - lowp float d = length(pos); - lowp float angle = atan(pos.x, pos.y) / (2.0 * M_PI); - lowp float v = 0.66 * value - 0.33; - - // Flare pattern - lowp vec4 color = mix(pattern, vec4(0.0), smoothstep(v, v + 0.1, angle)); - // Gradient fill color - color += mix(fill, vec4(0.0), step(v, angle)); - // Punch out the center hole - color = mix(vec4(0.0), color, smoothstep(INNER - 0.001, INNER + 0.001, d)); - // Fade out below 0 - gl_FragColor = mix(color, vec4(0.0), smoothstep(-0.35, -0.5, angle)); -} - " - } } diff --git a/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/LeftDial.qml b/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/LeftDial.qml index f57b8af..0cae23f 100644 --- a/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/LeftDial.qml +++ b/examples/ivicore/qface-tutorial/chapter2-enums-structs/instrument-cluster/LeftDial.qml @@ -52,7 +52,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtGraphicalEffects 1.0 Item { id: root diff --git a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/CMakeLists.txt index 7be44e4..710ee4d 100644 --- a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/CMakeLists.txt @@ -1,4 +1,6 @@ # Generated from chapter3-simulation-backend.pro. +cmake_minimum_required(VERSION 3.14) +project(qface-chapter3-simulation-backend LANGUAGES CXX) add_subdirectory(instrument-cluster) add_subdirectory(frontend) diff --git a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/backend_simulator/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/backend_simulator/CMakeLists.txt index 8729060..41d0162 100644 --- a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/backend_simulator/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/backend_simulator/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from backend_simulator.pro. - -cmake_minimum_required(VERSION 3.14) -project(instrumentcluster_simulation LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -20,19 +16,13 @@ find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS IviCore) qt_add_plugin(instrumentcluster_chapter3_simulation) +set_target_properties(instrumentcluster_chapter3_simulation PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../qtivi) # IVI Generator: qt6_ivigenerator(instrumentcluster_chapter3_simulation QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT backend_simulator ) -set_target_properties(instrumentcluster_chapter3_simulation PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(instrumentcluster_chapter3_simulation PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(instrumentcluster_chapter3_simulation PUBLIC QtIviInstrumentCluster_Chapter3 diff --git a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/frontend/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/frontend/CMakeLists.txt index 0d33a7e..2da2854 100644 --- a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/frontend/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/frontend/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from frontend.pro. - -cmake_minimum_required(VERSION 3.14) -project(QtIviInstrumentCluster LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -22,18 +18,16 @@ find_package(Qt6 COMPONENTS Qml) find_package(Qt6 COMPONENTS Quick) add_library(QtIviInstrumentCluster_Chapter3) +set_target_properties(QtIviInstrumentCluster_Chapter3 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) # IVI Generator: qt6_ivigenerator(QtIviInstrumentCluster_Chapter3 QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT frontend ) -set_target_properties(QtIviInstrumentCluster_Chapter3 PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_compile_definitions(QtIviInstrumentCluster_Chapter3 PUBLIC - QT_BUILD_EXAMPLE_IVI_INSTRUMENTCLUSTER_LIB + +target_include_directories(QtIviInstrumentCluster_Chapter3 PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} ) target_link_libraries(QtIviInstrumentCluster_Chapter3 PUBLIC diff --git a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/imports/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/imports/CMakeLists.txt index 9232454..c52f569 100644 --- a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/imports/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/imports/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from imports.pro. - -cmake_minimum_required(VERSION 3.14) -project(instrument_cluster_imports LANGUAGES CXX) # special case - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -25,13 +21,6 @@ qt6_ivigenerator(instrument_cluster_chapter3_imports # special case QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT qmlplugin ) -set_target_properties(instrument_cluster_chapter3_imports PROPERTIES # special case - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(instrument_cluster_chapter3_imports PUBLIC # special case - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(instrument_cluster_chapter3_imports PUBLIC # special case QtIviInstrumentCluster_Chapter3 diff --git a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/CMakeLists.txt index b9b4e7e..3aa6378 100644 --- a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from instrument-cluster.pro. - -cmake_minimum_required(VERSION 3.14) -project(chapter3-simulation-backend LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -23,16 +19,13 @@ find_package(Qt6 COMPONENTS Quick) qt_add_executable(chapter3-simulation-backend main.cpp ) +set_target_properties(chapter3-simulation-backend PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) set_target_properties(chapter3-simulation-backend PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(chapter3-simulation-backend PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(chapter3-simulation-backend PUBLIC - # Remove: L${CMAKE_CURRENT_BINARY_DIR}/../ Qt::Core Qt::Gui Qt::Qml diff --git a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/Dial.qml b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/Dial.qml index a4b5c3f..af44cbe 100644 --- a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/Dial.qml +++ b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/Dial.qml @@ -75,45 +75,4 @@ Item { rotation: min + (max - min) * root.value source: Qt.resolvedUrl(root.dialCursor) } - - ShaderEffect { - anchors.fill: meter - property var pattern: Image { - source: Qt.resolvedUrl("images/dial_pattern.png") - } - property var fill: Image { - source: Qt.resolvedUrl(root.fillImage) - } - property real value: root.value - - fragmentShader: " -#define M_PI 3.141592653589793 -#define INNER " + root.circleRadius + " - -varying highp vec2 qt_TexCoord0; -uniform lowp float qt_Opacity; -uniform sampler2D pattern; -uniform sampler2D fill; -uniform lowp float value; - -void main() { - lowp vec4 pattern = texture2D(pattern, qt_TexCoord0); - lowp vec4 fill = texture2D(fill, qt_TexCoord0); - - lowp vec2 pos = vec2(qt_TexCoord0.x - 0.5, 0.501 - qt_TexCoord0.y); - lowp float d = length(pos); - lowp float angle = atan(pos.x, pos.y) / (2.0 * M_PI); - lowp float v = 0.66 * value - 0.33; - - // Flare pattern - lowp vec4 color = mix(pattern, vec4(0.0), smoothstep(v, v + 0.1, angle)); - // Gradient fill color - color += mix(fill, vec4(0.0), step(v, angle)); - // Punch out the center hole - color = mix(vec4(0.0), color, smoothstep(INNER - 0.001, INNER + 0.001, d)); - // Fade out below 0 - gl_FragColor = mix(color, vec4(0.0), smoothstep(-0.35, -0.5, angle)); -} - " - } } diff --git a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/LeftDial.qml b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/LeftDial.qml index f57b8af..0cae23f 100644 --- a/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/LeftDial.qml +++ b/examples/ivicore/qface-tutorial/chapter3-simulation-backend/instrument-cluster/LeftDial.qml @@ -52,7 +52,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtGraphicalEffects 1.0 Item { id: root diff --git a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/CMakeLists.txt index bb2860f..132314f 100644 --- a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/CMakeLists.txt @@ -1,4 +1,6 @@ # Generated from chapter4-simulation-behavior.pro. +cmake_minimum_required(VERSION 3.14) +project(qface-chapter4-simulation-behavior LANGUAGES CXX) add_subdirectory(instrument-cluster) add_subdirectory(frontend) diff --git a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/backend_simulator/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/backend_simulator/CMakeLists.txt index 628722a..4918c94 100644 --- a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/backend_simulator/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/backend_simulator/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from backend_simulator.pro. - -cmake_minimum_required(VERSION 3.14) -project(instrumentcluster_simulation LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -20,19 +16,13 @@ find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS IviCore) qt_add_plugin(instrumentcluster_chapter4_simulation) +set_target_properties(instrumentcluster_chapter4_simulation PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../qtivi) # IVI Generator: qt6_ivigenerator(instrumentcluster_chapter4_simulation QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT backend_simulator ) -set_target_properties(instrumentcluster_chapter4_simulation PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(instrumentcluster_chapter4_simulation PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(instrumentcluster_chapter4_simulation PUBLIC QtIviInstrumentCluster_Chapter4 diff --git a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/frontend/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/frontend/CMakeLists.txt index 9f4e36a..c12e97c 100644 --- a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/frontend/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/frontend/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from frontend.pro. - -cmake_minimum_required(VERSION 3.14) -project(QtIviInstrumentCluster LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -22,18 +18,16 @@ find_package(Qt6 COMPONENTS Qml) find_package(Qt6 COMPONENTS Quick) add_library(QtIviInstrumentCluster_Chapter4) +set_target_properties(QtIviInstrumentCluster_Chapter4 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) # IVI Generator: qt6_ivigenerator(QtIviInstrumentCluster_Chapter4 QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT frontend ) -set_target_properties(QtIviInstrumentCluster_Chapter4 PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_compile_definitions(QtIviInstrumentCluster_Chapter4 PUBLIC - QT_BUILD_EXAMPLE_IVI_INSTRUMENTCLUSTER_LIB + +target_include_directories(QtIviInstrumentCluster_Chapter4 PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} ) target_link_libraries(QtIviInstrumentCluster_Chapter4 PUBLIC diff --git a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/imports/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/imports/CMakeLists.txt index 8a99af1..0a41aa8 100644 --- a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/imports/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/imports/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from imports.pro. - -cmake_minimum_required(VERSION 3.14) -project(instrument_cluster_imports LANGUAGES CXX) # special case - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -25,13 +21,6 @@ qt6_ivigenerator(instrument_cluster_chapter4_imports # special case QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT qmlplugin ) -set_target_properties(instrument_cluster_chapter4_imports PROPERTIES # special case - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(instrument_cluster_chapter4_imports PUBLIC # special case - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(instrument_cluster_chapter4_imports PUBLIC # special case QtIviInstrumentCluster_Chapter4 diff --git a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/CMakeLists.txt index 2d1914e..6a82e9c 100644 --- a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from instrument-cluster.pro. - -cmake_minimum_required(VERSION 3.14) -project(chapter4-simulation-behavior LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -23,16 +19,13 @@ find_package(Qt6 COMPONENTS Quick) qt_add_executable(chapter4-simulation-behavior main.cpp ) +set_target_properties(chapter4-simulation-behavior PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) set_target_properties(chapter4-simulation-behavior PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(chapter4-simulation-behavior PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(chapter4-simulation-behavior PUBLIC - # Remove: L${CMAKE_CURRENT_BINARY_DIR}/../ Qt::Core Qt::Gui Qt::Qml diff --git a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/Dial.qml b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/Dial.qml index a4b5c3f..af44cbe 100644 --- a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/Dial.qml +++ b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/Dial.qml @@ -75,45 +75,4 @@ Item { rotation: min + (max - min) * root.value source: Qt.resolvedUrl(root.dialCursor) } - - ShaderEffect { - anchors.fill: meter - property var pattern: Image { - source: Qt.resolvedUrl("images/dial_pattern.png") - } - property var fill: Image { - source: Qt.resolvedUrl(root.fillImage) - } - property real value: root.value - - fragmentShader: " -#define M_PI 3.141592653589793 -#define INNER " + root.circleRadius + " - -varying highp vec2 qt_TexCoord0; -uniform lowp float qt_Opacity; -uniform sampler2D pattern; -uniform sampler2D fill; -uniform lowp float value; - -void main() { - lowp vec4 pattern = texture2D(pattern, qt_TexCoord0); - lowp vec4 fill = texture2D(fill, qt_TexCoord0); - - lowp vec2 pos = vec2(qt_TexCoord0.x - 0.5, 0.501 - qt_TexCoord0.y); - lowp float d = length(pos); - lowp float angle = atan(pos.x, pos.y) / (2.0 * M_PI); - lowp float v = 0.66 * value - 0.33; - - // Flare pattern - lowp vec4 color = mix(pattern, vec4(0.0), smoothstep(v, v + 0.1, angle)); - // Gradient fill color - color += mix(fill, vec4(0.0), step(v, angle)); - // Punch out the center hole - color = mix(vec4(0.0), color, smoothstep(INNER - 0.001, INNER + 0.001, d)); - // Fade out below 0 - gl_FragColor = mix(color, vec4(0.0), smoothstep(-0.35, -0.5, angle)); -} - " - } } diff --git a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/LeftDial.qml b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/LeftDial.qml index f57b8af..0cae23f 100644 --- a/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/LeftDial.qml +++ b/examples/ivicore/qface-tutorial/chapter4-simulation-behavior/instrument-cluster/LeftDial.qml @@ -52,7 +52,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtGraphicalEffects 1.0 Item { id: root diff --git a/examples/ivicore/qface-tutorial/chapter5-ipc/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter5-ipc/CMakeLists.txt index 6bdba9a..fac920e 100644 --- a/examples/ivicore/qface-tutorial/chapter5-ipc/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter5-ipc/CMakeLists.txt @@ -1,4 +1,6 @@ # Generated from chapter5-ipc.pro. +cmake_minimum_required(VERSION 3.14) +project(qface-chapter5-ipc LANGUAGES CXX) add_subdirectory(instrument-cluster) add_subdirectory(frontend) diff --git a/examples/ivicore/qface-tutorial/chapter5-ipc/backend_qtro/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter5-ipc/backend_qtro/CMakeLists.txt index fbf027a..a7b4d50 100644 --- a/examples/ivicore/qface-tutorial/chapter5-ipc/backend_qtro/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter5-ipc/backend_qtro/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from backend_qtro.pro. - -cmake_minimum_required(VERSION 3.14) -project(instrumentcluster_qtro LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -20,19 +16,13 @@ find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS IviCore) qt_add_plugin(instrumentcluster_qtro) +set_target_properties(instrumentcluster_qtro PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../qtivi) # IVI Generator: qt6_ivigenerator(instrumentcluster_qtro QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT backend_qtro ) -set_target_properties(instrumentcluster_qtro PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(instrumentcluster_qtro PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(instrumentcluster_qtro PUBLIC QtIviInstrumentCluster_Chapter5 diff --git a/examples/ivicore/qface-tutorial/chapter5-ipc/backend_simulator/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter5-ipc/backend_simulator/CMakeLists.txt index c27a530..0a21a1b 100644 --- a/examples/ivicore/qface-tutorial/chapter5-ipc/backend_simulator/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter5-ipc/backend_simulator/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from backend_simulator.pro. - -cmake_minimum_required(VERSION 3.14) -project(instrumentcluster_simulation LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -20,19 +16,13 @@ find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS IviCore) qt_add_plugin(instrumentcluster_chapter5_simulation) +set_target_properties(instrumentcluster_chapter5_simulation PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../qtivi) # IVI Generator: qt6_ivigenerator(instrumentcluster_chapter5_simulation QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT backend_simulator ) -set_target_properties(instrumentcluster_chapter5_simulation PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(instrumentcluster_chapter5_simulation PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(instrumentcluster_chapter5_simulation PUBLIC QtIviInstrumentCluster_Chapter5 diff --git a/examples/ivicore/qface-tutorial/chapter5-ipc/frontend/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter5-ipc/frontend/CMakeLists.txt index 9be3458..2dc37cb 100644 --- a/examples/ivicore/qface-tutorial/chapter5-ipc/frontend/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter5-ipc/frontend/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from frontend.pro. - -cmake_minimum_required(VERSION 3.14) -project(QtIviInstrumentCluster LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -22,18 +18,16 @@ find_package(Qt6 COMPONENTS Qml) find_package(Qt6 COMPONENTS Quick) add_library(QtIviInstrumentCluster_Chapter5) +set_target_properties(QtIviInstrumentCluster_Chapter5 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) # IVI Generator: qt6_ivigenerator(QtIviInstrumentCluster_Chapter5 QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT frontend ) -set_target_properties(QtIviInstrumentCluster_Chapter5 PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_compile_definitions(QtIviInstrumentCluster_Chapter5 PUBLIC - QT_BUILD_EXAMPLE_IVI_INSTRUMENTCLUSTER_LIB + +target_include_directories(QtIviInstrumentCluster_Chapter5 PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} ) target_link_libraries(QtIviInstrumentCluster_Chapter5 PUBLIC diff --git a/examples/ivicore/qface-tutorial/chapter5-ipc/imports/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter5-ipc/imports/CMakeLists.txt index 2e43fb2..ba332da 100644 --- a/examples/ivicore/qface-tutorial/chapter5-ipc/imports/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter5-ipc/imports/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from imports.pro. - -cmake_minimum_required(VERSION 3.14) -project(imports LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -25,13 +21,6 @@ qt6_ivigenerator(instrument_cluster_chapter5_imports QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT qmlplugin ) -set_target_properties(instrument_cluster_chapter5_imports PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(instrument_cluster_chapter5_imports PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(instrument_cluster_chapter5_imports PUBLIC QtIviInstrumentCluster_Chapter5 diff --git a/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/CMakeLists.txt index 9582055..35fe21b 100644 --- a/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from instrument-cluster.pro. - -cmake_minimum_required(VERSION 3.14) -project(chapter5-ipc LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -23,16 +19,13 @@ find_package(Qt6 COMPONENTS Quick) qt_add_executable(chapter5-ipc main.cpp ) +set_target_properties(chapter5-ipc PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) set_target_properties(chapter5-ipc PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(chapter5-ipc PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(chapter5-ipc PUBLIC - # Remove: L${CMAKE_CURRENT_BINARY_DIR}/../ Qt::Core Qt::Gui Qt::Qml diff --git a/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/Dial.qml b/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/Dial.qml index a4b5c3f..af44cbe 100644 --- a/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/Dial.qml +++ b/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/Dial.qml @@ -75,45 +75,4 @@ Item { rotation: min + (max - min) * root.value source: Qt.resolvedUrl(root.dialCursor) } - - ShaderEffect { - anchors.fill: meter - property var pattern: Image { - source: Qt.resolvedUrl("images/dial_pattern.png") - } - property var fill: Image { - source: Qt.resolvedUrl(root.fillImage) - } - property real value: root.value - - fragmentShader: " -#define M_PI 3.141592653589793 -#define INNER " + root.circleRadius + " - -varying highp vec2 qt_TexCoord0; -uniform lowp float qt_Opacity; -uniform sampler2D pattern; -uniform sampler2D fill; -uniform lowp float value; - -void main() { - lowp vec4 pattern = texture2D(pattern, qt_TexCoord0); - lowp vec4 fill = texture2D(fill, qt_TexCoord0); - - lowp vec2 pos = vec2(qt_TexCoord0.x - 0.5, 0.501 - qt_TexCoord0.y); - lowp float d = length(pos); - lowp float angle = atan(pos.x, pos.y) / (2.0 * M_PI); - lowp float v = 0.66 * value - 0.33; - - // Flare pattern - lowp vec4 color = mix(pattern, vec4(0.0), smoothstep(v, v + 0.1, angle)); - // Gradient fill color - color += mix(fill, vec4(0.0), step(v, angle)); - // Punch out the center hole - color = mix(vec4(0.0), color, smoothstep(INNER - 0.001, INNER + 0.001, d)); - // Fade out below 0 - gl_FragColor = mix(color, vec4(0.0), smoothstep(-0.35, -0.5, angle)); -} - " - } } diff --git a/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/LeftDial.qml b/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/LeftDial.qml index f57b8af..0cae23f 100644 --- a/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/LeftDial.qml +++ b/examples/ivicore/qface-tutorial/chapter5-ipc/instrument-cluster/LeftDial.qml @@ -52,7 +52,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtGraphicalEffects 1.0 Item { id: root diff --git a/examples/ivicore/qface-tutorial/chapter5-ipc/simulation_server/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter5-ipc/simulation_server/CMakeLists.txt index e92b615..43e0e87 100644 --- a/examples/ivicore/qface-tutorial/chapter5-ipc/simulation_server/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter5-ipc/simulation_server/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from simulation_server.pro. - -cmake_minimum_required(VERSION 3.14) -project(chapter5-ipc-server LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -19,6 +15,7 @@ find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS IviCore) qt_add_executable(chapter5-ipc-server) +set_target_properties(chapter5-ipc-server PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) # IVI Generator: qt6_ivigenerator(chapter5-ipc-server @@ -29,9 +26,6 @@ set_target_properties(chapter5-ipc-server PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(chapter5-ipc-server PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(chapter5-ipc-server PUBLIC QtIviInstrumentCluster_Chapter5 diff --git a/examples/ivicore/qface-tutorial/chapter6-own-backend/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter6-own-backend/CMakeLists.txt index da5ff5e..4822116 100644 --- a/examples/ivicore/qface-tutorial/chapter6-own-backend/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter6-own-backend/CMakeLists.txt @@ -1,4 +1,6 @@ # Generated from chapter6-own-backend.pro. +cmake_minimum_required(VERSION 3.14) +project(qface-chapter6-own-backend LANGUAGES CXX) add_subdirectory(instrument-cluster) add_subdirectory(frontend) diff --git a/examples/ivicore/qface-tutorial/chapter6-own-backend/backend_dbus/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter6-own-backend/backend_dbus/CMakeLists.txt index 1bf264a..bd6e71c 100644 --- a/examples/ivicore/qface-tutorial/chapter6-own-backend/backend_dbus/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter6-own-backend/backend_dbus/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from backend_dbus.pro. - -cmake_minimum_required(VERSION 3.14) -project(instrumentcluster_dbus LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -21,17 +17,23 @@ find_package(Qt6 COMPONENTS IviCore) find_package(Qt6 COMPONENTS DBus) qt_add_plugin(instrumentcluster_dbus) +set_target_properties(instrumentcluster_dbus PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../qtivi) + +set_source_files_properties(../demo_server/instrumentcluster.xml PROPERTIES INCLUDE dbus_conversion.h) +set(cluster_SRCS) +qt6_add_dbus_interface(cluster_SRCS + ../demo_server/instrumentcluster.xml + instrumentcluster_interface +) + target_sources(instrumentcluster_dbus PRIVATE ../demo_server/dbus_conversion.h instrumentclusterbackend.cpp instrumentclusterbackend.h instrumentclusterplugin.cpp instrumentclusterplugin.h + ${cluster_SRCS} ) -set_target_properties(instrumentcluster_dbus PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(instrumentcluster_dbus PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend + +target_include_directories(instrumentcluster_dbus PRIVATE ../demo_server ) diff --git a/examples/ivicore/qface-tutorial/chapter6-own-backend/backend_simulator/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter6-own-backend/backend_simulator/CMakeLists.txt index 34bba3b..8d5f352 100644 --- a/examples/ivicore/qface-tutorial/chapter6-own-backend/backend_simulator/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter6-own-backend/backend_simulator/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from backend_simulator.pro. - -cmake_minimum_required(VERSION 3.14) -project(instrumentcluster_simulation LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -19,22 +15,16 @@ find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS IviCore) -qt_add_plugin(instrumentcluster_simulation) +qt_add_plugin(instrumentcluster_chapter6_simulation) +set_target_properties(instrumentcluster_chapter6_simulation PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../qtivi) # IVI Generator: -qt6_ivigenerator(instrumentcluster_simulation +qt6_ivigenerator(instrumentcluster_chapter6_simulation QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT backend_simulator ) -set_target_properties(instrumentcluster_simulation PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(instrumentcluster_simulation PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) -target_link_libraries(instrumentcluster_simulation PUBLIC +target_link_libraries(instrumentcluster_chapter6_simulation PUBLIC QtIviInstrumentCluster_Chapter6 Qt::Core Qt::Gui @@ -47,14 +37,14 @@ set(simulation_resource_files "simulation.qml" ) -qt6_add_resources(instrumentcluster_simulation "simulation" +qt6_add_resources(instrumentcluster_chapter6_simulation "simulation" PREFIX "/" FILES ${simulation_resource_files} ) -install(TARGETS instrumentcluster_simulation +install(TARGETS instrumentcluster_chapter6_simulation RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/ivicore/qface-tutorial/chapter6-own-backend/demo_server/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter6-own-backend/demo_server/CMakeLists.txt index f676668..56c0a8a 100644 --- a/examples/ivicore/qface-tutorial/chapter6-own-backend/demo_server/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter6-own-backend/demo_server/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from demo_server.pro. - -cmake_minimum_required(VERSION 3.14) -project(chapter6-demo-server LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -19,21 +15,29 @@ find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS IviCore) find_package(Qt6 COMPONENTS DBus) +set_source_files_properties(instrumentcluster.xml PROPERTIES INCLUDE "") +set(cluster_SRCS) +qt6_add_dbus_adaptor(cluster_SRCS + instrumentcluster.xml + dbus_conversion.h + "" # empty parent_class value on purpose to not pass -l flag + instrumentcluster_adaptor +) + qt_add_executable(chapter6-demo-server dbus_conversion.h instrumentcluster.cpp instrumentcluster.h main.cpp + ${cluster_SRCS} ) +set_target_properties(chapter6-demo-server PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) set_target_properties(chapter6-demo-server PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(chapter6-demo-server PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(chapter6-demo-server PUBLIC - # Remove: L${CMAKE_CURRENT_BINARY_DIR}/../ + QtIviInstrumentCluster_Chapter6 Qt::Core Qt::DBus Qt::IviCore diff --git a/examples/ivicore/qface-tutorial/chapter6-own-backend/frontend/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter6-own-backend/frontend/CMakeLists.txt index 4654fff..a8b5950 100644 --- a/examples/ivicore/qface-tutorial/chapter6-own-backend/frontend/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter6-own-backend/frontend/CMakeLists.txt @@ -22,18 +22,16 @@ find_package(Qt6 COMPONENTS Qml) find_package(Qt6 COMPONENTS Quick) add_library(QtIviInstrumentCluster_Chapter6) +set_target_properties(QtIviInstrumentCluster_Chapter6 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) # IVI Generator: qt6_ivigenerator(QtIviInstrumentCluster_Chapter6 QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT frontend ) -set_target_properties(QtIviInstrumentCluster_Chapter6 PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_compile_definitions(QtIviInstrumentCluster_Chapter6 PUBLIC - QT_BUILD_EXAMPLE_IVI_INSTRUMENTCLUSTER_LIB + +target_include_directories(QtIviInstrumentCluster_Chapter6 PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} ) target_link_libraries(QtIviInstrumentCluster_Chapter6 PUBLIC diff --git a/examples/ivicore/qface-tutorial/chapter6-own-backend/imports/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter6-own-backend/imports/CMakeLists.txt index fe95de7..b1887d5 100644 --- a/examples/ivicore/qface-tutorial/chapter6-own-backend/imports/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter6-own-backend/imports/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from imports.pro. - -cmake_minimum_required(VERSION 3.14) -project(instrument_cluster_chapter6_imports LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -25,13 +21,6 @@ qt6_ivigenerator(instrument_cluster_chapter6_imports QFACE_SOURCES ../instrument-cluster.qface QFACE_FORMAT qmlplugin ) -set_target_properties(instrument_cluster_chapter6_imports PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(instrument_cluster_chapter6_imports PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(instrument_cluster_chapter6_imports PUBLIC QtIviInstrumentCluster_Chapter6 diff --git a/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/CMakeLists.txt b/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/CMakeLists.txt index 28ae324..05f9046 100644 --- a/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/CMakeLists.txt +++ b/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/CMakeLists.txt @@ -1,8 +1,4 @@ # Generated from instrument-cluster.pro. - -cmake_minimum_required(VERSION 3.14) -project(chapter6-own-backend LANGUAGES CXX) - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -23,16 +19,13 @@ find_package(Qt6 COMPONENTS Quick) qt_add_executable(chapter6-own-backend main.cpp ) +set_target_properties(chapter6-own-backend PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) set_target_properties(chapter6-own-backend PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE FALSE ) -target_include_directories(chapter6-own-backend PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/../frontend -) target_link_libraries(chapter6-own-backend PUBLIC - # Remove: L${CMAKE_CURRENT_BINARY_DIR}/../ Qt::Core Qt::Gui Qt::Qml diff --git a/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/Dial.qml b/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/Dial.qml index a4b5c3f..af44cbe 100644 --- a/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/Dial.qml +++ b/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/Dial.qml @@ -75,45 +75,4 @@ Item { rotation: min + (max - min) * root.value source: Qt.resolvedUrl(root.dialCursor) } - - ShaderEffect { - anchors.fill: meter - property var pattern: Image { - source: Qt.resolvedUrl("images/dial_pattern.png") - } - property var fill: Image { - source: Qt.resolvedUrl(root.fillImage) - } - property real value: root.value - - fragmentShader: " -#define M_PI 3.141592653589793 -#define INNER " + root.circleRadius + " - -varying highp vec2 qt_TexCoord0; -uniform lowp float qt_Opacity; -uniform sampler2D pattern; -uniform sampler2D fill; -uniform lowp float value; - -void main() { - lowp vec4 pattern = texture2D(pattern, qt_TexCoord0); - lowp vec4 fill = texture2D(fill, qt_TexCoord0); - - lowp vec2 pos = vec2(qt_TexCoord0.x - 0.5, 0.501 - qt_TexCoord0.y); - lowp float d = length(pos); - lowp float angle = atan(pos.x, pos.y) / (2.0 * M_PI); - lowp float v = 0.66 * value - 0.33; - - // Flare pattern - lowp vec4 color = mix(pattern, vec4(0.0), smoothstep(v, v + 0.1, angle)); - // Gradient fill color - color += mix(fill, vec4(0.0), step(v, angle)); - // Punch out the center hole - color = mix(vec4(0.0), color, smoothstep(INNER - 0.001, INNER + 0.001, d)); - // Fade out below 0 - gl_FragColor = mix(color, vec4(0.0), smoothstep(-0.35, -0.5, angle)); -} - " - } } diff --git a/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/LeftDial.qml b/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/LeftDial.qml index f57b8af..0cae23f 100644 --- a/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/LeftDial.qml +++ b/examples/ivicore/qface-tutorial/chapter6-own-backend/instrument-cluster/LeftDial.qml @@ -52,7 +52,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtGraphicalEffects 1.0 Item { id: root diff --git a/examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml b/examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml index a4b5c3f..af44cbe 100644 --- a/examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml +++ b/examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml @@ -75,45 +75,4 @@ Item { rotation: min + (max - min) * root.value source: Qt.resolvedUrl(root.dialCursor) } - - ShaderEffect { - anchors.fill: meter - property var pattern: Image { - source: Qt.resolvedUrl("images/dial_pattern.png") - } - property var fill: Image { - source: Qt.resolvedUrl(root.fillImage) - } - property real value: root.value - - fragmentShader: " -#define M_PI 3.141592653589793 -#define INNER " + root.circleRadius + " - -varying highp vec2 qt_TexCoord0; -uniform lowp float qt_Opacity; -uniform sampler2D pattern; -uniform sampler2D fill; -uniform lowp float value; - -void main() { - lowp vec4 pattern = texture2D(pattern, qt_TexCoord0); - lowp vec4 fill = texture2D(fill, qt_TexCoord0); - - lowp vec2 pos = vec2(qt_TexCoord0.x - 0.5, 0.501 - qt_TexCoord0.y); - lowp float d = length(pos); - lowp float angle = atan(pos.x, pos.y) / (2.0 * M_PI); - lowp float v = 0.66 * value - 0.33; - - // Flare pattern - lowp vec4 color = mix(pattern, vec4(0.0), smoothstep(v, v + 0.1, angle)); - // Gradient fill color - color += mix(fill, vec4(0.0), step(v, angle)); - // Punch out the center hole - color = mix(vec4(0.0), color, smoothstep(INNER - 0.001, INNER + 0.001, d)); - // Fade out below 0 - gl_FragColor = mix(color, vec4(0.0), smoothstep(-0.35, -0.5, angle)); -} - " - } } diff --git a/examples/ivicore/qface-tutorial/instrument-cluster/LeftDial.qml b/examples/ivicore/qface-tutorial/instrument-cluster/LeftDial.qml index f57b8af..0cae23f 100644 --- a/examples/ivicore/qface-tutorial/instrument-cluster/LeftDial.qml +++ b/examples/ivicore/qface-tutorial/instrument-cluster/LeftDial.qml @@ -52,7 +52,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtGraphicalEffects 1.0 Item { id: root -- cgit v1.2.1