CMakeLists.txt 3.48 KB
Newer Older
1
cmake_minimum_required(VERSION 3.0)
Anupam Basak's avatar
Anupam Basak committed
2 3
set(VVAVE_VERSION 1.0.0)
project(vvave VERSION ${VVAVE_VERSION})
4 5 6

find_package(ECM 1.7.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH})
camilo higuita's avatar
camilo higuita committed
7
set(CMAKE_CXX_STANDARD 17)
8

Camilo Higuita's avatar
Camilo Higuita committed
9
find_package(MauiKit REQUIRED)
10
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Qml Quick Network WebSockets Sql QuickControls2 Xml Multimedia DBus Svg WebView)
Nicolas Fella's avatar
Nicolas Fella committed
11
find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO Attica SyntaxHighlighting)
12 13 14 15 16
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMInstallIcons)
include(ECMAddAppIcon)
Anupam Basak's avatar
Anupam Basak committed
17 18
include(ECMSetupVersion)
include(FeatureSummary)
19 20

set(CMAKE_INCLUDE_CURRENT_DIR ON)
21 22
set(CMAKE_AUTORCC ON)

23 24 25 26 27
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/services/web
    ${CMAKE_CURRENT_BINARY_DIR}/services/web
    )

28 29 30
add_executable(vvave
    qml.qrc
    main.cpp
Camilo higuita's avatar
fixes  
Camilo higuita committed
31
    vvave.cpp
32 33
#    pulpo/services/geniusService.cpp
#    pulpo/services/deezerService.cpp
34
    pulpo/services/lastfmService.cpp
35 36 37
#    pulpo/services/lyricwikiaService.cpp
#    pulpo/services/spotifyService.cpp
#    pulpo/services/musicbrainzService.cpp
38 39
    pulpo/pulpo.cpp
    pulpo/htmlparser.cpp
40
    pulpo/service.cpp
41 42 43
    services/local/taginfo.cpp
    services/local/player.cpp
    services/local/youtubedl.cpp
camilo higuita's avatar
camilo higuita committed
44
#    services/local/linking.cpp
45
#    services/local/socket.cpp
46
    services/web/youtube.cpp
47 48
    services/web/NextCloud/nextmusic.cpp
    services/web/abstractmusicprovider.cpp
camilo higuita's avatar
camilo higuita committed
49
#    services/web/Spotify/spotify.cpp
50
    db/collectionDB.cpp
51
#    utils/brain.cpp
52
    models/tracks/tracksmodel.cpp
camilo higuita's avatar
camilo higuita committed
53 54
    models/playlists/playlistsmodel.cpp
    models/albums/albumsmodel.cpp
55
    models/cloud/cloud.cpp
56
    )
57

Anupam Basak's avatar
Anupam Basak committed
58 59 60 61 62
ecm_setup_version(${VVAVE_VERSION}
    VARIABLE_PREFIX VVAVE
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/vvave_version.h"
    )

63
if (ANDROID)
64
    find_package(Qt5 REQUIRED COMPONENTS AndroidExtras WebView Xml)
65
    find_package(OpenSSL REQUIRED)
66 67 68 69 70

    include(ExternalProject)
    externalproject_add(taglib
        URL http://taglib.org/releases/taglib-1.11.1.tar.gz
        CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
71
        )
72
    set(TAGLIB_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include ${CMAKE_INSTALL_PREFIX}/include/taglib)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
73
    set(TAGLIB_LIBRARIES ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/libtag.a)
74

Nicolas Fella's avatar
Nicolas Fella committed
75
    target_link_libraries(vvave MauiKit Qt5::AndroidExtras Qt5::WebView Qt5::Xml OpenSSL::SSL)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
76
    add_dependencies(vvave taglib)
camilo higuita's avatar
camilo higuita committed
77
    kde_source_files_enable_exceptions(vvave)
78 79 80 81 82
else()
    find_package(Taglib REQUIRED)
    target_sources(vvave PRIVATE
        kde/mpris2.cpp
        kde/notify.cpp
83
        )
84
    target_link_libraries(vvave Qt5::WebView KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n Qt5::DBus KF5::Attica KF5::SyntaxHighlighting)
85
endif()
86

87
target_include_directories(vvave PRIVATE ${TAGLIB_INCLUDE_DIRS})
88
target_link_libraries(vvave MauiKit Qt5::Network Qt5::Sql Qt5::WebSockets Qt5::Qml Qt5::Xml Qt5::Multimedia  Qt5::QuickControls2 ${TAGLIB_LIBRARIES})
89 90

install(TARGETS vvave ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
91
install(FILES org.kde.vvave.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
92 93 94

#TODO: port to ecm_install_icons()
install(FILES assets/vvave.svg DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/scalable/apps)
95
install(FILES org.kde.vvave.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
96

Camilo higuita's avatar
Camilo higuita committed
97
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)