Skip to content

Commit 2a786b4

Browse files
authored
Merge pull request #3 from schwicke/main
Add config to find epoxy library
2 parents ead5bc1 + 9e5464a commit 2a786b4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/cmake/Findepoxy.cmake

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
find_package (PkgConfig)
2+
pkg_check_modules (PC_Epoxy QUIET epoxy)
3+
set (Epoxy_DEFINITIONS ${PC_Epoxy_CFLAGS_OTHER})
4+
5+
find_path (Epoxy_INCLUDE_DIR epoxy/gl.h
6+
HINTS ${PC_Epoxy_INCLUDEDIR} ${PC_Epoxy_INCLUDE_DIRS} $ENV{EPOXY_DIR}/include
7+
PATH_SUFFIXES libepoxy)
8+
9+
find_library (Epoxy_LIBRARY NAMES epoxy libepoxy
10+
HINTS ${PC_Epoxy_LIBDIR} ${PC_Epoxy_LIBRARY_DIRS} $ENV{EPOXY_DIR}/lib)
11+
12+
if (WIN32)
13+
find_file (Epoxy_SHARED_LIBRARY epoxy-0.dll
14+
HINTS $ENV{EPOXY_DIR}/bin)
15+
endif ()
16+
17+
include (FindPackageHandleStandardArgs)
18+
19+
find_package_handle_standard_args (epoxy DEFAULT_MSG
20+
Epoxy_LIBRARY Epoxy_INCLUDE_DIR)
21+
22+
mark_as_advanced (Epoxy_INCLUDE_DIR Epoxy_LIBRARY)
23+
24+
set (Epoxy_LIBRARIES ${Epoxy_LIBRARY})
25+
set (Epoxy_INCLUDE_DIRS ${Epoxy_INCLUDE_DIR})
26+
27+
add_library (Epoxy UNKNOWN IMPORTED)
28+
set_target_properties (Epoxy PROPERTIES IMPORTED_LOCATION ${Epoxy_LIBRARY})
29+
set_target_properties (Epoxy PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${Epoxy_INCLUDE_DIRS})

0 commit comments

Comments
 (0)