1
0
mirror of https://github.com/pdewacht/brlaser synced 2024-12-26 15:38:20 +01:00

Merge pull request #19 from StijnDW/master

Allow the user to define cups config variables
This commit is contained in:
Peter De Wachter 2018-02-17 19:04:27 +01:00 committed by GitHub
commit a521498233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 22 deletions

View File

@ -54,26 +54,37 @@ find_program(CUPS_CONFIG NAMES cups-config)
if(NOT CUPS_CONFIG) if(NOT CUPS_CONFIG)
message(FATAL_ERROR "cups-config command not found. Are the CUPS development packages installed?") message(FATAL_ERROR "cups-config command not found. Are the CUPS development packages installed?")
endif() endif()
execute_process(
COMMAND "${CUPS_CONFIG}" --datadir if(NOT CUPS_DATA_DIR)
OUTPUT_VARIABLE CUPS_DATA_DIR execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE) COMMAND "${CUPS_CONFIG}" --datadir
execute_process( OUTPUT_VARIABLE CUPS_DATA_DIR
COMMAND "${CUPS_CONFIG}" --serverbin OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_VARIABLE CUPS_SERVER_BIN endif()
OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT CUPS_SERVER_BIN)
execute_process( execute_process(
COMMAND "${CUPS_CONFIG}" --cflags COMMAND "${CUPS_CONFIG}" --serverbin
OUTPUT_VARIABLE CUPS_CFLAGS OUTPUT_VARIABLE CUPS_SERVER_BIN
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process( endif()
COMMAND "${CUPS_CONFIG}" --ldflags if(NOT CUPS_CFLAGS)
OUTPUT_VARIABLE CUPS_LDFLAGS execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE) COMMAND "${CUPS_CONFIG}" --cflags
execute_process( OUTPUT_VARIABLE CUPS_CFLAGS
COMMAND "${CUPS_CONFIG}" --image --libs OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_VARIABLE CUPS_LIBS endif()
OUTPUT_STRIP_TRAILING_WHITESPACE) 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() cmake_push_check_state()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${CUPS_CFLAGS}") set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${CUPS_CFLAGS}")

View File

@ -38,8 +38,8 @@ Installation
------------ ------------
Some operating systems already ship this driver. This is the case for Some operating systems already ship this driver. This is the case for
at least Debian, Ubuntu, Raspbian, openSUSE and Arch Linux. Look for a at least Debian, Ubuntu, Raspbian, openSUSE, NixOS and Arch Linux.
package named `printer-driver-brlaser`. Look for a package named `printer-driver-brlaser`.
You'll also need Ghostscript, in case that's not installed You'll also need Ghostscript, in case that's not installed
automatically. automatically.