2020-02-25 17:23:40 +00:00
|
|
|
# - Try to find Canberra library
|
2015-10-29 10:09:43 +02:00
|
|
|
#
|
2020-02-25 17:23:40 +00:00
|
|
|
# Once done this will define
|
2015-10-29 10:09:43 +02:00
|
|
|
#
|
2020-02-25 17:23:40 +00:00
|
|
|
# CANBERRA_FOUND - system has Canberra
|
|
|
|
# CANBERRA_INCLUDE_DIRS - the Canberra include directory
|
|
|
|
# CANBERRA_LIBRARIES - the libraries needed to use Canberra
|
|
|
|
#
|
|
|
|
# Copyright (c) 2020, Ivailo Monev, <xakepa10@gmail.com>
|
2015-10-29 10:09:43 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
|
|
|
|
2020-02-25 17:23:40 +00:00
|
|
|
if(NOT WIN32)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(PC_CANBERRA QUIET libcanberra)
|
2015-10-29 10:09:43 +02:00
|
|
|
|
2020-02-25 17:23:40 +00:00
|
|
|
set(CANBERRA_INCLUDE_DIRS ${PC_CANBERRA_INCLUDE_DIRS})
|
|
|
|
set(CANBERRA_LIBRARIES ${PC_CANBERRA_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CANBERRA_VERSION ${PC_CANBERRA_VERSION})
|
|
|
|
|
|
|
|
if(NOT CANBERRA_INCLUDE_DIRS OR NOT CANBERRA_LIBRARIES)
|
|
|
|
find_path(CANBERRA_INCLUDE_DIRS
|
|
|
|
NAMES canberra.h
|
|
|
|
HINTS $ENV{CANBERRADIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(CANBERRA_LIBRARIES
|
|
|
|
NAMES canberra
|
|
|
|
HINTS $ENV{CANBERRADIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2015-10-29 10:09:43 +02:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-02-25 17:23:40 +00:00
|
|
|
find_package_handle_standard_args(Canberra
|
|
|
|
VERSION_VAR CANBERRA_VERSION
|
|
|
|
REQUIRED_VARS CANBERRA_LIBRARIES CANBERRA_INCLUDE_DIRS
|
|
|
|
)
|
2015-10-29 10:09:43 +02:00
|
|
|
|
2020-02-25 17:23:40 +00:00
|
|
|
mark_as_advanced(CANBERRA_INCLUDE_DIRS CANBERRA_LIBRARIES)
|