mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 02:26:16 +00:00
cmake: Don't use pkgconfig on Android.
It tends to pick up host libraries.
This commit is contained in:
parent
7dc61f8d51
commit
9626a8d575
|
@ -36,7 +36,7 @@
|
|||
#=============================================================================
|
||||
# Copyright 2014 Alex Merry <alex.merry@kde.org>
|
||||
# Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
|
||||
# Copyright 2019 Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
# Copyright 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
|
@ -67,8 +67,12 @@ include(CMakePushCheckState)
|
|||
|
||||
# Use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKG_EGL QUIET egl)
|
||||
if(NOT ANDROID)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKGCONFIG_FOUND)
|
||||
pkg_check_modules(PKG_EGL QUIET egl)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(EGL_DEFINITIONS ${PKG_EGL_CFLAGS_OTHER})
|
||||
|
||||
|
|
|
@ -40,11 +40,11 @@
|
|||
# ``HIDAPI_LIBRARIES``
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010, 2019 Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net>
|
||||
# 2009-2010, 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Copyright Collabora, Ltd. 2019.
|
||||
# Copyright Collabora, Ltd. 2019, 2021.
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
@ -72,8 +72,9 @@ if(NOT HIDAPI_FIND_COMPONENTS)
|
|||
endif()
|
||||
|
||||
# Ask pkg-config for hints
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
if(NOT ANDROID)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
set(_old_prefix_path "${CMAKE_PREFIX_PATH}")
|
||||
# So pkg-config uses HIDAPI_ROOT_DIR too.
|
||||
if(HIDAPI_ROOT_DIR)
|
||||
|
@ -83,6 +84,7 @@ if(PKG_CONFIG_FOUND)
|
|||
pkg_check_modules(PC_HIDAPI_HIDRAW QUIET hidapi-hidraw)
|
||||
# Restore
|
||||
set(CMAKE_PREFIX_PATH "${_old_prefix_path}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Actually search
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Copyright 2019 Collabora, Ltd.
|
||||
# Copyright 2019, 2021 Collabora, Ltd.
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
# Original Author:
|
||||
# 2019 Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
# 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
|
||||
#.rst:
|
||||
# FindCheck
|
||||
|
@ -36,8 +36,9 @@ set(LIBCHECK_ROOT_DIR
|
|||
"${LIBCHECK_ROOT_DIR}"
|
||||
CACHE PATH "Root to search for libcheck")
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
if(NOT ANDROID)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
set(_old_prefix_path "${CMAKE_PREFIX_PATH}")
|
||||
# So pkg-config uses LIBCHECK_ROOT_DIR too.
|
||||
if(LIBCHECK_ROOT_DIR)
|
||||
|
@ -46,7 +47,9 @@ if(PKG_CONFIG_FOUND)
|
|||
pkg_check_modules(PC_LIBCHECK QUIET check)
|
||||
# Restore
|
||||
set(CMAKE_PREFIX_PATH "${_old_prefix_path}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_path(
|
||||
LIBCHECK_INCLUDE_DIR
|
||||
NAMES check.h
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
# 2009-2010, 2021 Ryan Pavlik <ryanpavlik@gmail.com> <abiryan@ryand.net>
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Copyright Collabora, Ltd 2021.
|
||||
#
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
@ -47,9 +47,11 @@ if(WIN32)
|
|||
endif()
|
||||
else()
|
||||
set(_lib_suffixes)
|
||||
if(NOT ANDROID)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_LIBUSB1 libusb-1.0)
|
||||
pkg_check_modules(PC_LIBUSB1 QUIET libusb-1.0)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Copyright 2020 Collabora, Ltd.
|
||||
# Copyright 2020-2021 Collabora, Ltd.
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
# Original Author:
|
||||
# 2020 Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
# 2020-2021 Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
|
||||
#[[.rst:
|
||||
FindOpenGLES
|
||||
|
@ -53,8 +53,10 @@ set(OpenGLES_ROOT_DIR
|
|||
if(NOT OpenGLES_FIND_COMPONENTS)
|
||||
set(OpenGLES_FIND_COMPONENTS V2)
|
||||
endif()
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
|
||||
if(NOT ANDROID)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
set(_old_prefix_path "${CMAKE_PREFIX_PATH}")
|
||||
# So pkg-config uses OpenGLES_ROOT_DIR too.
|
||||
if(OpenGLES_ROOT_DIR)
|
||||
|
@ -64,7 +66,9 @@ if(PKG_CONFIG_FOUND)
|
|||
pkg_check_modules(PC_glesv2 QUIET glesv2)
|
||||
# Restore
|
||||
set(CMAKE_PREFIX_PATH "${_old_prefix_path}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_path(
|
||||
OpenGLES_V1_INCLUDE_DIR
|
||||
NAMES GLES/gl.h
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Copyright 2019 Collabora, Ltd.
|
||||
# Copyright 2019, 2021 Collabora, Ltd.
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
# Original Author:
|
||||
# 2019 Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
# 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
|
||||
#.rst:
|
||||
# FindOpenHMD
|
||||
|
@ -34,8 +34,9 @@ set(OPENHMD_ROOT_DIR
|
|||
"${OPENHMD_ROOT_DIR}"
|
||||
CACHE PATH "Root to search for OpenHMD")
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
if(NOT ANDROID)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
set(_old_prefix_path "${CMAKE_PREFIX_PATH}")
|
||||
# So pkg-config uses OPENHMD_ROOT_DIR too.
|
||||
if(OPENHMD_ROOT_DIR)
|
||||
|
@ -44,6 +45,7 @@ if(PKG_CONFIG_FOUND)
|
|||
pkg_check_modules(PC_OPENHMD QUIET openhmd)
|
||||
# Restore
|
||||
set(CMAKE_PREFIX_PATH "${_old_prefix_path}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_path(
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#
|
||||
#=============================================================================
|
||||
# Copyright (c) 2015 Jari Vetoniemi
|
||||
# Copyright (c) 2020 Collabora, Ltd.
|
||||
# Copyright (c) 2020-2021 Collabora, Ltd.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
#
|
||||
|
@ -31,8 +31,13 @@ set_package_properties(
|
|||
URL "http://freedesktop.org/wiki/Software/systemd/"
|
||||
DESCRIPTION "System and Service Manager")
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_SYSTEMD QUIET libsystemd)
|
||||
if(NOT ANDROID)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_SYSTEMD QUIET libsystemd)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_library(
|
||||
SYSTEMD_LIBRARY
|
||||
NAMES systemd
|
||||
|
|
|
@ -13,8 +13,13 @@
|
|||
# Requires these CMake modules:
|
||||
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
|
||||
#
|
||||
# Original Author:
|
||||
# Copyright 2014 Kevin M. Godby <kevin@godby.org>
|
||||
# Original Authors:
|
||||
# 2014 Kevin M. Godby <kevin@godby.org>
|
||||
# 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
#
|
||||
# Copyright 2014, Kevin M. Godby <kevin@godby.org>
|
||||
# Copyright 2021, Collabora, Ltd.
|
||||
#
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
|
@ -27,9 +32,11 @@ set(UDEV_ROOT_DIR
|
|||
PATH
|
||||
"Directory to search for udev")
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_LIBUDEV libudev)
|
||||
if(NOT ANDROID)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_LIBUDEV QUIET libudev)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_library(UDEV_LIBRARY
|
||||
|
|
Loading…
Reference in a new issue