This repository has been archived by the owner on Nov 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eglconvenience: Ensure we can query all GL functions
Follow changed from qtbase 5e9a5246fb688a33ff27bed010226595f579f23d to reduce or remove OS dependant code paths.
- Loading branch information
Showing
3 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#.rst: | ||
# FindLibdl | ||
# --------- | ||
# | ||
# Try to find libdl on a Unix system. | ||
# | ||
# This will define the following variables: | ||
# | ||
# ``Libdl_FOUND`` | ||
# True if (the requested version of) libdl is available | ||
# ``Libdl_LIBRARIES`` | ||
# This can be passed to target_link_libraries() instead of the ``Libdl::Libdl`` | ||
# target | ||
# ``Libdl_INCLUDE_DIRS`` | ||
# This should be passed to target_include_directories() if the target is not | ||
# used for linking | ||
# | ||
# If ``Libdl_FOUND`` is TRUE, it will also define the following imported target: | ||
# | ||
# ``Libdl::Libdl`` | ||
# The libdl library | ||
# | ||
# In general we recommend using the imported target, as it is easier to use. | ||
# Bear in mind, however, that if the target is in the link interface of an | ||
# exported library, it must be made available by the package config file. | ||
|
||
#============================================================================= | ||
# Copyright 2016 Pier Luigi Fiorini <[email protected]> | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# | ||
# 1. Redistributions of source code must retain the copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# 2. Redistributions in binary form must reproduce the copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# 3. The name of the author may not be used to endorse or promote products | ||
# derived from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
#============================================================================= | ||
|
||
if(CMAKE_VERSION VERSION_LESS 2.8.12) | ||
message(FATAL_ERROR "CMake 2.8.12 is required by FindLibdl.cmake") | ||
endif() | ||
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) | ||
message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindLibdl.cmake") | ||
endif() | ||
|
||
if(UNIX) | ||
find_path(Libdl_INCLUDE_DIR | ||
NAMES | ||
dlfcn.h | ||
) | ||
find_library(Libdl_LIBRARY | ||
NAMES | ||
dl libdl ltdl libltdl | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Libdl | ||
FOUND_VAR | ||
Libdl_FOUND | ||
REQUIRED_VARS | ||
Libdl_LIBRARY | ||
Libdl_INCLUDE_DIR | ||
) | ||
|
||
if(Libdl_FOUND AND NOT TARGET Libdl::Libdl) | ||
add_library(Libdl::Libdl UNKNOWN IMPORTED) | ||
set_target_properties(Libdl::Libdl PROPERTIES | ||
IMPORTED_LOCATION "${Libdl_LIBRARY}" | ||
INTERFACE_COMPILE_OPTIONS "${Libdl_DEFINITIONS}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${Libdl_INCLUDE_DIR}" | ||
) | ||
endif() | ||
|
||
mark_as_advanced(Libdl_LIBRARY Libdl_INCLUDE_DIR) | ||
|
||
# compatibility variables | ||
set(Libdl_LIBRARIES ${Libdl_LIBRARY}) | ||
set(Libdl_INCLUDE_DIRS ${Libdl_INCLUDE_DIR}) | ||
else() | ||
message(STATUS "FindLibdl.cmake can find libdl only on UNIX systems.") | ||
set(Libdl_FOUND FALSE) | ||
endif() | ||
|
||
include(FeatureSummary) | ||
set_package_properties(Libdl PROPERTIES | ||
DESCRIPTION "Programming interface to dynamic linking loader." | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters