aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-09-11 17:57:08 -0300
committerRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-09-11 17:57:08 -0300
commit6bacc0d5db885a72202cb7f80e505642a36052d4 (patch)
tree608aa95f959b9e362d7813476e59d37c6c07ddf6 /CMakeLists.txt
parent31f8103187d2e27b1bb76eaed10dc9c9be226c90 (diff)
downloadqmenumodel-6bacc0d5db885a72202cb7f80e505642a36052d4.tar.gz
qmenumodel-6bacc0d5db885a72202cb7f80e505642a36052d4.tar.bz2
qmenumodel-6bacc0d5db885a72202cb7f80e505642a36052d4.zip
Splitted qmenumodel plugin in two libraries to make it testable.
Create unit test for qmenumodel library.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8dad33..65e6fa8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,7 @@ find_package(Qt4 REQUIRED)
include(FindPkgConfig)
pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
+pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
add_definitions(-DQT_NO_KEYWORDS)
find_program(DBUS_RUNNER dbus-test-runner)
@@ -14,7 +15,10 @@ find_program(DBUS_RUNNER dbus-test-runner)
OPTION(BUILD_WITH_COVERAGE "Build with coverage analysis support" OFF)
if(BUILD_WITH_COVERAGE)
message(STATUS "Using coverage flags")
- SET(COVERAGE_COMMAND "/usr/bin/gcov")
+ find_program(COVERAGE_COMMAND gcov)
+ if(NOT COVERAGE_COMMAND)
+ message(FATAL_ERROR "gcov command not found")
+ endif()
SET(CMAKE_C_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage")
SET(CMAKE_CXX_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -lgcov")
@@ -24,6 +28,14 @@ endif()
add_subdirectory(src)
add_subdirectory(examples)
+# Tests Tools
+if(NOT DBUS_RUNNER)
+ message(STATUS "dbus-test-runner not found tests disabled.")
+else()
+ enable_testing()
+ add_subdirectory(tests)
+endif()
+
# Tests Tools
#if(NOT DBUS_RUNNER)