[channels,printer] default CUPS to being enabled

* printer support now enabled by default unless iOS or ANDROID is build.
* Move cups library detection to printer module
This commit is contained in:
akallabeth
2023-08-24 09:08:44 +02:00
committed by akallabeth
parent 4e824b243f
commit ad51c6a0f5
3 changed files with 16 additions and 14 deletions

View File

@@ -6,12 +6,21 @@ set(OPTION_SERVER_DEFAULT OFF)
if(WIN32)
set(OPTION_CLIENT_DEFAULT ON)
set(OPTION_SERVER_DEFAULT OFF)
elseif(WITH_CUPS)
set(OPTION_CLIENT_DEFAULT ON)
set(OPTION_SERVER_DEFAULT OFF)
else()
set(OPTION_CLIENT_DEFAULT OFF)
set(OPTION_SERVER_DEFAULT OFF)
# cups is available on mac os and linux by default, on android it is optional.
if (NOT IOS AND NOT ANDROID)
set(CUPS_DEFAULT ON)
else()
set(CUPS_DEFAULT OFF)
endif()
option(WITH_CUPS "CUPS printer support" ${CUPS_DEFAULT})
if(WITH_CUPS)
set(OPTION_CLIENT_DEFAULT ON)
set(OPTION_SERVER_DEFAULT OFF)
else()
set(OPTION_CLIENT_DEFAULT OFF)
set(OPTION_SERVER_DEFAULT OFF)
endif()
endif()
define_channel_options(NAME "printer" TYPE "device"

View File

@@ -17,6 +17,7 @@
# limitations under the License.
define_channel_client_subsystem("printer" "cups" "")
find_package(Cups REQUIRED)
set(${MODULE_PREFIX}_SRCS
printer_cups.c)
@@ -27,6 +28,6 @@ set(${MODULE_PREFIX}_LIBS
)
include_directories(..)
include_directories(${CUPS_INCLUDE_DIR})
include_directories(${CUPS_INCLUDE_DIRS})
add_channel_client_subsystem_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} "" TRUE "")