diff options
Diffstat (limited to 'project/cmake/modules/FindMMAL.cmake')
| -rw-r--r-- | project/cmake/modules/FindMMAL.cmake | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/project/cmake/modules/FindMMAL.cmake b/project/cmake/modules/FindMMAL.cmake new file mode 100644 index 0000000..8843983 --- /dev/null +++ b/project/cmake/modules/FindMMAL.cmake | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | # - Try to find MMAL | ||
| 2 | # Once done this will define | ||
| 3 | # | ||
| 4 | # MMAL_FOUND - system has MMAL | ||
| 5 | # MMAL_INCLUDE_DIRS - the MMAL include directory | ||
| 6 | # MMAL_LIBRARIES - The MMAL libraries | ||
| 7 | |||
| 8 | if(PKG_CONFIG_FOUND) | ||
| 9 | pkg_check_modules(MMAL mmal QUIET) | ||
| 10 | endif() | ||
| 11 | |||
| 12 | if(NOT MMAL_FOUND) | ||
| 13 | find_path(MMAL_INCLUDE_DIRS interface/mmal/mmal.h) | ||
| 14 | find_library(MMAL_LIBRARY mmal) | ||
| 15 | find_library(MMALCORE_LIBRARY mmal_core) | ||
| 16 | find_library(MMALUTIL_LIBRARY mmal_util) | ||
| 17 | find_library(MMALCLIENT_LIBRARY mmal_vc_client) | ||
| 18 | find_library(MMALCOMPONENT_LIBRARY mmal_components) | ||
| 19 | find_library(BCM_LIBRARY bcm_host) | ||
| 20 | find_library(VCHIQ_LIBRARY vchiq_arm) | ||
| 21 | find_library(VCOS_LIBRARY vcos) | ||
| 22 | find_library(VCSM_LIBRARY vcsm) | ||
| 23 | find_library(CONTAINER_LIBRARY containers) | ||
| 24 | |||
| 25 | set(MMAL_LIBRARIES ${MMAL_LIBRARY} ${MMALCORE_LIBRARY} ${MMALUTIL_LIBRARY} | ||
| 26 | ${MMALCLIENT_LIBRARY} ${MMALCOMPONENT_LIBRARY} | ||
| 27 | ${BCM_LIBRARY} ${VCHIQ_LIBRARY} ${VCOS_LIBRARY} ${VCSM_LIBRARY} ${CONTAINER_LIBRARY} | ||
| 28 | CACHE STRING "mmal libraries" FORCE) | ||
| 29 | endif() | ||
| 30 | |||
| 31 | include(FindPackageHandleStandardArgs) | ||
| 32 | find_package_handle_standard_args(MMAL DEFAULT_MSG MMAL_LIBRARIES MMAL_INCLUDE_DIRS) | ||
| 33 | |||
| 34 | list(APPEND MMAL_DEFINITIONS -DHAVE_MMAL=1 -DHAS_MMAL=1) | ||
| 35 | |||
| 36 | mark_as_advanced(MMAL_INCLUDE_DIRS MMAL_LIBRARIES MMAL_DEFINITIONS) | ||
