This repository has been archived by the owner on Dec 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
98 lines (80 loc) · 3.1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
project(gallery-app)
cmake_minimum_required(VERSION 2.8.9)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
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(Qt5Core)
find_package(Qt5Gui)
find_package(Qt5Qml)
find_package(Qt5Quick)
find_package(Qt5Sql)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
find_package(GLESv2)
else()
find_package(OpenGL)
endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(EXIV2 REQUIRED exiv2)
pkg_check_modules(MEDIAINFO REQUIRED libmediainfo)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")
set(CMAKE_EXE_LINKER_FLAGS "-s")
# Activate C++11 on Cmake >= 3.1
if (CMAKE_VERSION VERSION_GREATER "3.1")
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
endif ()
find_program(INTLTOOL_MERGE intltool-merge)
find_program(INTLTOOL_EXTRACT intltool-extract)
# Standard install paths
include(GNUInstallDirs)
option(INSTALL_TESTS "Install the tests on make install" off)
option(CLICK_MODE "Installs to a contained location" on)
set(GALLERY gallery-app)
set(DESKTOP_FILE ${GALLERY}.desktop)
set(AUTOPILOT_DIR gallery_app)
set(UBUNTU_MANIFEST_PATH "click/manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
# make non compiled files visible in qtcreator
file(GLOB_RECURSE NON_COMPILED_FILES *.qml *.js *.py *.svg *.png *.in *.json *.desktop *.pot *.apparmor qmldir)
add_custom_target(NON_COMPILED_TARGET ALL SOURCES ${NON_COMPILED_FILES})
if(CLICK_MODE)
if(NOT DEFINED BZR_SOURCE)
set(BZR_SOURCE "lp:gallery-app")
endif(NOT DEFINED BZR_SOURCE)
set(APP_PACKAGE_NAME "com.ubuntu.gallery")
set(CMAKE_INSTALL_PREFIX /)
set(CMAKE_INSTALL_BINDIR /)
set(GALLERY_DIR "")
add_definitions("-DCLICK_MODE=1")
else(CLICK_MODE)
set(GALLERY_DIR ${CMAKE_INSTALL_DATADIR}/${GALLERY})
endif(CLICK_MODE)
# for dh_translations to extract the domain
# (regarding syntax consistency, see http://pad.lv/1181187)
set (GETTEXT_PACKAGE "${GALLERY}")
# Tests
enable_testing()
add_subdirectory(click)
add_subdirectory(desktop)
add_subdirectory(po)
add_subdirectory(rc)
add_subdirectory(src)
add_subdirectory(tests)