Warning, /frameworks/kpty/cmake/FindUTEMPTER.cmake is written in an unsupported language. File is not indexed.

0001 # - Try to find the UTEMPTER directory notification library
0002 # Once done this will define
0003 #
0004 #  UTEMPTER_FOUND - system has UTEMPTER
0005 #  UTEMPTER_INCLUDE_DIR - the UTEMPTER include directory
0006 #  UTEMPTER_LIBRARIES - The libraries needed to use UTEMPTER
0007 
0008 # SPDX-FileCopyrightText: 2015 Hrvoje Senjan <hrvoje.senjan@gmail.org>
0009 #
0010 # SPDX-License-Identifier: BSD-3-Clause
0011 
0012 if (CMAKE_CROSSCOMPILING)
0013     # Avoid encoding a host path in the target library
0014     if (NOT UTEMPTER_EXECUTABLE)
0015         message(FATAL_ERROR "You must set UTEMPTER_EXECUTABLE or CMAKE_DISABLE_FIND_PACKAGE_UTEMPTER when cross-compiling")
0016     endif()
0017 else ()
0018     # use find_file instead of find_program until this is fixed:
0019     # https://gitlab.kitware.com/cmake/cmake/issues/10468
0020     find_file (UTEMPTER_EXECUTABLE utempter PATHS
0021         ${KDE_INSTALL_FULL_LIBEXECDIR}/utempter
0022         ${KDE_INSTALL_FULL_LIBDIR}/utempter
0023         ${CMAKE_INSTALL_PREFIX}/libexec/utempter
0024         ${CMAKE_INSTALL_PREFIX}/lib/utempter
0025         /usr/libexec/utempter
0026         /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/utempter
0027         /usr/lib/utempter
0028     )
0029 
0030     # On FreeBSD for example we have to use ulog-helper
0031     if (NOT UTEMPTER_EXECUTABLE)
0032         find_program (UTEMPTER_EXECUTABLE ulog-helper PATHS /usr/libexec)
0033     endif ()
0034 endif ()
0035 
0036 if (UTEMPTER_EXECUTABLE)
0037     set(UTEMPTER_COMPILE_FLAGS -DUTEMPTER_PATH=\"${UTEMPTER_EXECUTABLE}\")
0038     get_filename_component(UTEMPTER_EXECUTABLE_NAME "${UTEMPTER_EXECUTABLE}" NAME)
0039     if ("${UTEMPTER_EXECUTABLE_NAME}" STREQUAL ulog-helper)
0040         message(STATUS "UTEMPTER: using ulog-helper")
0041         set(UTEMPTER_COMPILE_FLAGS ${UTEMPTER_COMPILE_FLAGS} -DUTEMPTER_ULOG=1)
0042     endif ()
0043 endif ()
0044 
0045 include (FindPackageHandleStandardArgs)
0046 find_package_handle_standard_args (UTEMPTER REQUIRED_VARS UTEMPTER_EXECUTABLE UTEMPTER_COMPILE_FLAGS)
0047 
0048 
0049 set_package_properties (UTEMPTER PROPERTIES
0050     URL "ftp://ftp.altlinux.org/pub/people/ldv/utempter/"
0051     DESCRIPTION "Allows non-privileged applications such as terminal emulators to modify the utmp database without having to be setuid root."
0052 )
0053 
0054 mark_as_advanced (UTEMPTER_EXECUTABLE)
0055