Debian Codegraph @

online-accounts/lib/qml/Lomiri/OnlineAccounts/CMakeLists.txt

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 project(LomiriOnlineAccountsQML LANGUAGES CXX)
2
3 pkg_check_modules(ACCOUNTSQT accounts-qt${QT_VERSION} REQUIRED)
4
5 set(LOA_QML_MODULE LomiriOnlineAccountsQML)
6 set(API_URI Lomiri.OnlineAccounts)
7 set(API_VERSION 2.0)
8
9 set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined")
10
11 if(ENABLE_QT6)
12 qt_add_qml_module(${LOA_QML_MODULE}
13 URI ${API_URI}
14 VERSION ${API_VERSION}
15 SOURCES plugin.cpp plugin.h
16 account.cpp account.h
17 account_model.cpp account_model.h
18 authentication_data.cpp authentication_data.h
19 plugin.cpp plugin.h
20 PLUGIN_TARGET ${LOA_QML_MODULE}
21 CLASS_NAME Plugin
22 NO_GENERATE_PLUGIN_SOURCE
23 NO_PLUGIN_OPTIONAL)
24 qt_query_qml_module(${LOA_QML_MODULE}
25 PLUGIN_TARGET module_plugin_target
26 TARGET_PATH module_target_path
27 QMLDIR module_qmldir
28 TYPEINFO module_typeinfo
29 )
30 target_compile_options(${LOA_QML_MODULE} PRIVATE
31 ${ACCOUNTSQT_CFLAGS}
32 )
33 target_include_directories(${LOA_QML_MODULE} PRIVATE
34 ${CMAKE_CURRENT_SOURCE_DIR}
35 ${CMAKE_SOURCE_DIR}/online-accounts/lib/qt
36 )
37 target_link_libraries(${LOA_QML_MODULE} PRIVATE
38 Qt${QT_VERSION}::Core
39 Qt${QT_VERSION}::Qml
40 lomiri-online-accounts-qt${QT_VERSION}
41 ${ACCOUNTSQT_LDFLAGS}
42 )
43
44 set(PLUGIN_IMPORTS_DIR "${QT_INSTALL_QML}/${module_target_path}")
45 install(TARGETS ${module_plugin_target} DESTINATION "${PLUGIN_IMPORTS_DIR}")
46 install(FILES ${module_qmldir} DESTINATION "${PLUGIN_IMPORTS_DIR}")
47 # install(FILES ${module_typeinfo} DESTINATION "${PLUGIN_IMPORTS_DIR}")
48 else()
49 include_directories(
50 ${CMAKE_CURRENT_SOURCE_DIR}
51 ${CMAKE_SOURCE_DIR}/online-accounts/lib/qt
52 )
53
54 if(ENABLE_UBUNTU_COMPAT AND NOT ENABLE_QT6)
55 add_definitions(-DLOMIRI_ONLINEACCOUNTS_UBUNTU_COMPAT)
56 endif()
57
58 add_definitions(
59 ${ACCOUNTSQT_CFLAGS}
60 )
61
62 add_library(${LOA_QML_MODULE} MODULE
63 account.cpp
64 account_model.cpp
65 authentication_data.cpp
66 plugin.cpp
67 )
68
69 target_link_libraries(${LOA_QML_MODULE}
70 Qt${QT_VERSION}::Core
71 Qt${QT_VERSION}::Qml
72 lomiri-online-accounts-qt${QT_VERSION}
73 ${ACCOUNTSQT_LDFLAGS}
74 )
75
76
77 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qmldir.in ${CMAKE_CURRENT_BINARY_DIR}/qmldir @ONLY)
78
79 # Module install
80
81 # FIXME: do we really need this, it causes build failures from time to time (maybe related to
82 # a missing dependency declaration?
83 #add_custom_command(TARGET ${LOA_QML_MODULE} POST_BUILD
84 # COMMAND qmlplugindump -noinstantiate ${API_URI} ${API_VERSION} > ${CMAKE_CURRENT_BINARY_DIR}/plugin.qmltypes)
85
86 set(PLUGIN_IMPORTS_DIR "${QT_INSTALL_QML}/Lomiri/OnlineAccounts")
87 install(TARGETS ${LOA_QML_MODULE} DESTINATION ${PLUGIN_IMPORTS_DIR})
88 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmldir DESTINATION ${PLUGIN_IMPORTS_DIR})
89 # FIXME: see above (qmlplugindump command)
90 #install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugin.qmltypes DESTINATION ${PLUGIN_IMPORTS_DIR})
91 endif()