Warning, /maui/mauikit-accounts/src/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2020 Camilo Higuita <milo.h@aol.com>
0002 #
0003 # SPDX-License-Identifier: BSD-2-Clause
0004 
0005 remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY)
0006 
0007 ecm_add_qml_module(MauiKitAccounts${MAUI_MAJOR_VERSION} URI "org.mauikit.accounts" CLASSNAME AccountsPlugin)
0008 
0009 set(sources
0010     code/accounts_plugin.cpp
0011     code/mauiaccounts.cpp
0012     code/accountsdb.cpp
0013     code/moduleinfo.cpp
0014     code/accounts.qrc)
0015 
0016 set(headers
0017     code/mauiaccounts.h
0018     code/moduleinfo.h
0019     code/accountsdb.h)
0020 
0021 if(QT_MAJOR_VERSION STREQUAL "5")
0022     if(QUICK_COMPILER)
0023         qtquick_compiler_add_resources(accounts_QML_QRC resources.qrc)
0024     else()
0025         qt5_add_resources(accounts_QML_QRC resources.qrc)
0026     endif()
0027 endif()
0028 
0029 ecm_target_qml_sources(MauiKitAccounts${MAUI_MAJOR_VERSION} SOURCES
0030     controls.${QT_MAJOR_VERSION}/AccountsDialog.qml
0031     controls.${QT_MAJOR_VERSION}/AccountsMenuItem.qml
0032     controls.${QT_MAJOR_VERSION}/CredentialsDialog.qml)
0033 
0034 target_sources(MauiKitAccounts${MAUI_MAJOR_VERSION}
0035     PRIVATE
0036     ${sources})
0037 
0038 add_library(MauiKit${MAUI_MAJOR_VERSION}::Accounts ALIAS MauiKitAccounts${MAUI_MAJOR_VERSION})
0039 
0040 if (QT_MAJOR_VERSION STREQUAL "5")
0041     if(QUICK_COMPILER)
0042         target_sources(MauiKitAccounts${MAUI_MAJOR_VERSION} PRIVATE ${accounts_QML_QRC})
0043 
0044         add_definitions(-DQUICK_COMPILER)
0045         target_compile_definitions(MauiKitAccounts${MAUI_MAJOR_VERSION} PUBLIC QUICK_COMPILER)
0046     endif()
0047 endif()
0048 
0049 generate_export_header(MauiKitAccounts${MAUI_MAJOR_VERSION} BASE_NAME Accounts)
0050 set_target_properties(MauiKitAccounts${MAUI_MAJOR_VERSION} PROPERTIES
0051     VERSION ${PROJECT_VERSION}
0052     SOVERSION ${PROJECT_VERSION_MAJOR}
0053     EXPORT_NAME "Accounts")
0054 
0055 target_include_directories(MauiKitAccounts${MAUI_MAJOR_VERSION}
0056     INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/MauiKit${MAUI_MAJOR_VERSION}/Accounts>")
0057 
0058 target_include_directories(MauiKitAccounts${MAUI_MAJOR_VERSION} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR};>")
0059 
0060 if(ANDROID)
0061     target_link_libraries(MauiKitAccounts${MAUI_MAJOR_VERSION} PRIVATE Qt${QT_MAJOR_VERSION}::AndroidExtras)
0062 endif()
0063 
0064 target_link_libraries(MauiKitAccounts${MAUI_MAJOR_VERSION}
0065     PRIVATE
0066     Qt${QT_MAJOR_VERSION}::Core
0067     Qt${QT_MAJOR_VERSION}::Quick
0068     Qt${QT_MAJOR_VERSION}::Qml
0069     Qt${QT_MAJOR_VERSION}::Sql
0070     Qt${QT_MAJOR_VERSION}::Network
0071     KF${KF_MAJOR_VERSION}::I18n
0072     MauiKit${MAUI_MAJOR_VERSION})
0073 
0074 ecm_finalize_qml_module(MauiKitAccounts${MAUI_MAJOR_VERSION} DESTINATION ${KDE_INSTALL_QMLDIR})
0075 ecm_generate_qmltypes(org.mauikit.accounts 3.0 DESTINATION ${KDE_INSTALL_QMLDIR}/org/mauikit/accounts)
0076 
0077 install(TARGETS MauiKitAccounts${MAUI_MAJOR_VERSION} EXPORT MauiKitAccounts${MAUI_MAJOR_VERSION}Targets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0078 
0079 install(FILES
0080     ${headers}
0081     ${CMAKE_CURRENT_BINARY_DIR}/accounts_export.h
0082     DESTINATION ${KDE_INSTALL_INCLUDEDIR}/MauiKit${MAUI_MAJOR_VERSION}/Accounts
0083     COMPONENT Devel)