CMakeLists.txt 2.77 KB
Newer Older
1
add_definitions(-DTRANSLATION_DOMAIN=\"libdiscover\")
Lasse Liehu's avatar
Lasse Liehu committed
2

3
4
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-paths.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-paths.h)

5
add_subdirectory(backends)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
6
add_subdirectory(notifiers)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
7
add_subdirectory(tests)
8

9
set(discovercommon_SRCS
10
11
    Category/Category.cpp
    Category/CategoryModel.cpp
12
    Category/CategoriesReader.cpp
13
    ReviewsBackend/AbstractReviewsBackend.cpp
14
15
    ReviewsBackend/Rating.cpp
    ReviewsBackend/Review.cpp
16
    ReviewsBackend/ReviewsModel.cpp
17
    Transaction/AddonList.cpp
18
    Transaction/Transaction.cpp
19
    Transaction/TransactionListener.cpp
20
    Transaction/TransactionModel.cpp
21
22
    UpdateModel/UpdateItem.cpp
    UpdateModel/UpdateModel.cpp
23
24
    resources/ResourcesModel.cpp
    resources/ResourcesProxyModel.cpp
25
    resources/PackageState.cpp
26
    resources/ResourcesUpdatesModel.cpp
27
    resources/StandardBackendUpdater.cpp
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
28
29
30
31
32
    resources/SourcesModel.cpp
    resources/AbstractResourcesBackend.cpp
    resources/AbstractResource.cpp
    resources/AbstractBackendUpdater.cpp
    resources/AbstractSourcesBackend.cpp
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
33
    resources/StoredResultsStream.cpp
34
    ActionsModel.cpp
35
    DiscoverBackendsFactory.cpp
36
37
    ScreenshotsModel.cpp
    ApplicationAddonsModel.cpp
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
38
    CachedNetworkAccessManager.cpp
39
)
40

Laurent Montel's avatar
Laurent Montel committed
41
42
ecm_qt_declare_logging_category(discovercommon_SRCS HEADER libdiscover_debug.h IDENTIFIER LIBDISCOVER_LOG CATEGORY_NAME org.kde.plasma.libdiscover)

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
43
44

add_library(DiscoverCommon ${discovercommon_SRCS})
45
if(TARGET AppStreamQt)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
46
    target_sources(DiscoverCommon PRIVATE
47
48
        appstream/OdrsReviewsBackend.cpp
        appstream/AppStreamIntegration.cpp
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
49
        appstream/AppStreamUtils.cpp
50
    )
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
51
    target_link_libraries(DiscoverCommon PRIVATE AppStreamQt)
52

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
53
54
55
56
57
    if(AppStreamQt_VERSION VERSION_GREATER 0.12.4)
        target_compile_definitions(DiscoverCommon PRIVATE -DAPPSTREAM_HAS_SPDX=1)
    else()
        target_compile_definitions(DiscoverCommon PRIVATE -DAPPSTREAM_HAS_SPDX=0)
    endif()
58
59
60
61
62
    if(AppStreamQt_VERSION VERSION_GREATER 0.12.7)
        target_compile_definitions(DiscoverCommon PRIVATE -DAPPSTREAM_HAS_SPDX_LICENSEURL=1)
    else()
        target_compile_definitions(DiscoverCommon PRIVATE -DAPPSTREAM_HAS_SPDX_LICENSEURL=0)
    endif()
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
63
endif()
64

65
target_link_libraries(DiscoverCommon
66
PUBLIC
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
67
    Qt5::Core
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
68
    Qt5::Qml
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
69
    Qt5::Widgets
70
    KF5::I18n
71
    KF5::ItemModels
72
PRIVATE
73
    Qt5::Xml
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
74
    KF5::CoreAddons
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
75
    KF5::KIOWidgets # KIO/AccessManager
76
)
Aleix Pol Gonzalez's avatar
Iterate    
Aleix Pol Gonzalez committed
77
add_library(Discover::Common ALIAS DiscoverCommon)
Jonathan Thomas's avatar
Jonathan Thomas committed
78

79
generate_export_header(DiscoverCommon)
80

81
target_include_directories(DiscoverCommon PRIVATE ${PHONON_INCLUDES} PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
82

83
install(TARGETS DiscoverCommon DESTINATION ${CMAKE_INSTALL_LIBDIR}/plasma-discover)
84
install(FILES resources/discoverabstractnotifier.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})