Update graphics/xpdf4 to version 4.02_2
[dports.git] / graphics / xpdf4 / files / patch-cmake-config.txt
1 --- cmake-config.txt.orig       2017-08-08 16:22:50.000000000 -0700
2 +++ cmake-config.txt    2017-09-17 21:03:21.838497000 -0700
3 @@ -79,6 +79,7 @@
4  option(USE_FIXEDPOINT "use fixed point (instead of floating point) arithmetic" OFF)
5  option(SPLASH_CMYK "include support for CMYK rasterization" OFF)
6  option(SPLASH_DEVICEN "include support for DeviceN rasterization" OFF)
7 +option(USE_LIBPAPER "use libpaper" OFF)
8  if (SPLASH_DEVICEN)
9    set(SPLASH_CMYK ON)
10  endif ()
11 @@ -235,9 +236,7 @@
12    if (XPDFWIDGET_PRINTING)
13      set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS}")
14      set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5PrintSupport_DEFINITIONS}")
15 -    if (APPLE)
16 -      set(QT_LIBRARIES Qt5::Widgets Qt5::PrintSupport "-framework ApplicationServices")
17 -    elseif (UNIX)
18 +    if (CUPS)
19        set(QT_LIBRARIES Qt5::Widgets Qt5::PrintSupport cups)
20      else ()
21        set(QT_LIBRARIES Qt5::Widgets Qt5::PrintSupport)
22 @@ -248,9 +247,7 @@
23      set(QT_LIBRARIES Qt5::Widgets)
24    endif ()
25    if (XPDFWIDGET_PRINTING)
26 -    if (APPLE)
27 -      set(EXTRA_QT_LIBRARIES "-framework ApplicationServices")
28 -    elseif (UNIX)
29 +    if (CUPS)
30        set(EXTRA_QT_LIBRARIES cups)
31      else ()
32        set(EXTRA_QT_LIBRARIES "")
33 @@ -278,10 +275,34 @@
34  endif()
35  
36  #--- look for libpaper
37 -find_library(HAVE_PAPER_H
38 -             NAMES paper libpaper
39 -             PATH_SUFFIXES lib64 lib
40 -)
41 +if(USE_LIBPAPER)
42 +  find_library(PAPER_LIBRARY
43 +    NAMES paper libpaper
44 +    HINTS
45 +    ${PAPER_DIR}
46 +    PATHS
47 +    /usr/local
48 +    /usr/freeware
49 +  )
50 +  find_path(PAPER_INCLUDE_DIR .h
51 +    HINTS
52 +    ${PAPER_DIR}
53 +    PATHS
54 +    /usr/local/include
55 +    /usr/freeware/include
56 +    PATH_SUFFIXES include
57 +  )
58 +endif()
59 +
60 +if (USE_LIBPAPER)
61 + if (PAPER_INCLUDE_DIR AND PAPER_LIBRARY)
62 +   set(HAVE_PAPER_H TRUE)
63 +   message(STATUS "Found libpaper: ${PAPER_LIBRARY}")
64 + else ()
65 +  set(HAVE_PAPER_H FALSE)
66 +  message(STATUS "libpaper not found")
67 + endif ()
68 +endif ()
69  
70  #--- look for pthreads
71  find_package(Threads)