CMakeLists.txt 3.41 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)
10 11 12 13 14 15
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMInstallIcons)
include(FeatureSummary)
include(ECMAddAppIcon)
16 17

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

add_executable(vvave
    qml.qrc
    main.cpp
23
#    babe.cpp
Camilo higuita's avatar
Camilo higuita committed
24
    vvave.cpp
25

26 27
#    pulpo/services/geniusService.cpp
#    pulpo/services/deezerService.cpp
28
    pulpo/services/lastfmService.cpp
29 30 31
#    pulpo/services/lyricwikiaService.cpp
#    pulpo/services/spotifyService.cpp
#    pulpo/services/musicbrainzService.cpp
32 33
    pulpo/pulpo.cpp
    pulpo/htmlparser.cpp
34
    pulpo/service.cpp
35 36 37
    services/local/taginfo.cpp
    services/local/player.cpp
    services/local/youtubedl.cpp
camilo higuita's avatar
camilo higuita committed
38
#    services/local/linking.cpp
39
    services/local/socket.cpp
camilo higuita's avatar
camilo higuita committed
40
#    services/web/babeit.cpp
41
    services/web/youtube.cpp
camilo higuita's avatar
camilo higuita committed
42
#    services/web/Spotify/spotify.cpp
43
    db/collectionDB.cpp
44
#    settings/BabeSettings.cpp
45 46
#    settings/fileloader.cpp
#    utils/brain.cpp
camilo higuita's avatar
camilo higuita committed
47
#    utils/babeconsole.cpp
48 49 50
    models/tracks/tracksmodel.cpp
    models/basemodel.cpp
    models/baselist.cpp
camilo higuita's avatar
camilo higuita committed
51 52
    models/playlists/playlistsmodel.cpp
    models/albums/albumsmodel.cpp
camilo higuita's avatar
camilo higuita committed
53
#    models/cloud/cloud.cpp
54
    )
55 56

if (ANDROID)
57
    find_package(Qt5 REQUIRED COMPONENTS AndroidExtras WebView Xml)
58
    find_package(OpenSSL REQUIRED)
59 60 61 62 63

    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}
64
        )
65
    set(TAGLIB_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include ${CMAKE_INSTALL_PREFIX}/include/taglib)
66
    set(TAGLIB_LIBRARIES ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/libtag.a)
67

68
    target_link_libraries(vvave Qt5::AndroidExtras Qt5::WebView Qt5::Xml OpenSSL::SSL)
69
    add_dependencies(vvave taglib)
70
    kde_source_files_enable_exceptions(vvave babe.cpp)
71 72 73
else()
    find_package(Taglib REQUIRED)
    find_package(Qt5 REQUIRED COMPONENTS WebEngine)
Camilo higuita's avatar
Camilo higuita committed
74
    find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO Attica)
75 76 77
    target_sources(vvave PRIVATE
        kde/mpris2.cpp
        kde/notify.cpp
78
        )
Camilo higuita's avatar
Camilo higuita committed
79
    target_link_libraries(vvave Qt5::WebEngine KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n Qt5::DBus KF5::Attica)
80
endif()
81 82 83 84 85

if (TARGET create-apk-vvave)
    set_target_properties(create-apk-vvave PROPERTIES ANDROID_APK_DIR "${MAUIKIT_ANDROID_DIR}")
endif()

86
target_include_directories(vvave PRIVATE ${TAGLIB_INCLUDE_DIRS})
Camilo higuita's avatar
Camilo higuita committed
87
target_link_libraries(vvave MauiKit Qt5::Network Qt5::Sql Qt5::WebSockets Qt5::Qml Qt5::Xml Qt5::Multimedia Qt5::Widgets Qt5::QuickControls2 ${TAGLIB_LIBRARIES})
88 89

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

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

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