Skip to content

Commit

Permalink
Merge pull request #19 from StijnDW/master
Browse files Browse the repository at this point in the history
Allow the user to define cups config variables
  • Loading branch information
pdewacht authored Feb 17, 2018
2 parents ba25b63 + bd7a6f3 commit a521498
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
51 changes: 31 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,37 @@ find_program(CUPS_CONFIG NAMES cups-config)
if(NOT CUPS_CONFIG)
message(FATAL_ERROR "cups-config command not found. Are the CUPS development packages installed?")
endif()
execute_process(
COMMAND "${CUPS_CONFIG}" --datadir
OUTPUT_VARIABLE CUPS_DATA_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND "${CUPS_CONFIG}" --serverbin
OUTPUT_VARIABLE CUPS_SERVER_BIN
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND "${CUPS_CONFIG}" --cflags
OUTPUT_VARIABLE CUPS_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND "${CUPS_CONFIG}" --ldflags
OUTPUT_VARIABLE CUPS_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND "${CUPS_CONFIG}" --image --libs
OUTPUT_VARIABLE CUPS_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE)

if(NOT CUPS_DATA_DIR)
execute_process(
COMMAND "${CUPS_CONFIG}" --datadir
OUTPUT_VARIABLE CUPS_DATA_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT CUPS_SERVER_BIN)
execute_process(
COMMAND "${CUPS_CONFIG}" --serverbin
OUTPUT_VARIABLE CUPS_SERVER_BIN
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT CUPS_CFLAGS)
execute_process(
COMMAND "${CUPS_CONFIG}" --cflags
OUTPUT_VARIABLE CUPS_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT CUPS_LDFLAGS)
execute_process(
COMMAND "${CUPS_CONFIG}" --ldflags
OUTPUT_VARIABLE CUPS_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT CUPS_LIBS)
execute_process(
COMMAND "${CUPS_CONFIG}" --image --libs
OUTPUT_VARIABLE CUPS_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

cmake_push_check_state()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${CUPS_CFLAGS}")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Installation
------------

Some operating systems already ship this driver. This is the case for
at least Debian, Ubuntu, Raspbian, openSUSE and Arch Linux. Look for a
package named `printer-driver-brlaser`.
at least Debian, Ubuntu, Raspbian, openSUSE, NixOS and Arch Linux.
Look for a package named `printer-driver-brlaser`.

You'll also need Ghostscript, in case that's not installed
automatically.
Expand Down

0 comments on commit a521498

Please sign in to comment.