~timo-jyrinki/qmenumodel/rebuild_against_qt521

1 by Renato Araujo Oliveira Filho
Initial import.
1
project(qmenumodel)
2
14.1.29 by Olivier Tilloy
Port to Qt5.
3
cmake_minimum_required(VERSION 2.8.9)
1 by Renato Araujo Oliveira Filho
Initial import.
4
17.3.3 by Olivier Tilloy
Add a pkgconfig file for developers.
5
# Standard install paths
6
include(GNUInstallDirs)
7
14.1.31 by Olivier Tilloy
Use the automoc feature to simplify a lot the build system.
8
find_package(Qt5Core REQUIRED)
67.2.7 by Lars Uebernickel
Link against the qml module
9
find_package(Qt5Qml REQUIRED)
10
find_package(Qt5Gui REQUIRED)
1 by Renato Araujo Oliveira Filho
Initial import.
11
include(FindPkgConfig)
12
pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
3 by Renato Araujo Oliveira Filho
Splitted qmenumodel plugin in two libraries to make it testable.
13
pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
14.1.31 by Olivier Tilloy
Use the automoc feature to simplify a lot the build system.
14
set(CMAKE_AUTOMOC ON)
15
set(CMAKE_INCLUDE_CURRENT_DIR ON)
1 by Renato Araujo Oliveira Filho
Initial import.
16
add_definitions(-DQT_NO_KEYWORDS)
17
18
find_program(DBUS_RUNNER dbus-test-runner)
19
20
# Cooverage tools
31.2.1 by Renato Araujo Oliveira Filho
Rename coverage option name.
21
OPTION(ENABLE_COVERAGE "Build with coverage analysis support" OFF)
22
if(ENABLE_COVERAGE)
1 by Renato Araujo Oliveira Filho
Initial import.
23
    message(STATUS "Using coverage flags")
3 by Renato Araujo Oliveira Filho
Splitted qmenumodel plugin in two libraries to make it testable.
24
    find_program(COVERAGE_COMMAND gcov)
25
    if(NOT COVERAGE_COMMAND)
26
        message(FATAL_ERROR "gcov command not found")
27
    endif()
31.2.1 by Renato Araujo Oliveira Filho
Rename coverage option name.
28
    SET(CMAKE_C_FLAGS "-g -O0 -Wall --coverage")
29
    SET(CMAKE_CXX_FLAGS "-g -O0 -Wall --coverage")
30
    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
1 by Renato Araujo Oliveira Filho
Initial import.
31
    include(${CMAKE_SOURCE_DIR}/cmake/lcov.cmake)
32
endif()
33
14.1.19 by Olivier Tilloy
Rename the source directories.
34
add_subdirectory(libqmenumodel)
1 by Renato Araujo Oliveira Filho
Initial import.
35
3 by Renato Araujo Oliveira Filho
Splitted qmenumodel plugin in two libraries to make it testable.
36
# Tests Tools
38.2.1 by Renato Araujo Oliveira Filho
Added 'TEST_XML_OUTPUT' option on cmake to enable/disalbe test output in xml.
37
OPTION(TEST_XML_OUTPUT "Print test results on xml files" ON)
3 by Renato Araujo Oliveira Filho
Splitted qmenumodel plugin in two libraries to make it testable.
38
if(NOT DBUS_RUNNER)
39
    message(STATUS "dbus-test-runner not found tests disabled.")
40
else()
28.2.20 by Renato Araujo Oliveira Filho
Make the rule 'make check' always enabled.
41
    # We need to enable test to create the 'make check' target mandatory on jenkins
42
    enable_testing()
28.2.19 by Renato Araujo Oliveira Filho
Fixed string comparation on cmake files.
43
    if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
28.2.18 by Renato Araujo Oliveira Filho
Skip tests on qemu to avoid crashes.
44
        message(STATUS "Current version of qemu crashes during the tests. We will skip it for now.")
45
    else()
28.2.20 by Renato Araujo Oliveira Filho
Make the rule 'make check' always enabled.
46
        message(STATUS "Tests enabled for arch: ${CMAKE_SYSTEM_PROCESSOR}")
28.2.18 by Renato Araujo Oliveira Filho
Skip tests on qemu to avoid crashes.
47
        add_subdirectory(tests)
48
    endif()
3 by Renato Araujo Oliveira Filho
Splitted qmenumodel plugin in two libraries to make it testable.
49
endif()
50
5 by Renato Araujo Oliveira Filho
Added QML documentation.
51
# Doc
52
OPTION(GENERATE_DOC "Enable qdoc generation" OFF)
53
if(GENERATE_DOC)
54
    message(STATUS "QDoc enabled.")
14.1.29 by Olivier Tilloy
Port to Qt5.
55
    find_program(QDOC_BIN qdoc)
5 by Renato Araujo Oliveira Filho
Added QML documentation.
56
    if(NOT QDOC_BIN)
57
        message(FATAL_ERROR "qdoc command not found")
58
    else()
59
        add_subdirectory(doc)
60
    endif()
61
endif()
1 by Renato Araujo Oliveira Filho
Initial import.
62