2
by Andrea Cimitan
Initial CMakeLists.txt |
1 |
project(settings-components) |
30
by Andrea Cimitan
Some changes, renaming and new tests |
2 |
|
2
by Andrea Cimitan
Initial CMakeLists.txt |
3 |
cmake_minimum_required(VERSION 2.8.9) |
4 |
||
5 |
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) |
|
49.1.1
by Nick Dedekind
Moved SettingsComponents to Ubuntu/SettingsComponents. rerigged test framework. |
6 |
|
7 |
# Install paths
|
|
2
by Andrea Cimitan
Initial CMakeLists.txt |
8 |
include(GNUInstallDirs) |
9 |
||
10 |
include(FindPkgConfig) |
|
11 |
||
12 |
find_package(Qt5Quick REQUIRED) |
|
13 |
set(OUR_QT_QUICK_LIB ${Qt5Quick_LIBRARIES}) |
|
14 |
||
15 |
get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION) |
|
16 |
exec_program(${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_QML" OUTPUT_VARIABLE QT_IMPORTS_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
61.2.1
by Nick Dedekind
added menu plugin component |
17 |
file(TO_CMAKE_PATH "${QT_IMPORTS_DIR}" QT_IMPORTS_DIR) |
2
by Andrea Cimitan
Initial CMakeLists.txt |
18 |
|
19 |
set(OUR_QT_QUICK_INCLUDE ${Qt5Quick_INCLUDE_DIRS}) |
|
20 |
LIST(APPEND QT_PKGCONFIG_DEPENDENCIES "Qt5Quick") |
|
21 |
||
22 |
find_package(Qt5Core REQUIRED) |
|
23 |
find_package(Qt5Quick REQUIRED) |
|
24 |
find_package(Qt5Widgets REQUIRED) |
|
25 |
add_definitions(-DQT_NO_KEYWORDS) |
|
26 |
||
27 |
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
|
28 |
set(CMAKE_AUTOMOC ON) |
|
29 |
||
30 |
# enable QML debugging
|
|
50.2.2
by Nick Dedekind
Added runtest script. Fixed up coverage and qmltest targets. |
31 |
string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) # Build types should always be lowercase but sometimes they are not. |
32 |
if(cmake_build_type_lower MATCHES "debug") |
|
33 |
add_definitions(-DQT_QML_DEBUG) |
|
34 |
endif() |
|
35 |
||
36 |
include(EnableCoverageReport) |
|
37 |
#####################################################################
|
|
38 |
# Enable code coverage calculation with gcov/gcovr/lcov
|
|
39 |
# Usage:
|
|
40 |
# * Switch build type to coverage (use ccmake or cmake-gui)
|
|
41 |
# * Invoke make, make test, make coverage (or ninja if you use that backend)
|
|
42 |
# * Find html report in subdir coveragereport
|
|
43 |
# * Find xml report feasible for jenkins in coverage.xml
|
|
44 |
#####################################################################
|
|
45 |
if(cmake_build_type_lower MATCHES coverage) |
|
46 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" ) |
|
47 |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" ) |
|
48 |
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" ) |
|
49 |
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" ) |
|
50 |
ENABLE_COVERAGE_REPORT(TARGETS ${SHELL_APP} FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*) |
|
51 |
endif() |
|
2
by Andrea Cimitan
Initial CMakeLists.txt |
52 |
|
53 |
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" |
|
54 |
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
55 |
IMMEDIATE @ONLY) |
|
56 |
add_custom_target(uninstall "${CMAKE_COMMAND}" |
|
57 |
-P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") |
|
58 |
||
59 |
# Doc
|
|
60 |
OPTION(GENERATE_DOC "Enable qdoc generation" OFF) |
|
61 |
if(GENERATE_DOC) |
|
62 |
message(STATUS "QDoc enabled.") |
|
63 |
find_program(QDOC_BIN qdoc) |
|
64 |
if(NOT QDOC_BIN) |
|
65 |
message(FATAL_ERROR "qdoc command not found") |
|
66 |
else() |
|
67 |
add_subdirectory(doc) |
|
68 |
endif() |
|
69 |
endif() |
|
70 |
||
71 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") |
|
75.2.8
by Nick Dedekind
made tryTEST_TARGET work |
72 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra") |
73 |
||
74 |
if ("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "relwithdebinfo") |
|
75 |
option(Werror "Treat warnings as errors" ON) |
|
76 |
else() |
|
77 |
option(Werror "Treat warnings as errors" OFF) |
|
78 |
endif() |
|
79 |
||
80 |
if (Werror) |
|
81 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") |
|
82 |
endif() |
|
83 |
||
84 |
file(GLOB_RECURSE QML_EXTRA_FILES |
|
75.2.10
by Nick Dedekind
removed old artwork |
85 |
${CMAKE_SOURCE_DIR}/tests/*.qml |
86 |
${CMAKE_SOURCE_DIR}/tests/*.js |
|
87 |
${CMAKE_SOURCE_DIR}/tests/*.jpg |
|
88 |
${CMAKE_SOURCE_DIR}/tests/*.png |
|
89 |
${CMAKE_SOURCE_DIR}/tests/*.sci |
|
90 |
${CMAKE_SOURCE_DIR}/tests/*.svg |
|
91 |
)
|
|
92 |
add_custom_target(qml_fake_target SOURCES ${QML_EXTRA_FILES}) |
|
93 |
||
94 |
# Tests
|
|
3
by Andrea Cimitan
Add basic test for ButtonMenu |
95 |
enable_testing() |
96 |
||
97 |
add_subdirectory(plugins) |
|
79.3.18
by Nick Dedekind
Moved to plugins to plugins folder. |
98 |
add_subdirectory(examples) |
75.2.2
by Nick Dedekind
more visual tweaks |
99 |
add_subdirectory(tests) |
3
by Andrea Cimitan
Add basic test for ButtonMenu |
100 |
add_subdirectory(po) |
93.1.1
by Lukáš Tinkl
setup message extraction, load the catalog from the plugins |
101 |