Changeset View
Changeset View
Standalone View
Standalone View
cmake/modules/FindEpoxy.cmake
- This file was moved from cmake/modules/Findepoxy.cmake.
1 | # - Try to find libepoxy | 1 | # - Try to find libepoxy | ||
---|---|---|---|---|---|
2 | # Once done this will define | 2 | # Once done this will define | ||
3 | # | 3 | # | ||
4 | # epoxy_FOUND - System has libepoxy | 4 | # Epoxy_FOUND - System has libepoxy | ||
5 | # epoxy_LIBRARY - The libepoxy library | 5 | # Epoxy_LIBRARIES - The libepoxy library | ||
6 | # epoxy_INCLUDE_DIR - The libepoxy include dir | 6 | # Epoxy_INCLUDE_DIRS - The libepoxy include dir | ||
7 | # epoxy_DEFINITIONS - Compiler switches required for using libepoxy | 7 | # Epoxy_DEFINITIONS - Compiler switches required for using libepoxy | ||
8 | # epoxy_HAS_GLX - Whether GLX support is available | 8 | # Epoxy_HAS_GLX - Whether GLX support is available | ||
9 | 9 | | |||
10 | # Copyright (c) 2014 Fredrik Höglund <fredrik@kde.org> | 10 | # Copyright (c) 2014 Fredrik Höglund <fredrik@kde.org> | ||
11 | # | 11 | # | ||
12 | # Redistribution and use in source and binary forms, with or without | 12 | # Redistribution and use in source and binary forms, with or without | ||
13 | # modification, are permitted provided that the following conditions | 13 | # modification, are permitted provided that the following conditions | ||
14 | # are met: | 14 | # are met: | ||
15 | # 1. Redistributions of source code must retain the above copyright | 15 | # 1. Redistributions of source code must retain the above copyright | ||
16 | # notice, this list of conditions and the following disclaimer. | 16 | # notice, this list of conditions and the following disclaimer. | ||
Show All 11 Lines | |||||
28 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 28 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
29 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 29 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
30 | # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 30 | # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
31 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 31 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
32 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 32 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
33 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
34 | # SUCH DAMAGE. | 34 | # SUCH DAMAGE. | ||
35 | 35 | | |||
36 | if (NOT WIN32) | | |||
37 | find_package(PkgConfig) | 36 | find_package(PkgConfig) | ||
38 | pkg_check_modules(PKG_epoxy QUIET epoxy) | 37 | pkg_check_modules(PKG_Epoxy QUIET epoxy) | ||
39 | 38 | | |||
40 | set(epoxy_DEFINITIONS ${PKG_epoxy_CFLAGS}) | 39 | set(Epoxy_DEFINITIONS ${PKG_Epoxy_CFLAGS}) | ||
41 | 40 | | |||
42 | find_path(epoxy_INCLUDE_DIR NAMES epoxy/gl.h HINTS ${PKG_epoxy_INCLUDEDIR} ${PKG_epoxy_INCLUDE_DIRS}) | 41 | find_path(Epoxy_INCLUDE_DIRS NAMES epoxy/gl.h HINTS ${PKG_Epoxy_INCLUDEDIR} ${PKG_Epoxy_INCLUDE_DIRS}) | ||
43 | find_library(epoxy_LIBRARY NAMES epoxy HINTS ${PKG_epoxy_LIBDIR} ${PKG_epoxy_LIBRARY_DIRS}) | 42 | find_library(Epoxy_LIBRARIES NAMES epoxy HINTS ${PKG_Epoxy_LIBDIR} ${PKG_Epoxy_LIBRARIES_DIRS}) | ||
44 | find_file(epoxy_GLX_HEADER NAMES epoxy/glx.h HINTS ${epoxy_INCLUDE_DIR}) | 43 | find_file(Epoxy_GLX_HEADER NAMES epoxy/glx.h HINTS ${Epoxy_INCLUDE_DIRS}) | ||
45 | 44 | | |||
46 | if (epoxy_GLX_HEADER STREQUAL "epoxy_GLX_HEADER-NOTFOUND") | 45 | if (Epoxy_GLX_HEADER STREQUAL "Epoxy_GLX_HEADER-NOTFOUND") | ||
47 | set(epoxy_HAS_GLX FALSE CACHE BOOL "whether glx is available") | 46 | set(Epoxy_HAS_GLX FALSE CACHE BOOL "whether glx is available") | ||
48 | else () | 47 | else () | ||
49 | set(epoxy_HAS_GLX TRUE CACHE BOOL "whether glx is available") | 48 | set(Epoxy_HAS_GLX TRUE CACHE BOOL "whether glx is available") | ||
50 | endif() | 49 | endif() | ||
51 | 50 | | |||
52 | include(FindPackageHandleStandardArgs) | 51 | include(FindPackageHandleStandardArgs) | ||
53 | find_package_handle_standard_args(epoxy DEFAULT_MSG epoxy_LIBRARY epoxy_INCLUDE_DIR) | 52 | find_package_handle_standard_args(Epoxy DEFAULT_MSG Epoxy_LIBRARIES Epoxy_INCLUDE_DIRS) | ||
54 | 53 | | |||
55 | mark_as_advanced(epoxy_INCLUDE_DIR epoxy_LIBRARY epoxy_HAS_GLX) | 54 | mark_as_advanced(Epoxy_INCLUDE_DIRS Epoxy_LIBRARIES Epoxy_HAS_GLX) | ||
56 | endif() | |