mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-08-16 16:36:03 +00:00
Replace FindLibUUID.cmake with modified version from CMake project
This commit is contained in:
parent
b533c52edd
commit
3b1b2ab51d
@ -1,51 +1,77 @@
|
|||||||
# - Try to find LIBUUID
|
# CMake - Cross Platform Makefile Generator
|
||||||
# Find LIBUUID headers, libraries and the answer to all questions.
|
# Copyright 2000-2024 Kitware, Inc. and Contributors
|
||||||
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# LIBUUID_FOUND True if libuuid got found
|
# Distributed under the OSI-approved BSD 3-Clause License. See
|
||||||
# LIBUUID_INCLUDE_DIRS Location of libuuid headers
|
# https://cmake.org/licensing for details.
|
||||||
# LIBUUID_LIBRARIES List of libraries to use libuuid
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@googlemail.com>
|
|
||||||
#
|
|
||||||
# Redistribution and use is allowed according to the terms of the New
|
|
||||||
# BSD license.
|
|
||||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
||||||
#
|
#
|
||||||
|
#[=======================================================================[.rst:
|
||||||
|
FindLibUUID
|
||||||
|
------------
|
||||||
|
|
||||||
INCLUDE( FindPkgConfig )
|
Find LibUUID include directory and library.
|
||||||
|
|
||||||
IF ( LibUuid_FIND_REQUIRED )
|
Imported Targets
|
||||||
SET( _pkgconfig_REQUIRED "REQUIRED" )
|
^^^^^^^^^^^^^^^^
|
||||||
ELSE( LibUuid_FIND_REQUIRED )
|
|
||||||
SET( _pkgconfig_REQUIRED "" )
|
|
||||||
ENDIF ( LibUuid_FIND_REQUIRED )
|
|
||||||
|
|
||||||
IF ( LIBUUID_MIN_VERSION )
|
An :ref:`imported target <Imported targets>` named
|
||||||
PKG_SEARCH_MODULE( LIBUUID ${_pkgconfig_REQUIRED} uuid>=${LIBUUID_MIN_VERSION} )
|
``LibUUID::LibUUID`` is provided if LibUUID has been found.
|
||||||
ELSE ( LIBUUID_MIN_VERSION )
|
|
||||||
PKG_SEARCH_MODULE( LIBUUID ${_pkgconfig_REQUIRED} uuid )
|
|
||||||
ENDIF ( LIBUUID_MIN_VERSION )
|
|
||||||
|
|
||||||
|
Result Variables
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
IF( NOT LIBUUID_FOUND AND NOT PKG_CONFIG_FOUND )
|
This module defines the following variables:
|
||||||
FIND_PATH( LIBUUID_INCLUDE_DIRS uuid/uuid.h )
|
|
||||||
FIND_LIBRARY( LIBUUID_LIBRARIES uuid)
|
|
||||||
|
|
||||||
# Report results
|
``LibUUID_FOUND``
|
||||||
IF ( LIBUUID_LIBRARIES AND LIBUUID_INCLUDE_DIRS )
|
True if LibUUID was found, false otherwise.
|
||||||
SET( LIBUUID_FOUND 1 )
|
``LibUUID_INCLUDE_DIRS``
|
||||||
IF ( NOT LIBUUID_FIND_QUIETLY )
|
Include directories needed to include LibUUID headers.
|
||||||
MESSAGE( STATUS "Found libuuid: ${LIBUUID_LIBRARIES}" )
|
``LibUUID_LIBRARIES``
|
||||||
ENDIF ( NOT LIBUUID_FIND_QUIETLY )
|
Libraries needed to link to LibUUID.
|
||||||
ELSE ( LIBUUID_LIBRARIES AND LIBUUID_INCLUDE_DIRS )
|
|
||||||
IF ( LIBUUID_FIND_REQUIRED )
|
|
||||||
MESSAGE( SEND_ERROR "Could NOT find libuuid" )
|
|
||||||
ELSE ( LIBUUID_FIND_REQUIRED )
|
|
||||||
IF ( NOT LIBUUID_FIND_QUIETLY )
|
|
||||||
MESSAGE( STATUS "Could NOT find libuuid" )
|
|
||||||
ENDIF ( NOT LIBUUID_FIND_QUIETLY )
|
|
||||||
ENDIF ( LIBUUID_FIND_REQUIRED )
|
|
||||||
ENDIF ( LIBUUID_LIBRARIES AND LIBUUID_INCLUDE_DIRS )
|
|
||||||
ENDIF( NOT LIBUUID_FOUND AND NOT PKG_CONFIG_FOUND )
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED( LIBUUID_LIBRARIES LIBUUID_INCLUDE_DIRS )
|
Cache Variables
|
||||||
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
This module uses the following cache variables:
|
||||||
|
|
||||||
|
``LibUUID_LIBRARY``
|
||||||
|
The location of the LibUUID library file.
|
||||||
|
``LibUUID_INCLUDE_DIR``
|
||||||
|
The location of the LibUUID include directory containing ``uuid/uuid.h``.
|
||||||
|
|
||||||
|
The cache variables should not be used by project code.
|
||||||
|
They may be set by end users to point at LibUUID components.
|
||||||
|
#]=======================================================================]
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
find_library(LibUUID_LIBRARY
|
||||||
|
NAMES uuid
|
||||||
|
)
|
||||||
|
mark_as_advanced(LibUUID_LIBRARY)
|
||||||
|
|
||||||
|
find_path(LibUUID_INCLUDE_DIR
|
||||||
|
NAMES uuid/uuid.h
|
||||||
|
)
|
||||||
|
mark_as_advanced(LibUUID_INCLUDE_DIR)
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibUUID
|
||||||
|
FOUND_VAR LibUUID_FOUND
|
||||||
|
REQUIRED_VARS LibUUID_LIBRARY LibUUID_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
set(LIBUUID_FOUND ${LibUUID_FOUND})
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Provide documented result variables and targets.
|
||||||
|
if(LibUUID_FOUND)
|
||||||
|
set(LibUUID_INCLUDE_DIRS ${LibUUID_INCLUDE_DIR})
|
||||||
|
set(LibUUID_LIBRARIES ${LibUUID_LIBRARY})
|
||||||
|
if(NOT TARGET LibUUID::LibUUID)
|
||||||
|
add_library(LibUUID::LibUUID UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(LibUUID::LibUUID PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${LibUUID_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${LibUUID_INCLUDE_DIRS}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
@ -23,9 +23,9 @@ target_link_libraries(gamestream moonlight-common)
|
|||||||
set_target_properties(gamestream PROPERTIES SOVERSION ${SO_VERSION} VERSION ${PROJECT_VERSION})
|
set_target_properties(gamestream PROPERTIES SOVERSION ${SO_VERSION} VERSION ${PROJECT_VERSION})
|
||||||
set_target_properties(moonlight-common PROPERTIES SOVERSION ${SO_VERSION} VERSION ${PROJECT_VERSION})
|
set_target_properties(moonlight-common PROPERTIES SOVERSION ${SO_VERSION} VERSION ${PROJECT_VERSION})
|
||||||
|
|
||||||
target_include_directories(gamestream PRIVATE ../third_party/moonlight-common-c/src ../third_party/h264bitstream ${AVAHI_INCLUDE_DIRS} ${LIBUUID_INCLUDE_DIRS})
|
target_include_directories(gamestream PRIVATE ../third_party/moonlight-common-c/src ../third_party/h264bitstream ${AVAHI_INCLUDE_DIRS} ${LibUUID_INCLUDE_DIRS})
|
||||||
target_include_directories(moonlight-common PRIVATE ../third_party/moonlight-common-c/reedsolomon ../third_party/moonlight-common-c/enet/include)
|
target_include_directories(moonlight-common PRIVATE ../third_party/moonlight-common-c/reedsolomon ../third_party/moonlight-common-c/enet/include)
|
||||||
target_link_libraries(gamestream ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ${EXPAT_LIBRARIES} ${AVAHI_LIBRARIES} ${LIBUUID_LIBRARIES})
|
target_link_libraries(gamestream ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ${EXPAT_LIBRARIES} ${AVAHI_LIBRARIES} ${LibUUID_LIBRARIES})
|
||||||
|
|
||||||
target_link_libraries(gamestream ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
|
target_link_libraries(gamestream ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user