Skip to content

Commit

Permalink
Initial revision of the print module.
Browse files Browse the repository at this point in the history
This is a new module. It requires CUPS to send the print job to the
printer queue. The module offers a way to add some margin, select
the paper size, the print queue. It also support a printer/paper ICC
profile.
  • Loading branch information
TurboGit committed Jan 28, 2015
1 parent 7f8fe97 commit 9e2ace5
Show file tree
Hide file tree
Showing 24 changed files with 2,948 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ option(USE_OPENJPEG "Enable JPEG 2000 support" ON)
option(USE_WEBP "Enable WebP export support" ON)
option(BUILD_CMSTEST "Build a test program to check your system's color management setup" ON)
option(USE_OPENEXR "Enable OpenEXR support" ON)
option(BUILD_PRINT "Build the print module" ON)
if(APPLE)
option(USE_MAC_INTEGRATION "Enable OS X integration" ON)
else(APPLE)
Expand Down Expand Up @@ -305,4 +306,3 @@ configure_file(

add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

21 changes: 21 additions & 0 deletions cmake/modules/FindCUPS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

FIND_PATH(CUPS_INCLUDE_DIR cups.h
PATHS /usr/include
/usr/local/include
HINTS ENV CUPS_INCLUDE_DIR
PATH_SUFFIXES cups
)

FIND_LIBRARY(CUPS_LIBRARY
NAMES ${CUPS_NAMES} cups libcups
PATHS /usr/lib /usr/local/lib
HINTS ENV CUPS_LIBDIR
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CUPS DEFAULT_MSG CUPS_LIBRARY CUPS_INCLUDE_DIR)

IF(CUPS_FOUND)
SET(CUPS_LIBRARIES ${CUPS_LIBRARY})
SET(CUPS_INCLUDE_DIRS ${CUPS_INCLUDE_DIR})
ENDIF(CUPS_FOUND)
1 change: 1 addition & 0 deletions doc/README
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ to build it, you need:

optionally, you might need for special features:

- libcups2 (for the print module)
- gphoto2 (for camera support, recommended)
- librsvg2 (for watermark plugin)
- flickcurl (for Flickr support)
Expand Down
24 changes: 24 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,30 @@ if(USE_LUA)
list(APPEND STATIC_LIBS lautoc_static)
endif(USE_LUA)

if(BUILD_PRINT)
find_package(CUPS)
if(CUPS_FOUND)
include_directories(SYSTEM ${CUPS_INCLUDE_DIRS})
add_definitions(${CUPS_DEFINITIONS})
FILE(GLOB SOURCE_FILES_PRINT
"common/cups_print.h"
"common/cups_print.c"
"common/printprof.c"
"libs/print_settings.c"
)
set(SOURCES ${SOURCES} ${SOURCE_FILES_PRINT})
add_library(cups_static STATIC IMPORTED)
list(APPEND LIBS ${CUPS_LIBRARIES})
add_definitions("-DHAVE_PRINT")
message(STATUS "Print mode: enabled")
else(CUPS_FOUND)
set(BUILD_PRINT OFF)
message(STATUS "Print mode: disabled, please install CUPS dev package")
endif(CUPS_FOUND)
else(BUILD_PRINT)
message(STATUS "Print mode: disabled")
endif(BUILD_PRINT)

#
# We need C++11
#
Expand Down
Loading

0 comments on commit 9e2ace5

Please sign in to comment.