aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/ivigenerator
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/ivigenerator')
-rw-r--r--src/tools/ivigenerator/templates/backend_qtro.yaml1
-rw-r--r--src/tools/ivigenerator/templates/backend_qtro/CMakeLists.txt.tpl19
-rw-r--r--src/tools/ivigenerator/templates/backend_simulator.yaml1
-rw-r--r--src/tools/ivigenerator/templates/backend_simulator/CMakeLists.txt.tpl13
-rw-r--r--src/tools/ivigenerator/templates/backend_simulator/plugin.pri.tpl4
-rw-r--r--src/tools/ivigenerator/templates/frontend.yaml1
-rw-r--r--src/tools/ivigenerator/templates/frontend/CMakeLists.txt.tpl14
-rw-r--r--src/tools/ivigenerator/templates/qmlplugin.yaml1
-rw-r--r--src/tools/ivigenerator/templates/qmlplugin/CMakeLists.txt.tpl33
-rw-r--r--src/tools/ivigenerator/templates/server_qtro.yaml1
-rw-r--r--src/tools/ivigenerator/templates/server_qtro/CMakeLists.txt.tpl13
-rw-r--r--src/tools/ivigenerator/templates/server_qtro_simulator.yaml1
-rw-r--r--src/tools/ivigenerator/templates/server_qtro_simulator/CMakeLists.txt.tpl23
-rw-r--r--src/tools/ivigenerator/templates/test.yaml1
-rw-r--r--src/tools/ivigenerator/templates/test/CMakeLists.txt.tpl7
15 files changed, 129 insertions, 4 deletions
diff --git a/src/tools/ivigenerator/templates/backend_qtro.yaml b/src/tools/ivigenerator/templates/backend_qtro.yaml
index 795d781..0d0fbff 100644
--- a/src/tools/ivigenerator/templates/backend_qtro.yaml
+++ b/src/tools/ivigenerator/templates/backend_qtro.yaml
@@ -5,6 +5,7 @@ backend_qtro:
- "{{module.module_name|lower}}qtroplugin.cpp": "plugin.cpp.tpl"
- "{{module.module_name|lower}}.json": "plugin.json"
- "{{srcBase|lower}}.pri": "plugin.pri.tpl"
+ - '{{srcBase|lower}}.cmake': 'CMakeLists.txt.tpl'
interface:
documents:
- '{{interface|lower}}backend.h': 'backend.h.tpl'
diff --git a/src/tools/ivigenerator/templates/backend_qtro/CMakeLists.txt.tpl b/src/tools/ivigenerator/templates/backend_qtro/CMakeLists.txt.tpl
new file mode 100644
index 0000000..f72276c
--- /dev/null
+++ b/src/tools/ivigenerator/templates/backend_qtro/CMakeLists.txt.tpl
@@ -0,0 +1,19 @@
+find_package(Qt6 COMPONENTS RemoteObjects IviRemoteObjectsHelper)
+
+target_sources(${CURRENT_TARGET}
+ PRIVATE
+{% for interface in module.interfaces %}
+ {{interface|lower}}backend.cpp
+{% endfor %}
+ {{module.module_name|lower}}qtroplugin.cpp
+)
+
+qt_add_repc_replica(${CURRENT_TARGET}
+{% for interface in module.interfaces %}
+ {{interface|lower}}.rep
+{% endfor %}
+)
+
+### MISSING
+# OTHER_FILES += \
+# $$PWD/{{module.module_name|lower}}.json
diff --git a/src/tools/ivigenerator/templates/backend_simulator.yaml b/src/tools/ivigenerator/templates/backend_simulator.yaml
index bf8dad7..e1a75d2 100644
--- a/src/tools/ivigenerator/templates/backend_simulator.yaml
+++ b/src/tools/ivigenerator/templates/backend_simulator.yaml
@@ -8,6 +8,7 @@ backend_simulator:
- "{{module.module_name|lower}}_simulation_data.json": "common/simulation_data.json.tpl"
- "{{module.module_name|lower}}_simulation.qrc": "common/simulation.qrc.tpl"
- "{{srcBase|lower}}.pri": "plugin.pri.tpl"
+ - '{{srcBase|lower}}.cmake': 'CMakeLists.txt.tpl'
- "qml/{{module|qml_type|replace('.', '/')}}/simulation/plugins.qmltypes": "common/simulation.qmltypes.tpl"
- "qml/{{module|qml_type|replace('.', '/')}}/simulation/qmldir": "common/qmldir.tpl"
- "qml/{{module|qml_type|replace('.', '/')}}/plugins.qmltypes": "common/plugins.qmltypes.tpl"
diff --git a/src/tools/ivigenerator/templates/backend_simulator/CMakeLists.txt.tpl b/src/tools/ivigenerator/templates/backend_simulator/CMakeLists.txt.tpl
new file mode 100644
index 0000000..843a3f4
--- /dev/null
+++ b/src/tools/ivigenerator/templates/backend_simulator/CMakeLists.txt.tpl
@@ -0,0 +1,13 @@
+target_sources(${CURRENT_TARGET}
+ PRIVATE
+{% for interface in module.interfaces %}
+ {{interface|lower}}backend.cpp
+{% endfor %}
+ {{module.module_name|lower}}simulatorplugin.cpp
+ {{module.module_name|lower}}_simulation.qrc
+)
+
+### MISSING
+# OTHER_FILES += \
+# $$PWD/{{module.module_name|lower}}.json \
+# $$PWD/{{module.module_name|lower}}_simulation_data.json
diff --git a/src/tools/ivigenerator/templates/backend_simulator/plugin.pri.tpl b/src/tools/ivigenerator/templates/backend_simulator/plugin.pri.tpl
index 84dbe37..62a76b2 100644
--- a/src/tools/ivigenerator/templates/backend_simulator/plugin.pri.tpl
+++ b/src/tools/ivigenerator/templates/backend_simulator/plugin.pri.tpl
@@ -42,10 +42,6 @@
## Do not edit! All changes made to it will be lost.
#############################################################################
-{% if 'simulator' in features %}
-QT += simulator
-{% endif %}
-
HEADERS += \
{% for interface in module.interfaces %}
$$PWD/{{interface|lower}}backend.h \
diff --git a/src/tools/ivigenerator/templates/frontend.yaml b/src/tools/ivigenerator/templates/frontend.yaml
index 7aec967..7323d32 100644
--- a/src/tools/ivigenerator/templates/frontend.yaml
+++ b/src/tools/ivigenerator/templates/frontend.yaml
@@ -8,6 +8,7 @@ frontend:
- '{{module.module_name|lower}}modulefactory.h': 'modulefactory.h.tpl'
- '{{module.module_name|lower}}modulefactory.cpp': 'modulefactory.cpp.tpl'
- '{{srcBase|lower}}.pri': 'module.pri.tpl'
+ - '{{srcBase|lower}}.cmake': 'CMakeLists.txt.tpl'
- 'qml/{{module|qml_type|replace(".", "/")}}/plugins.qmltypes': 'common/plugins.qmltypes.tpl'
- "qml/{{module|qml_type|replace('.', '/')}}/designer/{{module.module_name|lower}}.metainfo": "common/designer.metainfo.tpl"
- 'qml/{{module|qml_type|replace(".", "/")}}/qmldir': 'common/qmldir.tpl'
diff --git a/src/tools/ivigenerator/templates/frontend/CMakeLists.txt.tpl b/src/tools/ivigenerator/templates/frontend/CMakeLists.txt.tpl
new file mode 100644
index 0000000..4f39367
--- /dev/null
+++ b/src/tools/ivigenerator/templates/frontend/CMakeLists.txt.tpl
@@ -0,0 +1,14 @@
+target_compile_definitions(${CURRENT_TARGET} PRIVATE QT_BUILD_{{module|upper|replace('.', '_')|strip_QT}}_LIB)
+
+target_sources(${CURRENT_TARGET}
+ PRIVATE
+{% for interface in module.interfaces %}
+ {{interface|lower}}.cpp
+ {{interface|lower}}backendinterface.cpp
+{% endfor %}
+{% for struct in module.structs %}
+ {{struct|lower}}.cpp
+{% endfor %}
+ {{module.module_name|lower}}module.cpp
+ {{module.module_name|lower}}modulefactory.cpp
+)
diff --git a/src/tools/ivigenerator/templates/qmlplugin.yaml b/src/tools/ivigenerator/templates/qmlplugin.yaml
index 368b4c1..e64398c 100644
--- a/src/tools/ivigenerator/templates/qmlplugin.yaml
+++ b/src/tools/ivigenerator/templates/qmlplugin.yaml
@@ -3,6 +3,7 @@ qmlplugin:
documents:
- "plugin.cpp": "plugin.cpp.tpl"
- "{{srcBase|lower}}.pri": "module.pri.tpl"
+ - '{{srcBase|lower}}.cmake': 'CMakeLists.txt.tpl'
- "plugins.qmltypes": "common/plugins.qmltypes.tpl"
- "designer/{{module.module_name|lower}}.metainfo": "common/designer.metainfo.tpl"
- "qmldir": "qmldir_plugin.tpl"
diff --git a/src/tools/ivigenerator/templates/qmlplugin/CMakeLists.txt.tpl b/src/tools/ivigenerator/templates/qmlplugin/CMakeLists.txt.tpl
new file mode 100644
index 0000000..435b92a
--- /dev/null
+++ b/src/tools/ivigenerator/templates/qmlplugin/CMakeLists.txt.tpl
@@ -0,0 +1,33 @@
+# TODO We probably dont' need this template at all in the cmake case
+# Keep it until the templates have been adapted and everything can be done without autogenerating
+
+if (NOT TARGET ${CURRENT_TARGET})
+ qt_add_qml_module(${CURRENT_TARGET}
+ URI "{{module|qml_type}}"
+ VERSION "{{module.majorVersion}}.{{module.minorVersion}}"
+ SKIP_TYPE_REGISTRATION
+ # TODO remove this again
+ # This is needed to make the test build work as it would create duplicate qmldir entries
+ # in the global qml folder
+ OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ PUBLIC_LIBRARIES
+ Qt::IviCore
+ SOURCES
+ plugin.cpp
+ )
+else()
+ target_sources(${CURRENT_TARGET}
+ PRIVATE
+ plugin.cpp
+ )
+endif()
+
+#set_target_properties(${CURRENT_TARGET} PROPERTIES
+# QT_QML_MODULE_VERSION {{module.majorVersion}}.{{module.minorVersion}}
+# QT_QML_MODULE_URI {{module|qml_type}}
+# QT_QMLTYPES_FILENAME plugins.qmltypes
+#)
+
+### MISSING
+# AUX_QML_FILES += $$PWD/qmldir \
+# $$PWD/designer/{{module.module_name|lower}}.metainfo
diff --git a/src/tools/ivigenerator/templates/server_qtro.yaml b/src/tools/ivigenerator/templates/server_qtro.yaml
index 0c8024e..f397468 100644
--- a/src/tools/ivigenerator/templates/server_qtro.yaml
+++ b/src/tools/ivigenerator/templates/server_qtro.yaml
@@ -4,6 +4,7 @@ server_qtro:
- "core.cpp": "core.cpp.tpl"
- "core.h": "core.h.tpl"
- "{{srcBase|lower}}.pri": "server.pri.tpl"
+ - '{{srcBase|lower}}.cmake': 'CMakeLists.txt.tpl'
interface:
documents:
- "{{interface|lower}}.rep": "common/interface.rep.tpl"
diff --git a/src/tools/ivigenerator/templates/server_qtro/CMakeLists.txt.tpl b/src/tools/ivigenerator/templates/server_qtro/CMakeLists.txt.tpl
new file mode 100644
index 0000000..963d7aa
--- /dev/null
+++ b/src/tools/ivigenerator/templates/server_qtro/CMakeLists.txt.tpl
@@ -0,0 +1,13 @@
+find_package(Qt6 COMPONENTS RemoteObjects)
+
+target_sources(${CURRENT_TARGET}
+ PRIVATE
+ core.cpp
+)
+
+qt_add_repc_source(${CURRENT_TARGET}
+{% for interface in module.interfaces %}
+ {{interface|lower}}.rep
+{% endfor %}
+)
+
diff --git a/src/tools/ivigenerator/templates/server_qtro_simulator.yaml b/src/tools/ivigenerator/templates/server_qtro_simulator.yaml
index 5563460..5a8dabe 100644
--- a/src/tools/ivigenerator/templates/server_qtro_simulator.yaml
+++ b/src/tools/ivigenerator/templates/server_qtro_simulator.yaml
@@ -4,6 +4,7 @@ server_qtro_simulator:
- "core.cpp": "core.cpp.tpl"
- "core.h": "core.h.tpl"
- "{{srcBase|lower}}.pri": "server.pri.tpl"
+ - '{{srcBase|lower}}.cmake': 'CMakeLists.txt.tpl'
- "main.cpp": "main.cpp.tpl"
- "{{module.module_name|lower}}_simulation.qml": "common/module_simulation.qml.tpl"
- "{{module.module_name|lower}}_simulation_data.json": "common/simulation_data.json.tpl"
diff --git a/src/tools/ivigenerator/templates/server_qtro_simulator/CMakeLists.txt.tpl b/src/tools/ivigenerator/templates/server_qtro_simulator/CMakeLists.txt.tpl
new file mode 100644
index 0000000..7398ad1
--- /dev/null
+++ b/src/tools/ivigenerator/templates/server_qtro_simulator/CMakeLists.txt.tpl
@@ -0,0 +1,23 @@
+find_package(Qt6 COMPONENTS RemoteObjects IviRemoteObjectsHelper)
+
+target_sources(${CURRENT_TARGET}
+ PRIVATE
+{% for interface in module.interfaces %}
+ {{interface|lower}}backend.cpp
+ {{interface|lower}}adapter.cpp
+{% endfor %}
+ core.cpp
+ main.cpp
+ {{module.module_name|lower}}_simulation.qrc
+)
+
+qt_add_repc_source(${CURRENT_TARGET}
+{% for interface in module.interfaces %}
+ {{interface|lower}}.rep
+{% endfor %}
+)
+
+### MISSING
+# OTHER_FILES += \
+# $$PWD/{{module.module_name|lower}}.json \
+# $$PWD/{{module.module_name|lower}}_simulation_data.json
diff --git a/src/tools/ivigenerator/templates/test.yaml b/src/tools/ivigenerator/templates/test.yaml
index fbd2801..70bec2d 100644
--- a/src/tools/ivigenerator/templates/test.yaml
+++ b/src/tools/ivigenerator/templates/test.yaml
@@ -2,6 +2,7 @@ test:
module:
documents:
- "{{srcBase|lower}}.pri": "module.pri.tpl"
+ - '{{srcBase|lower}}.cmake': 'CMakeLists.txt.tpl'
- 'main.cpp': 'main.cpp.tpl'
interface:
documents:
diff --git a/src/tools/ivigenerator/templates/test/CMakeLists.txt.tpl b/src/tools/ivigenerator/templates/test/CMakeLists.txt.tpl
new file mode 100644
index 0000000..4348529
--- /dev/null
+++ b/src/tools/ivigenerator/templates/test/CMakeLists.txt.tpl
@@ -0,0 +1,7 @@
+target_sources(${CURRENT_TARGET}
+ PRIVATE
+{% for interface in module.interfaces %}
+ tst_{{interface|lower}}.cpp
+{% endfor %}
+ main.cpp
+)