test: Add a spy type that waits for one or more signals
[quassel.git] / CMakeLists.txt
index f6b7f65..b5164ca 100644 (file)
@@ -312,17 +312,22 @@ if (BUILD_CORE)
 
     if (WITH_LDAP)
         find_package(Ldap QUIET)
-        if (LDAP_FOUND)
-            message(STATUS "Enabling LDAP authentication support")
-        else()
-            message(STATUS "Disabling LDAP authentication support")
-        endif()
-    else()
-        message(STATUS "Not enabling LDAP authentication support")
+        set_package_properties(Ldap PROPERTIES TYPE OPTIONAL
+            URL "http://www.openldap.org/"
+            DESCRIPTION "LDAP (Lightweight Directory Access Protocol) libraries"
+            PURPOSE "Enables core user authentication via LDAP"
+        )
     endif()
 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
@@ -340,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("
@@ -390,6 +418,31 @@ endif()
 # This needs to come after setting up KDE integration, so we can use KDE-specific paths
 include(QuasselInstallDirs)
 
+# RPATH and output settings
+#####################################################################
+
+# Build artifacts in a well-known location; especially important for Windows DLLs
+# (which go into RUNTIME_OUTPUT_DIRECTORY and can thus be found by executables)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+
+# These RPATH settings allow for running directly from the build dir
+set(CMAKE_SKIP_BUILD_RPATH            FALSE)
+set(CMAKE_BUILD_WITH_INSTALL_RPATH    FALSE)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )
+
+# Set install RPATH only if libdir isn't a system directory
+if (IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
+    set(libdir "${CMAKE_INSTALL_LIBDIR}")
+else()
+    set(libdir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+endif()
+list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${libdir}" is_systemdir)
+if ("${is_systemdir}" STREQUAL "-1")
+   set(CMAKE_INSTALL_RPATH "${libdir}")
+endif()
+
 # Various config-dependent checks and settings
 #####################################################################
 
@@ -470,7 +523,6 @@ add_subdirectory(icons)
 add_subdirectory(pics)
 add_subdirectory(po)
 
-
 # Set up and display feature summary
 #####################################################################
 
@@ -485,3 +537,8 @@ feature_summary(WHAT ALL
 #####################################################################
 
 add_subdirectory(src)
+
+# Build tests if so desired
+if (BUILD_TESTING)
+    add_subdirectory(tests)
+endif()