diff options
author | Lukas Rusak <lorusak@gmail.com> | 2017-04-11 18:38:30 -0700 |
---|---|---|
committer | Lukas Rusak <lorusak@gmail.com> | 2017-07-05 16:12:29 -0700 |
commit | e8f2a94447a646e45cea081ac738e75912e5340c (patch) | |
tree | 7bec8b74f4e1a9ea205068dd89aa74948c927caf /cmake | |
parent | f66ac20e15c3adef82e8f346006840e7e2a9c578 (diff) |
[cmake] allow building with gbm
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindGBM.cmake | 44 | ||||
-rw-r--r-- | cmake/platform/linux/gbm.cmake | 1 | ||||
-rw-r--r-- | cmake/treedata/optional/common/gbm.txt | 1 |
3 files changed, 46 insertions, 0 deletions
diff --git a/cmake/modules/FindGBM.cmake b/cmake/modules/FindGBM.cmake new file mode 100644 index 0000000000..ac95241159 --- /dev/null +++ b/cmake/modules/FindGBM.cmake @@ -0,0 +1,44 @@ +# FindGBM +# ---------- +# Finds the GBM library +# +# This will will define the following variables:: +# +# GBM_FOUND - system has GBM +# GBM_INCLUDE_DIRS - the GBM include directory +# GBM_LIBRARIES - the GBM libraries +# GBM_DEFINITIONS - the GBM definitions +# +# and the following imported targets:: +# +# GBM::GBM - The GBM library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_GBM gbm QUIET) +endif() + +find_path(GBM_INCLUDE_DIR NAMES gbm.h + PATHS ${PC_GBM_INCLUDEDIR}) +find_library(GBM_LIBRARY NAMES gbm + PATHS ${PC_GBM_LIBDIR}) + +set(GBM_VERSION ${PC_GBM_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GBM + REQUIRED_VARS GBM_LIBRARY GBM_INCLUDE_DIR + VERSION_VAR GBM_VERSION) + +if(GBM_FOUND) + set(GBM_LIBRARIES ${GBM_LIBRARY}) + set(GBM_INCLUDE_DIRS ${GBM_INCLUDE_DIR}) + set(GBM_DEFINITIONS -DHAVE_GBM=1) + if(NOT TARGET GBM::GBM) + add_library(GBM::GBM UNKNOWN IMPORTED) + set_target_properties(GBM::GBM PROPERTIES + IMPORTED_LOCATION "${GBM_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${GBM_INCLUDE_DIR}") + endif() +endif() + +mark_as_advanced(GBM_INCLUDE_DIR GBM_LIBRARY) diff --git a/cmake/platform/linux/gbm.cmake b/cmake/platform/linux/gbm.cmake new file mode 100644 index 0000000000..2b1fe31a68 --- /dev/null +++ b/cmake/platform/linux/gbm.cmake @@ -0,0 +1 @@ +set(PLATFORM_REQUIRED_DEPS OpenGLES EGL GBM LibDRM) diff --git a/cmake/treedata/optional/common/gbm.txt b/cmake/treedata/optional/common/gbm.txt new file mode 100644 index 0000000000..1adde939d6 --- /dev/null +++ b/cmake/treedata/optional/common/gbm.txt @@ -0,0 +1 @@ +xbmc/windowing/gbm windowing/gbm # GBM |