X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=CMakeLists.txt;h=413c46d00d954ebb9e1ed44b3af6487603e026aa;hp=8af98b10977a7fa8f33e695a2d606af944da4eb3;hb=8f2ee00f4edef1693628d3af0bdee84d725eb754;hpb=8111304ae2fa60ac1d20520cfdd3e5b4930bce8b diff --git a/CMakeLists.txt b/CMakeLists.txt index 8af98b10..413c46d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -338,7 +338,30 @@ if (NOT WIN32) ) endif() +# Setup unit testing +##################################################################### + +option(BUILD_TESTING "Enable unit tests" OFF) +add_feature_info(BUILD_TESTING BUILD_TESTING "Build unit tests") + +if (BUILD_TESTING) + find_package(GTest QUIET) + set_package_properties(GTest PROPERTIES TYPE REQUIRED + DESCRIPTION "Google's unit testing framework" + PURPOSE "Required for building unit tests" + ) + + find_package(Qt5Test QUIET) + set_package_properties(Qt5Test PROPERTIES TYPE REQUIRED + DESCRIPTION "unit testing library for the Qt5 framework" + PURPOSE "Required for building unit tests" + ) + enable_testing() +endif() + # Check for SSL support in Qt +##################################################################### + cmake_push_check_state(RESET) set(CMAKE_REQUIRED_LIBRARIES Qt5::Core) check_cxx_source_compiles("