Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from amoskvin/autodetect-backend-dir

Auto-detect cups backend directory correctly
  • Loading branch information...
commit 96ccce3bcf37de4d7eebbded3b44c8afe5d28d98 2 parents 60b54b8 + 11615cc
@SokoloffA SokoloffA authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 CMakeLists.txt
View
14 CMakeLists.txt
@@ -12,11 +12,17 @@ add_definitions(-DMINOR_VERSION=\"${MINOR_VERSION}\")
add_definitions(-DPATCH_VERSION=\"${PATCH_VERSION}\")
add_definitions(-DFULL_VERSION=\"${FULL_VERSION}\")
+find_program(CUPS_CONFIG_EXECUTABLE NAMES cups-config)
+if (CUPS_CONFIG_EXECUTABLE)
+ exec_program(${CUPS_CONFIG_EXECUTABLE} ARGS --serverbin OUTPUT_VARIABLE CUPS_SERVERBIN)
+ set(DEF_CUPS_BACKEND_DIR "${CUPS_SERVERBIN}/backend")
+else(CUPS_CONFIG_EXECUTABLE)
+ message(FATAL_ERROR "Can't find cups-config. Are CUPS development packages installed?")
+endif(CUPS_CONFIG_EXECUTABLE)
# Linux ***************************************
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
- set(DEF_CUPS_BACKEND_DIR /usr/lib/cups/backend)
set(DEF_CUPS_PPD_DIR /usr/share/ppd/boomaga)
set(DEF_DBUS_MACINE_ID_DIR /var/lib/dbus)
set(DEF_DBUS_SERVICE_DIR ${CMAKE_INSTALL_PREFIX}/share/dbus-1/services)
@@ -24,7 +30,6 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
# FreeBSD *************************************
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
- set(DEF_CUPS_BACKEND_DIR /usr/local/libexec/cups/backend)
set(DEF_CUPS_PPD_DIR /usr/local/share/cups/model)
set(DEF_DBUS_MACINE_ID_DIR /var/db/dbus)
set(DEF_DBUS_SERVICE_DIR ${CMAKE_INSTALL_PREFIX}/share/dbus-1/services)
@@ -81,10 +86,9 @@ install(FILES boomaga.1.gz DESTINATION share/man/man1)
message(STATUS "*****************************************************")
message(STATUS "* boomaga ver. ${FULL_VERSION}")
message(STATUS "*")
-message(STATUS "* You can change next directories using cmake options like.")
-message(STATUS "* cmake -DCUPS_BACKEND_DIR=your_path")
+message(STATUS "* You can change the following directories using cmake options like:")
+message(STATUS "* cmake -DCUPS_PPD_DIR=your_path")
message(STATUS "*")
-message(STATUS "* CUPS_BACKEND_DIR = ${CUPS_BACKEND_DIR}")
message(STATUS "* CUPS_PPD_DIR = ${CUPS_PPD_DIR}")
message(STATUS "* DBUS_MACINE_ID_DIR = ${DBUS_MACINE_ID_DIR}")
message(STATUS "* DBUS_SERVICE_DIR = ${DBUS_SERVICE_DIR}")
Please sign in to comment.
Something went wrong with that request. Please try again.