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)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -fstrict-aliasing -Wno-deprecated-declarations -Wno-unused-variable")
|
|
|
|
|
|
|
|
option(DEVELOP "Enable runtime QML reloading for developing." OFF)
|
|
|
|
|
|
|
|
|
|
|
|
find_package(Qt5Core REQUIRED)
|
|
|
|
find_package(Qt5 REQUIRED Qml Quick Gui Widgets Core)
|
|
|
|
|
|
|
|
find_package(Qt5QuickCompiler)
|
|
|
|
qtquick_compiler_add_resources(qml_QRC src/qml/qml.qrc)
|
|
|
|
|
2018-10-28 13:59:29 +00:00
|
|
|
find_package(PkgConfig)
|
|
|
|
pkg_check_modules(MPV REQUIRED mpv)
|
|
|
|
|
2018-10-27 16:11:29 +01:00
|
|
|
set(SOURCES
|
|
|
|
src/main.cpp
|
|
|
|
src/mpvobject.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
if(DEVELOP)
|
|
|
|
set(SOURCES ${SOURCES} runtimeqml/runtimeqml.cpp)
|
|
|
|
add_definitions(-DQRC_SOURCE_PATH="${PROJECT_SOURCE_DIR}/src/qml")
|
|
|
|
endif(DEVELOP)
|
|
|
|
|
|
|
|
add_executable(KittehPlayer ${SOURCES} ${qml_QRC})
|
|
|
|
|
|
|
|
# Use the Qml/Quick modules from Qt 5.
|
2018-10-28 13:59:29 +00:00
|
|
|
target_link_libraries(KittehPlayer ${MPV_LIBRARIES})
|
2018-10-27 16:11:29 +01:00
|
|
|
|
|
|
|
qt5_use_modules(KittehPlayer Qml Quick Core Gui Widgets)
|
|
|
|
|
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)
|
2018-10-27 16:11:29 +01:00
|
|
|
|
|
|
|
|