summaryrefslogtreecommitdiffstats
path: root/src/tools/ifcodegen/templates/backend_qtro/CMakeLists.txt.tpl
blob: d53c49d7242b9d0261b8c582d7a5b9f100425bfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{#
# Copyright (C) 2021 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#}
{% include "common/generated_comment.cmake.tpl" %}

if (NOT TARGET Qt6::RemoteObjects OR NOT TARGET Qt6::IfRemoteObjectsHelperPrivate)
    find_package(Qt6 COMPONENTS RemoteObjects IfRemoteObjectsHelperPrivate)
endif()

qt6_set_ifcodegen_variable(${VAR_PREFIX}_SOURCES
{% for interface in module.interfaces %}
    ${CMAKE_CURRENT_LIST_DIR}/{{interface|lower}}robackend.h
    ${CMAKE_CURRENT_LIST_DIR}/{{interface|lower}}robackend.cpp
{% endfor %}
    ${CMAKE_CURRENT_LIST_DIR}/{{module.module_name|lower}}roplugin.h
    ${CMAKE_CURRENT_LIST_DIR}/{{module.module_name|lower}}roplugin.cpp
)

qt6_set_ifcodegen_variable(${VAR_PREFIX}_REPLICAS
{% for interface in module.interfaces %}
    ${CMAKE_CURRENT_LIST_DIR}/{{interface|lower}}.rep
{% endfor %}
)

qt6_set_ifcodegen_variable(${VAR_PREFIX}_LIBRARIES
    Qt6::InterfaceFramework
    Qt6::RemoteObjects
    Qt6::IfRemoteObjectsHelper
    Qt6::IfRemoteObjectsHelperPrivate
)

if (TARGET ${CURRENT_TARGET})
    target_sources(${CURRENT_TARGET}
                   PRIVATE
        ${${VAR_PREFIX}_SOURCES}
    )

    qt6_add_repc_replicas(${CURRENT_TARGET}
        ${${VAR_PREFIX}_REPLICAS}
    )

    target_link_libraries(${CURRENT_TARGET} PRIVATE
        ${${VAR_PREFIX}_LIBRARIES}
    )

    target_include_directories(${CURRENT_TARGET} PRIVATE
        $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
    )
endif()