cmake_minimum_required(VERSION 3.5) project(lomiri-mediaplayer-app VERSION 1.1.1 LANGUAGES CXX) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # Options option (ADD_MPRIS "Enable the player's own MPRIS integration" OFF) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) set(DESKTOP_FILE lomiri-mediaplayer-app.desktop) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) find_package(Gettext REQUIRED) string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) include(EnableCoverageReport) ##################################################################### # Enable code coverage calculation with gcov/gcovr/lcov # Usage: # * Switch build type to coverage (use ccmake or cmake-gui) # * Invoke make, make test, make coverage (or ninja if you use that backend) # * Find html report in subdir coveragereport # * Find xml report feasible for jenkins in coverage.xml ##################################################################### if(cmake_build_type_lower MATCHES coverage) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" ) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" ) set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" ) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" ) ENABLE_COVERAGE_REPORT(TARGETS ${SHELL_APP}) endif() find_package(Qt5 COMPONENTS Gui Widgets Core Qml Quick Multimedia REQUIRED) if (ADD_MPRIS) find_package (Qt5 COMPONENTS DBus REQUIRED) endif () # Standard install paths include(GNUInstallDirs) set(MEDIAPLAYER_DIR ${CMAKE_INSTALL_FULL_DATADIR}/lomiri-mediaplayer-app) # for dh_translations to extract the domain # (regarding syntax consistency, see http://pad.lv/1181187) set (GETTEXT_PACKAGE "lomiri-mediaplayer-app") # Tests option(USE_XVFB "Use XVFB to run qml tests" on) option(ENABLE_AUTOPILOT "Build autopilot tests" off) include(CTest) add_subdirectory(data) add_subdirectory(src) if(BUILD_TESTING) add_subdirectory(tests) endif() add_subdirectory(po) configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)