X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=CMakeLists.txt;h=b5164ca78455ca415ac2738ca8dd7cff92fb8dad;hp=8af98b10977a7fa8f33e695a2d606af944da4eb3;hb=12a6abcfe51ac66e8763b3caadaedcb47c2723f1;hpb=1e37a9de70d5ff524fe9d01e715f6dbcdfa9ba06 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8af98b10..b5164ca7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,6 +321,13 @@ if (BUILD_CORE) endif() # Non-Qt-based packages +##################################################################### + +find_package(Boost 1.56 REQUIRED) +set_package_properties(Boost PROPERTIES TYPE REQUIRED + URL "https://www.boost.org/" + DESCRIPTION "Boost libraries for C++" +) find_package(ZLIB REQUIRED) set_package_properties(ZLIB PROPERTIES TYPE REQUIRED @@ -338,7 +345,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(" @@ -507,3 +537,8 @@ feature_summary(WHAT ALL ##################################################################### add_subdirectory(src) + +# Build tests if so desired +if (BUILD_TESTING) + add_subdirectory(tests) +endif()