From 9bdd3a0e4724a591f0cdc6dd8bdd60dc794354e4 Mon Sep 17 00:00:00 2001 From: gregory guy Date: Wed, 12 May 2021 20:17:47 +0200 Subject: Make the option -DWITH_USBIDS more visible for packagers. Look for installed usb.ids file, if not found, default to the one provided in source. usb.ids file has been updated to Version 2021.03.31 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gregory guy Signed-off-by: Slávek Banko (cherry picked from commit 1389e296969df0acf7f393b698a3a0f1fb572026) --- ConfigureChecks.cmake | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'ConfigureChecks.cmake') diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 88f11868d..070c32f02 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -24,6 +24,27 @@ find_package( TQt ) find_package( TDE ) +##### look for the usb.ids file, Its location can be set EG: -DWITH_USBIDS="/opt/share/misc/usb.ids" + +if( WITH_USBIDS ) + set( USBIDS_FILE "${WITH_USBIDS}" ) + message( STATUS "Using specified usb.ids file: ${USBIDS_FILE}" ) + else() + find_file( PATH_USBIDS usb.ids + HINTS /usr/share/misc + /var/lib/usbutils + /usr/share/hwdata + ) + if( PATH_USBIDS ) + set( USBIDS_FILE "${PATH_USBIDS}" ) + message( STATUS "Using system usb.ids file: ${PATH_USBIDS}" ) + else() + set( USE_BUILTIN_USBIDS 1 ) + message( STATUS "File usb.ids (hwdata) was not found on the system, using builtin" ) + endif() +endif( WITH_USBIDS ) + + ##### check for libdl ########################### set( DL_LIBRARIES dl ) -- cgit v1.2.1