Skip to content

Commit

Permalink
Merge pull request #3 from schwicke/main
Browse files Browse the repository at this point in the history
Add config to find epoxy library
  • Loading branch information
schwicke authored Nov 29, 2024
2 parents ead5bc1 + 9e5464a commit 2a786b4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/cmake/Findepoxy.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
find_package (PkgConfig)
pkg_check_modules (PC_Epoxy QUIET epoxy)
set (Epoxy_DEFINITIONS ${PC_Epoxy_CFLAGS_OTHER})

find_path (Epoxy_INCLUDE_DIR epoxy/gl.h
HINTS ${PC_Epoxy_INCLUDEDIR} ${PC_Epoxy_INCLUDE_DIRS} $ENV{EPOXY_DIR}/include
PATH_SUFFIXES libepoxy)

find_library (Epoxy_LIBRARY NAMES epoxy libepoxy
HINTS ${PC_Epoxy_LIBDIR} ${PC_Epoxy_LIBRARY_DIRS} $ENV{EPOXY_DIR}/lib)

if (WIN32)
find_file (Epoxy_SHARED_LIBRARY epoxy-0.dll
HINTS $ENV{EPOXY_DIR}/bin)
endif ()

include (FindPackageHandleStandardArgs)

find_package_handle_standard_args (epoxy DEFAULT_MSG
Epoxy_LIBRARY Epoxy_INCLUDE_DIR)

mark_as_advanced (Epoxy_INCLUDE_DIR Epoxy_LIBRARY)

set (Epoxy_LIBRARIES ${Epoxy_LIBRARY})
set (Epoxy_INCLUDE_DIRS ${Epoxy_INCLUDE_DIR})

add_library (Epoxy UNKNOWN IMPORTED)
set_target_properties (Epoxy PROPERTIES IMPORTED_LOCATION ${Epoxy_LIBRARY})
set_target_properties (Epoxy PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${Epoxy_INCLUDE_DIRS})

0 comments on commit 2a786b4

Please sign in to comment.