2018-10-28 13:59:29 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5.1)
|
2018-10-27 16:11:29 +01:00
|
|
|
|
|
|
|
project(KittehPlayer)
|
2018-10-28 13:59:29 +00:00
|
|
|
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
|
2018-10-27 16:11:29 +01:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
2018-12-09 02:35:08 +00:00
|
|
|
include(ExternalProject)
|
|
|
|
|
|
|
|
|
2018-10-27 16:11:29 +01:00
|
|
|
find_package(Qt5Core REQUIRED)
|
2018-10-29 14:19:12 +00:00
|
|
|
find_package(Qt5Gui REQUIRED)
|
2018-12-09 02:35:08 +00:00
|
|
|
find_package(Qt5Concurrent REQUIRED)
|
|
|
|
|
2018-11-07 07:42:47 +00:00
|
|
|
find_package(Qt5 CONFIG REQUIRED COMPONENTS Qml Quick Gui Widgets Core X11Extras)
|
2018-10-27 16:11:29 +01:00
|
|
|
|
|
|
|
find_package(Qt5QuickCompiler)
|
2020-04-11 14:07:32 +01:00
|
|
|
#if(Qt5QuickCompiler_FOUND)
|
|
|
|
#qtquick_compiler_add_resources(qml_QRC src/qml/qml.qrc)
|
|
|
|
#else()
|
2018-12-22 13:53:42 +00:00
|
|
|
qt5_add_resources(qml_QRC src/qml/qml.qrc)
|
2020-04-11 14:07:32 +01:00
|
|
|
#endif()
|
2018-10-27 16:11:29 +01:00
|
|
|
|
2018-10-28 13:59:29 +00:00
|
|
|
find_package(PkgConfig)
|
|
|
|
pkg_check_modules(MPV REQUIRED mpv)
|
2018-11-28 11:55:26 +00:00
|
|
|
pkg_check_modules(X11 x11)
|
|
|
|
pkg_check_modules(Xext xext)
|
|
|
|
|
2018-12-09 02:35:08 +00:00
|
|
|
|
|
|
|
execute_process(
|
|
|
|
COMMAND git clone --depth 1 https://github.com/gabime/spdlog.git
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
include_directories(${CMAKE_BINARY_DIR}/spdlog/include)
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-11-28 11:55:26 +00:00
|
|
|
if(X11_FOUND AND Xext_FOUND)
|
|
|
|
add_definitions(-DENABLE_X11)
|
|
|
|
endif(X11_FOUND AND Xext_FOUND)
|
|
|
|
|
2020-04-11 14:07:32 +01:00
|
|
|
link_directories(/usr/local/lib)
|
2020-04-11 15:45:10 +01:00
|
|
|
#src/Backends/DirectMPV/DirectMPVBackend.cpp
|
2020-04-11 14:07:32 +01:00
|
|
|
|
2018-10-27 16:11:29 +01:00
|
|
|
set(SOURCES
|
2018-11-06 11:25:32 +00:00
|
|
|
src/main.cpp
|
2018-11-07 11:10:38 +00:00
|
|
|
src/utils.cpp
|
2018-12-22 13:38:36 +00:00
|
|
|
src/enums.cpp
|
2018-12-08 22:21:12 +00:00
|
|
|
src/Process.cpp
|
|
|
|
src/ThumbnailCache.cpp
|
2018-12-09 02:35:08 +00:00
|
|
|
src/logger.cpp
|
2018-12-20 14:37:29 +00:00
|
|
|
src/qmldebugger.cpp
|
2020-04-17 12:32:23 +01:00
|
|
|
src/Backends/MPVCommon/MPVCommon.cpp
|
2020-04-16 18:19:46 +01:00
|
|
|
src/Backends/MPV/MPVBackend.cpp
|
|
|
|
src/Backends/MPVNoFBO/MPVNoFBOBackend.cpp
|
2018-10-27 16:11:29 +01:00
|
|
|
)
|
|
|
|
|
2018-12-06 08:13:14 +00:00
|
|
|
find_program(CCACHE_FOUND cache)
|
2018-11-06 11:25:32 +00:00
|
|
|
if(CCACHE_FOUND)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
|
|
|
endif(CCACHE_FOUND)
|
|
|
|
|
2020-04-11 14:07:32 +01:00
|
|
|
set(CMAKE_BUILD_TYPE DEBUG)
|
|
|
|
|
2020-04-20 13:14:09 +01:00
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} -ggdb -g3 -O3")
|
2018-11-06 11:25:32 +00:00
|
|
|
|
2018-12-06 08:13:14 +00:00
|
|
|
if(DEFINED ENV{TRAVIS})
|
2018-11-16 09:10:26 +00:00
|
|
|
execute_process(
|
|
|
|
COMMAND git rev-parse HEAD
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
find_package(Qt5Network REQUIRED)
|
|
|
|
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
|
2018-12-06 08:13:14 +00:00
|
|
|
endif(DEFINED ENV{TRAVIS})
|
2018-11-12 11:05:46 +00:00
|
|
|
|
2018-10-27 16:11:29 +01:00
|
|
|
add_executable(KittehPlayer ${SOURCES} ${qml_QRC})
|
|
|
|
|
|
|
|
# Use the Qml/Quick modules from Qt 5.
|
2018-11-12 12:30:35 +00:00
|
|
|
target_link_libraries(KittehPlayer ${MPV_LIBRARIES} ${X11_LIBRARIES} ${Xext_LIBRARIES} Qt5::X11Extras)
|
2018-12-09 02:35:08 +00:00
|
|
|
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS} ${Qt5Concurrent_INCLUDE_DIRS})
|
2018-11-07 07:42:47 +00:00
|
|
|
qt5_use_modules(KittehPlayer Qml Quick Core Gui Widgets X11Extras)
|
2018-10-27 16:11:29 +01:00
|
|
|
|
2018-10-28 13:59:29 +00:00
|
|
|
install (TARGETS ${PROJECT_NAME} DESTINATION bin)
|
|
|
|
install (FILES "${PROJECT_NAME}.desktop" DESTINATION share/applications)
|
|
|
|
install (FILES "${PROJECT_NAME}.png" DESTINATION share/icons/hicolor/256x256/apps)
|