2020-10-25 23:14:46 +00:00
|
|
|
project(jellyfin-qt VERSION 0.1.0)
|
2020-10-25 18:58:02 +00:00
|
|
|
include(GNUInstallDirs)
|
2021-03-20 15:29:31 +00:00
|
|
|
include(FetchContent)
|
|
|
|
|
2021-03-23 01:13:56 +00:00
|
|
|
################################################################################
|
|
|
|
# Libraries #
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
find_package(Qt5 5.6 COMPONENTS Multimedia Network Qml WebSockets REQUIRED)
|
|
|
|
|
2021-03-20 15:29:31 +00:00
|
|
|
find_package(Boost REQUIRED)
|
2021-03-23 01:13:56 +00:00
|
|
|
|
|
|
|
find_package(Zug)
|
|
|
|
if(NOT Zug_FOUND)
|
|
|
|
message(STATUS "Using zug from FetchContent")
|
|
|
|
set(zug_BUILD_TESTS OFF)
|
|
|
|
set(zug_BUILD_EXAMPLES OFF)
|
|
|
|
set(zug_BUILD_DOCS OFF)
|
|
|
|
FetchContent_Declare(zug
|
|
|
|
GIT_REPOSITORY https://github.com/arximboldi/zug
|
|
|
|
GIT_TAG 266cc7fcc01f546c4fd0dabf3a26c71ddc7f3e7d)
|
|
|
|
FetchContent_MakeAvailable(zug)
|
|
|
|
endif()
|
|
|
|
|
2021-03-20 15:29:31 +00:00
|
|
|
find_package(Immer)
|
|
|
|
if(NOT Immer_FOUND)
|
2021-03-23 01:13:56 +00:00
|
|
|
message(STATUS "Immer not installed; Retrieving Immer with FetchContent")
|
2021-03-20 15:29:31 +00:00
|
|
|
set(immer_BUILD_TESTS OFF)
|
|
|
|
set(immer_BUILD_EXAMPLES OFF)
|
|
|
|
set(immer_BUILD_DOCS OFF)
|
|
|
|
set(immer_BUILD_EXTRAS OFF)
|
2021-03-23 01:13:56 +00:00
|
|
|
FetchContent_Declare(immer
|
|
|
|
GIT_REPOSITORY https://github.com/arximboldi/immer
|
|
|
|
GIT_TAG 800ddb04e528a3e83e69e8021d7e872e7c34cbcd)
|
2021-03-20 15:29:31 +00:00
|
|
|
FetchContent_MakeAvailable(immer)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(Lager)
|
|
|
|
if(NOT Lager_FOUND)
|
2021-03-23 01:13:56 +00:00
|
|
|
message(STATUS "Lager not installed; Retrieving lager with FetchContent")
|
2021-03-20 15:29:31 +00:00
|
|
|
set(lager_BUILD_TESTS OFF)
|
|
|
|
set(lager_BUILD_EXAMPLES OFF)
|
|
|
|
set(lager_BUILD_DOCS OFF)
|
|
|
|
set(lager_EMBED_RESOURCES_PATH OFF)
|
2021-03-23 01:13:56 +00:00
|
|
|
FetchContent_Declare(lager
|
|
|
|
GIT_REPOSITORY https://github.com/arximboldi/lager
|
|
|
|
GIT_TAG 71eca6b0ebbccf3e0e54324b6967f047e49ba92d)
|
2021-03-20 15:29:31 +00:00
|
|
|
FetchContent_MakeAvailable(lager)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(cereal)
|
|
|
|
if(NOT cereal_FOUND)
|
|
|
|
set(JUST_INSTALL_CEREAL ON)
|
2021-03-23 01:13:56 +00:00
|
|
|
FetchContent_Declare(cereal
|
|
|
|
GIT_REPOSITORY https://github.com/USCiLab/cereal
|
|
|
|
GIT_TAG v1.3.0)
|
2021-03-20 15:29:31 +00:00
|
|
|
FetchContent_MakeAvailable(cereal)
|
|
|
|
endif()
|
|
|
|
|
2021-03-23 01:13:56 +00:00
|
|
|
################################################################################
|
|
|
|
# TARGETS #
|
|
|
|
################################################################################
|
2020-10-25 18:58:02 +00:00
|
|
|
|
2021-03-23 01:13:56 +00:00
|
|
|
# Includes the automatically generated files.
|
2021-02-20 23:26:18 +00:00
|
|
|
include(GeneratedSources.cmake)
|
|
|
|
|
2020-10-25 18:58:02 +00:00
|
|
|
set(jellyfin-qt_SOURCES
|
2021-02-21 04:02:05 +00:00
|
|
|
# src/DTO/dto.cpp
|
2021-03-23 01:13:56 +00:00
|
|
|
src/library/reducer.cpp
|
2021-03-20 15:29:31 +00:00
|
|
|
src/model/item.cpp
|
|
|
|
src/support/jsonconv.cpp
|
2021-03-05 14:34:10 +00:00
|
|
|
src/support/loader.cpp
|
2021-02-17 18:42:10 +00:00
|
|
|
src/apiclient.cpp
|
|
|
|
src/apimodel.cpp
|
|
|
|
src/credentialmanager.cpp
|
|
|
|
src/deviceprofile.cpp
|
|
|
|
src/jellyfin.cpp
|
|
|
|
src/jsonhelper.cpp
|
|
|
|
src/playbackmanager.cpp
|
2021-02-21 04:02:05 +00:00
|
|
|
src/remotedata.cpp
|
2021-02-17 18:42:10 +00:00
|
|
|
src/serverdiscoverymodel.cpp
|
|
|
|
src/websocket.cpp)
|
2020-10-25 18:58:02 +00:00
|
|
|
|
2021-02-21 04:02:05 +00:00
|
|
|
list(APPEND jellyfin-qt_SOURCES ${openapi_SOURCES})
|
2021-02-20 23:26:18 +00:00
|
|
|
|
2020-10-25 18:58:02 +00:00
|
|
|
set(jellyfin-qt_HEADERS
|
2021-02-21 04:02:05 +00:00
|
|
|
# include/JellyfinQt/DTO/dto.h
|
2021-03-23 01:13:56 +00:00
|
|
|
include/JellyfinQt/network/actions.h
|
|
|
|
include/JellyfinQt/network/networkrequest.h
|
|
|
|
include/JellyfinQt/network/reducer.h
|
|
|
|
include/JellyfinQt/network/store.h
|
|
|
|
include/JellyfinQt/library/actions.h
|
|
|
|
include/JellyfinQt/library/reducer.h
|
|
|
|
include/JellyfinQt/library/store.h
|
2021-03-20 15:29:31 +00:00
|
|
|
include/JellyfinQt/model/item.h
|
|
|
|
include/JellyfinQt/support/jsonconv.h
|
2021-03-05 14:34:10 +00:00
|
|
|
include/JellyfinQt/support/loader.h
|
2021-02-17 18:42:10 +00:00
|
|
|
include/JellyfinQt/apiclient.h
|
|
|
|
include/JellyfinQt/apimodel.h
|
|
|
|
include/JellyfinQt/credentialmanager.h
|
|
|
|
include/JellyfinQt/deviceprofile.h
|
|
|
|
include/JellyfinQt/jellyfin.h
|
|
|
|
include/JellyfinQt/jsonhelper.h
|
|
|
|
include/JellyfinQt/playbackmanager.h
|
2021-02-21 04:02:05 +00:00
|
|
|
include/JellyfinQt/remotedata.h
|
2021-02-17 18:42:10 +00:00
|
|
|
include/JellyfinQt/serverdiscoverymodel.h
|
|
|
|
include/JellyfinQt/websocket.h)
|
2021-02-20 23:26:18 +00:00
|
|
|
|
2021-03-23 01:13:56 +00:00
|
|
|
list(APPEND jellyfin-qt_HEADERS ${openapi_HEADERS})
|
2020-10-25 18:58:02 +00:00
|
|
|
|
|
|
|
add_definitions(-DSAILFIN_VERSION=\"${SAILFIN_VERSION}\")
|
2021-02-17 01:28:37 +00:00
|
|
|
if (PLATFORM_SAILFISHOS)
|
|
|
|
add_definitions(-DPLATFORM_SAILFISHOS=1)
|
|
|
|
endif()
|
2021-03-23 01:13:56 +00:00
|
|
|
|
|
|
|
add_library(JellyfinQt ${jellyfin-qt_SOURCES} ${jellyfin-qt_HEADERS})
|
|
|
|
|
2021-02-21 04:02:05 +00:00
|
|
|
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
|
2021-03-23 01:13:56 +00:00
|
|
|
target_precompile_headers(JellyfinQt PRIVATE ${jellyfin-qt_HEADERS})
|
2021-02-21 04:02:05 +00:00
|
|
|
endif()
|
2021-03-23 01:13:56 +00:00
|
|
|
|
|
|
|
target_include_directories(JellyfinQt
|
2021-02-21 04:02:05 +00:00
|
|
|
PUBLIC "include" "generated/include"
|
2020-10-25 18:58:02 +00:00
|
|
|
)
|
2021-03-23 01:13:56 +00:00
|
|
|
target_link_libraries(JellyfinQt
|
|
|
|
PUBLIC Qt5::Core Qt5::Multimedia Qt5::Network Qt5::Qml Qt5::WebSockets)
|
|
|
|
|
|
|
|
target_link_libraries_system(JellyfinQt
|
|
|
|
PUBLIC
|
|
|
|
cereal
|
|
|
|
zug
|
|
|
|
immer
|
|
|
|
lager)
|
|
|
|
|
|
|
|
set_target_properties(JellyfinQt PROPERTIES CXX_VISIBILITY_PRESET default)
|
|
|
|
install(TARGETS JellyfinQt
|
2020-10-25 18:58:02 +00:00
|
|
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
|
|
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
|
|
|
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
|
|
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
|
|
|
2021-03-23 01:13:56 +00:00
|
|
|
install(TARGETS JellyfinQt EXPORT JellyfinQtTargets)
|
|
|
|
# export(TARGETS jellyfin-qt lager immer cereal FILE JellyfinQtConfig.cmake)
|