diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,14 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED Config ConfigWidgets CoreAddons DBusAddons IconThemes I18n KCMUtils KIO Notifications Plasma WidgetsAddons WindowSystem) +find_package(CupsSmb) +set_package_properties(CupsSmb PROPERTIES + TYPE RUNTIME + DESCRIPTION "SMB backend for CUPS (aka smbspool)" + PURPOSE "Required for CUPS to be able to print to printers shared over SMB" + URL "https://samba.org" +) + add_definitions( -DQT_DISABLE_DEPRECATED_BEFORE=0x050900 -DQT_USE_FAST_OPERATOR_PLUS @@ -72,3 +80,5 @@ add_subdirectory(print-manager-kded) add_subdirectory(plasmoid) add_subdirectory(declarative-plugins) + +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/cmake/modules/FindCupsSmb.cmake b/cmake/modules/FindCupsSmb.cmake new file mode 100644 --- /dev/null +++ b/cmake/modules/FindCupsSmb.cmake @@ -0,0 +1,53 @@ +# FindCupsSmb +# ------------ +# +# Try to find smb backend for cups. This is generally installed as smbspool but +# needs symlinking into place for CUPS (by the distribution). +# +# This will define the following variables: +# +# ``CupsSmb_FOUND`` +# True if (the requested version of) Canberra is available +# ``CupsSmb_BACKEND`` +# Path of smb backend file + +#============================================================================= +# Copyright (c) 2019 Harald Sitter +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +find_file(CupsSmb_BACKEND smb + PATHS + /lib/cups/backend/ + /usr/lib/cups/backend/ +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CupsSmb + FOUND_VAR + CupsSmb_FOUND + REQUIRED_VARS + CupsSmb_BACKEND +)