kwin/cmake/modules/Findhwdata.cmake
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00

25 lines
886 B
CMake

# - Try to find hwdata
# Once done this will define
#
# hwdata_DIR - The hwdata directory
# hwdata_PNPIDS_FILE - File with mapping of hw vendor IDs to names
# hwdata_FOUND - The hwdata directory exists and contains pnp.ids file
# SPDX-FileCopyrightText: 2020 Daniel Vrátil <dvratil@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
if (UNIX AND NOT APPLE)
find_path(hwdata_DIR NAMES hwdata/pnp.ids HINTS /usr/share ENV XDG_DATA_DIRS)
find_file(hwdata_PNPIDS_FILE NAMES hwdata/pnp.ids HINTS /usr/share)
if (NOT hwdata_DIR OR NOT hwdata_PNPIDS_FILE)
set(hwdata_FOUND FALSE)
else()
set(hwdata_FOUND TRUE)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(hwdata DEFAULT_MSG hwdata_FOUND hwdata_DIR hwdata_PNPIDS_FILE)
mark_as_advanced(hwdata_FOUND hwdata_DIR hwdata_PNPIDS_FILE)
endif()