summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-02-07 11:54:39 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-02-07 11:55:12 (GMT)
commit982e6e777556de8db44b16b144ab62f4b7172319 (patch)
tree73c1c4137cdc714fa383b47fe8bff77bf5f1f763 /Modules
parent450a1904d5c7611806b8da55f2df72bcc0ddcacb (diff)
parentdd45f23b0142fb92de17458dd69b2b6f967f94bd (diff)
downloadCMake-982e6e777556de8db44b16b144ab62f4b7172319.zip
CMake-982e6e777556de8db44b16b144ab62f4b7172319.tar.gz
CMake-982e6e777556de8db44b16b144ab62f4b7172319.tar.bz2
Merge topic 'findcups'
dd45f23b01 FindCups: add imported target Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2917
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindCups.cmake48
1 files changed, 39 insertions, 9 deletions
diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake
index 10ce229..27105b9 100644
--- a/Modules/FindCups.cmake
+++ b/Modules/FindCups.cmake
@@ -5,18 +5,38 @@
FindCups
--------
-Try to find the Cups printing system
+Find the CUPS printing system.
-Once done this will define
+Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
+features this function (i.e. at least 1.1.19)
-::
+Imported targets
+^^^^^^^^^^^^^^^^
- CUPS_FOUND - system has Cups
- CUPS_INCLUDE_DIR - the Cups include directory
- CUPS_LIBRARIES - Libraries needed to use Cups
- CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8)
- Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
- features this function (i.e. at least 1.1.19)
+This module defines :prop_tgt:`IMPORTED` target ``Cups::Cups``, if Cups has
+been found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``CUPS_FOUND``
+ true if CUPS headers and libraries were found
+``CUPS_INCLUDE_DIRS``
+ the directory containing the Cups headers
+``CUPS_LIBRARIES``
+ the libraries to link against to use CUPS.
+``CUPS_VERSION_STRING``
+ the version of CUPS found (since CMake 2.8.8)
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``CUPS_INCLUDE_DIR``
+ the directory containing the Cups headers
#]=======================================================================]
find_path(CUPS_INCLUDE_DIR cups/cups.h )
@@ -66,3 +86,13 @@ else ()
endif ()
mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES)
+
+if (CUPS_FOUND)
+ set(CUPS_INCLUDE_DIRS "${CUPS_INCLUDE_DIR}")
+ if (NOT TARGET Cups::Cups)
+ add_library(Cups::Cups INTERFACE IMPORTED)
+ set_target_properties(Cups::Cups PROPERTIES
+ INTERFACE_LINK_LIBRARIES "${CUPS_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${CUPS_INCLUDE_DIR}")
+ endif ()
+endif ()