summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-08-25 21:30:08 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-08-27 08:52:19 +0300
commit8f992bb6ff8a1995ed757edf39578c986ef700fc (patch)
treea45ce632366fb8daefcb8847d16d762e1219550b /CMakeLists.txt
parentAdd scripts/check_license.py (diff)
downloadrekonq-8f992bb6ff8a1995ed757edf39578c986ef700fc.tar.xz
Add CMakePresets.json
- add clang-tidy to debug configuration - add valgrind target: test_memcheck - add coverage target: test_coverage - bitbucket pipelines: store test results in junit format for test reporting
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt42
1 files changed, 30 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e8a9f66..1e582d88 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,20 +2,16 @@
# Andrea Diamantini - adjam7 at gmail dot com
# ==================================================================================
-cmake_minimum_required(VERSION 3.23)
-project(rekonq
+# Information to update before release
+cmake_minimum_required(VERSION 3.21)
+project(rekonq LANGUAGES CXX
VERSION 3.0.0
- HOMEPAGE_URL https://bitbucket.org/celestriad/rekonq
- LANGUAGES CXX)
-set(CMAKE_CXX_STANDARD 20)
+ HOMEPAGE_URL https://bitbucket.org/celestriad/rekonq)
# ==================================================================================
-# Information to update before to release this package.
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-version.h.cmake config-version.h)
+# dependencies
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
-# ==================================================================================
include(FeatureSummary)
include(GNUInstallDirs)
@@ -28,16 +24,28 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
#ADD_DEFINITIONS(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
-option(TESTING "Enable tests" OFF)
-if(TESTING)
+if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
include(CTest)
enable_testing()
+ add_custom_target(test_memcheck COMMAND ${CMAKE_CTEST_COMMAND} -T memcheck
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+
find_package(GTest REQUIRED)
add_definitions(-DREKONQ_TEST_EXPORT)
endif()
+option(BUILD_COVERAGE "Enable coverage" OFF)
+if(${BUILD_COVERAGE})
+ include(CodeCoverage)
+ append_coverage_compiler_flags()
+ set(COVERAGE_EXCLUDES ${CMAKE_BINARY_DIR}/* /usr/include/*)
+ message(STATUS "coverage excludes: ${COVERAGE_EXCLUDES}")
+ # create coverage target, using ctest to run all tests
+ setup_target_for_coverage_lcov(NAME test_coverage EXECUTABLE ${CMAKE_CTEST_COMMAND})
+endif()
+
# ==================================================================================
-# third-party requirements
+# third-party dependencies
set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
add_subdirectory(third-party/SingleApplication)
@@ -78,10 +86,20 @@ ENDIF(SOPRANO_FOUND AND NepomukCore_FOUND)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-kactivities.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config-kactivities.h )
# ==================================================================================
+# configure files
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-version.h.cmake config-version.h)
+
+# ==================================================================================
+# includes for all targets
+include_directories(include)
+
+# ==================================================================================
# Log messages
MESSAGE(STATUS "-----------------------------------------------------------------------")
MESSAGE(STATUS " rekonq ${CMAKE_PROJECT_VERSION} <${CMAKE_PROJECT_HOMEPAGE_URL}>")
+message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
+message(STATUS " CXX flags: ${CMAKE_CXX_FLAGS}")
MESSAGE(STATUS "")
feature_summary(WHAT ALL)