Debian Codegraph @

CMakeLists.txt

raw ◀ ▶
1 Debian patch touch this file
1 cmake_minimum_required(VERSION 3.5)
2 project(lomiri-mediaplayer-app VERSION 1.1.1 LANGUAGES CXX)
3 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
4
•5 # Options
6 option (ADD_MPRIS "Enable the player's own MPRIS integration" OFF)
7
8 # Find includes in corresponding build directories
9 set(CMAKE_INCLUDE_CURRENT_DIR ON)
10 set(DESKTOP_FILE lomiri-mediaplayer-app.desktop)
11
12 # Instruct CMake to run moc automatically when needed.
13 set(CMAKE_AUTOMOC ON)
14
15 find_package(Gettext REQUIRED)
16
17 string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower)
18
19 include(EnableCoverageReport)
20 #####################################################################
21 # Enable code coverage calculation with gcov/gcovr/lcov
22 # Usage:
23 # * Switch build type to coverage (use ccmake or cmake-gui)
24 # * Invoke make, make test, make coverage (or ninja if you use that backend)
25 # * Find html report in subdir coveragereport
26 # * Find xml report feasible for jenkins in coverage.xml
27 #####################################################################
28 if(cmake_build_type_lower MATCHES coverage)
29 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
30 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" )
31 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" )
32 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" )
33 ENABLE_COVERAGE_REPORT(TARGETS ${SHELL_APP})
34 endif()
35 find_package(Qt5 COMPONENTS Gui Widgets Core Qml Quick Multimedia REQUIRED)
36
•37 if (ADD_MPRIS)
38 find_package (Qt5 COMPONENTS DBus REQUIRED)
39 endif ()
40
41 # Standard install paths
42 include(GNUInstallDirs)
43
44 set(MEDIAPLAYER_DIR ${CMAKE_INSTALL_FULL_DATADIR}/lomiri-mediaplayer-app)
45
46 # for dh_translations to extract the domain
47 # (regarding syntax consistency, see http://pad.lv/1181187)
48 set (GETTEXT_PACKAGE "lomiri-mediaplayer-app")
49
50 # Tests
51 option(USE_XVFB "Use XVFB to run qml tests" on)
52 option(ENABLE_AUTOPILOT "Build autopilot tests" off)
53
54 include(CTest)
55
56 add_subdirectory(data)
57 add_subdirectory(src)
58 if(BUILD_TESTING)
59 add_subdirectory(tests)
60 endif()
61 add_subdirectory(po)
62
63 configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
64