CMakeLists.txt 3.14 KB
Newer Older
1
project(vvave)
2 3 4 5
cmake_minimum_required(VERSION 3.0)

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
6
set(CMAKE_CXX_STANDARD 17)
7

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

set(CMAKE_INCLUDE_CURRENT_DIR ON)
19 20 21 22 23
set(CMAKE_AUTORCC ON)

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

if (ANDROID)
50
    find_package(Qt5 REQUIRED COMPONENTS AndroidExtras WebView Xml)
51
    find_package(OpenSSL REQUIRED)
52 53 54 55 56

    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}
57
        )
58
    set(TAGLIB_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include ${CMAKE_INSTALL_PREFIX}/include/taglib)
59
    set(TAGLIB_LIBRARIES ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/libtag.a)
60

Nicolas Fella's avatar
Nicolas Fella committed
61
    target_link_libraries(vvave MauiKit Qt5::AndroidExtras Qt5::WebView Qt5::Xml OpenSSL::SSL)
62
    add_dependencies(vvave taglib)
camilo higuita's avatar
camilo higuita committed
63
    kde_source_files_enable_exceptions(vvave)
64 65 66 67 68 69
else()
    find_package(Taglib REQUIRED)
    find_package(Qt5 REQUIRED COMPONENTS WebEngine)
    target_sources(vvave PRIVATE
        kde/mpris2.cpp
        kde/notify.cpp
70
        )
71
    target_link_libraries(vvave Qt5::WebEngine KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n Qt5::DBus KF5::Attica KF5::SyntaxHighlighting)
72
endif()
73

74
target_include_directories(vvave PRIVATE ${TAGLIB_INCLUDE_DIRS})
Camilo higuita's avatar
Camilo higuita committed
75
target_link_libraries(vvave MauiKit Qt5::Network Qt5::Sql Qt5::WebSockets Qt5::Qml Qt5::Xml Qt5::Multimedia Qt5::Widgets Qt5::QuickControls2 ${TAGLIB_LIBRARIES})
76 77

install(TARGETS vvave ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
78
install(FILES org.kde.vvave.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
79 80 81

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

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