~alecu/unity-scope-click/separate-scopes-category

108.1.1 by Rodney Dawes
Run the tests for the new c++ version of the scope during build as well.
1
project(unity-scope-click)
116.1.4 by thomas-voss
Cleanup formatting of CMakeLists.txt
2
100.2.3 by Michael McCracken
Add initial C++ click scope code
3
cmake_minimum_required(VERSION 2.8.10)
4
116.1.4 by thomas-voss
Cleanup formatting of CMakeLists.txt
5
set(SCOPE_CLICK_VERSION_MAJOR 0)
6
set(SCOPE_CLICK_VERSION_MINOR 0)
7
set(SCOPE_CLICK_VERSION_PATCH 1)
8
108.1.1 by Rodney Dawes
Run the tests for the new c++ version of the scope during build as well.
9
# Some default CFLAGS
10
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -g -Wall -Wextra -Werror -fPIC")
11
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -g -Wextra -Wall -Werror -fPIC")
100.2.3 by Michael McCracken
Add initial C++ click scope code
12
237.1.1 by Allan LeSage
Add coverage tooling using CMake modules from http://code.cor-lab/projects/rsc.
13
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
14
100.2.3 by Michael McCracken
Add initial C++ click scope code
15
include(GNUInstallDirs)
116.1.1 by thomas-voss
First wave of refactoring to make the code base easier testable:
16
274.2.4 by Pawel Stolowski
Install two ini files.
17
set(STORE_LIB_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/unity-scopes/clickstore/)
18
set(STORE_DATA_DIR ${CMAKE_INSTALL_FULL_DATADIR}/unity/scopes/clickstore/)
19
set(APPS_LIB_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/unity-scopes/clickapps/)
20
set(APPS_DATA_DIR ${CMAKE_INSTALL_FULL_DATADIR}/unity/scopes/clickapps/)
100.2.3 by Michael McCracken
Add initial C++ click scope code
21
299.2.4 by Pawel Stolowski
Install gsettings schema.
22
include(UseGSettings)
321.2.1 by Rodney Dawes
Drop the include of FindPkgConfig in CMakeLists.txt.
23
find_package (PkgConfig REQUIRED)
100.3.3 by Michael McCracken
- Add detection of scopes api version to build correctly across breaking api changes in 0.1.8
24
292.1.1 by Pawel Stolowski
Updated for scopes api 0.5.0.
25
pkg_check_modules(UNITY_SCOPES REQUIRED libunity-scopes>=0.5.0 libunity-api>=0.1.3)
108.1.1 by Rodney Dawes
Run the tests for the new c++ version of the scope during build as well.
26
add_definitions(${UNITY_SCOPES_CFLAGS} ${UNITY_SCOPES_CFLAGS_OTHER})
100.3.3 by Michael McCracken
- Add detection of scopes api version to build correctly across breaking api changes in 0.1.8
27
100.2.3 by Michael McCracken
Add initial C++ click scope code
28
pkg_check_modules(UBUNTUONE REQUIRED ubuntuoneauth-2.0)
29
add_definitions(${UBUNTUONE_CFLAGS} ${UBUNTUONE_CFLAGS_OTHER})
30
229.1.4 by Alejandro J. Cura
Revert cmake change
31
pkg_check_modules(UBUNTU_DOWNLOAD_MANAGER_CLIENT REQUIRED ubuntu-download-manager-client)
32
pkg_check_modules(UBUNTU_DOWNLOAD_MANAGER_COMMON REQUIRED ubuntu-download-manager-common)
116.7.10 by Michael McCracken
Working towards building with packaged ubuntu-download-manager. Currently experiences linking errors, possibly UDm packaging bugs, but may mask other bugs here.
33
100.2.3 by Michael McCracken
Add initial C++ click scope code
34
SET (SCOPE_LIB_VERSION 0.2.0)
35
SET (SCOPE_LIB_SOVERSION 0)
36
SET (SCOPE_LIB_API_VERSION 2.0)
274.2.6 by Pawel Stolowski
cmake rules update.
37
SET (STORE_LIB_UNVERSIONED com.canonical.scopes.clickstore)
38
SET (SCOPE_LIB_NAME clickscope)
39
SET (STORE_LIB_NAME ${STORE_LIB_UNVERSIONED}-${SCOPE_LIB_API_VERSION})
274.2.14 by Pawel Stolowski
Renamed apps scope back to clickscope.
40
SET (APPS_LIB_UNVERSIONED scope)
274.2.6 by Pawel Stolowski
cmake rules update.
41
SET (APPS_LIB_NAME ${APPS_LIB_UNVERSIONED}-${SCOPE_LIB_API_VERSION})
100.2.3 by Michael McCracken
Add initial C++ click scope code
42
255.2.4 by Rodney Dawes
Move the Configuration and test to libclickscope.
43
# Build with system gmock and embedded gtest
44
set (GMOCK_INCLUDE_DIR "/usr/include/gmock/include" CACHE PATH "gmock source include directory")
45
set (GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory")
46
set (GTEST_INCLUDE_DIR "${GMOCK_SOURCE_DIR}/gtest/include" CACHE PATH "gtest source include directory")
47
48
add_subdirectory(${GMOCK_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock")
49
50
# Add our own subdirectories.
114.2.2 by Rodney Dawes
Move the autopilot tests to their own toplevel dir.
51
add_subdirectory(autopilot)
294.1.10 by Alejandro J. Cura
Use CMake to install and find the install-helper
52
add_subdirectory(bin)
251.1.1 by Rodney Dawes
Initial migration of some portions of the code to a library to support multiple scopes and stores.
53
add_subdirectory(libclickscope)
100.3.5 by Michael McCracken
remove unnecessary extra variable
54
add_subdirectory(scope)
100.2.3 by Michael McCracken
Add initial C++ click scope code
55
add_subdirectory(data)
198.2.1 by Rodney Dawes
Add build system support for translating the scope.
56
add_subdirectory(po)
310.3.1 by Pawel Stolowski
First cut at the departments init tool.
57
add_subdirectory(tools)
119.1.1 by Rodney Dawes
Don't run the integration tests during make test.
58
237.1.3 by Allan LeSage
Coverage tooling origin comment http->https per dobey req.
59
include(EnableCoverageReport) # Using gcov CMake modules from https://code.cor-lab.org/projects/rsc
237.1.1 by Allan LeSage
Add coverage tooling using CMake modules from http://code.cor-lab/projects/rsc.
60
#####################################################################
61
# Enable code coverage calculation with gcov/gcovr/lcov
62
# Usage:
63
#  * Switch build type to coverage (use ccmake or cmake-gui)
64
#  * Invoke make, make test, make coverage (or ninja if you use that backend)
65
#  * Find html report in subdir coveragereport
66
#  * Find xml report feasible for jenkins in coverage.xml
67
#####################################################################
68
string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower)
69
if(cmake_build_type_lower MATCHES coverage)
70
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
71
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" )
72
  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" )
73
  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" )
74
  ENABLE_COVERAGE_REPORT(TARGETS ${SCOPE_LIB_UNVERSIONED} FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*)
75
endif()
76
120.1.1 by Rodney Dawes
Revert some changes to use variables for target names again.
77
# Custom targets for the tests
78
add_custom_target (test
299.2.1 by Alejandro J. Cura
Initial branch
79
  DEPENDS test-click-scope test-apps-scope test-libclickscope
120.1.1 by Rodney Dawes
Revert some changes to use variables for target names again.
80
)
81
169.7.2 by Michael McCracken
Shorten name of target that runs the disabled google-test tests along with the regular tests, to reduce the amount of typing you need to do when you want to run the target.
82
add_custom_target (test-disabled
83
  DEPENDS test-click-scope-disabled
169.7.1 by Michael McCracken
add 'test-include-disabled target to run all Gtest tests including disabled ones
84
)
85
119.1.1 by Rodney Dawes
Don't run the integration tests during make test.
86
# Add a custom target for integration tests, as they should not be run
87
# during normal make test.
88
add_custom_target (test-integration
89
  DEPENDS test-integration-click-scope
90
)
120.1.1 by Rodney Dawes
Revert some changes to use variables for target names again.
91
255.1.1 by Rodney Dawes
Add rules for running the unit tests under valgrind.
92
# Add a custom target for running the tests under valgrind.
93
add_custom_target (test-valgrind
299.2.1 by Alejandro J. Cura
Initial branch
94
  DEPENDS test-click-scope-valgrind test-apps-scope-valgrind test-libclickscope-valgrind
255.1.1 by Rodney Dawes
Add rules for running the unit tests under valgrind.
95
)
96
97
# Add a custom target for running the tests under valgrind with the
98
# full leak checks enabled.
99
add_custom_target (test-leaks
299.2.1 by Alejandro J. Cura
Initial branch
100
  DEPENDS test-click-scope-leaks test-apps-scope-leaks test-libclickscope-leaks
255.1.1 by Rodney Dawes
Add rules for running the unit tests under valgrind.
101
)
102
120.1.1 by Rodney Dawes
Revert some changes to use variables for target names again.
103
# Also let "make check" and partners work.
104
add_custom_target (check
105
  DEPENDS test
106
)
107
108
add_custom_target (check-integration
109
  DEPENDS test-integration
110
)
255.1.1 by Rodney Dawes
Add rules for running the unit tests under valgrind.
111
112
add_custom_target (check-valgrind
113
  DEPENDS test-valgrind
114
)
115
116
add_custom_target (check-leaks
117
  DEPENDS test-leaks
268.1.1 by Pawel Stolowski
Changed scope id to com.canonical.scopes.click. Changed library name to scope.so.
118
)