-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- It now exports actual CMake targets. - It searches all of the system's default paths. (no more hardcoding)
- Loading branch information
1 parent
ec2e40f
commit 8b3d7d9
Showing
3 changed files
with
60 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying | ||
# file Copyright.txt or https://cmake.org/licensing for details. | ||
|
||
#[=======================================================================[.rst: | ||
FindLibAO | ||
-------- | ||
|
||
Find the libao cross-platform audio output library | ||
|
||
IMPORTED Targets | ||
^^^^^^^^^^^^^^^^ | ||
|
||
This module defines :prop_tgt:`IMPORTED` target ``libao::libao``, if | ||
libao has been found. | ||
|
||
Result Variables | ||
^^^^^^^^^^^^^^^^ | ||
|
||
This module defines the following variables: | ||
|
||
``LIBAO_FOUND`` | ||
True if LIBAO_INCLUDE_DIR & LIBAO_LIBRARY are found | ||
|
||
``LIBAO_LIBRARIES`` | ||
List of libraries when using libao. | ||
|
||
``LIBAO_INCLUDE_DIRS`` | ||
Where to find the libao headers. | ||
|
||
Cache variables | ||
^^^^^^^^^^^^^^^ | ||
|
||
The following cache variables may also be set: | ||
|
||
``LIBAO_INCLUDE_DIR`` | ||
the libao include directory | ||
|
||
``LIBAO_LIBRARY`` | ||
the absolute path of the libao library | ||
#]=======================================================================] | ||
|
||
find_path(LIBAO_INCLUDE_DIR NAMES ao/ao.h DOC "The libao include directory") | ||
find_library(LIBAO_LIBRARY NAMES ao DOC "The libao library") | ||
|
||
mark_as_advanced(LIBAO_INCLUDE_DIR LIBAO_LIBRARY) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(LibAO REQUIRED_VARS LIBAO_LIBRARY LIBAO_INCLUDE_DIR) | ||
|
||
if(LIBAO_FOUND) | ||
set(LIBAO_INCLUDE_DIRS "${LIBAO_INCLUDE_DIR}") | ||
set(LIBAO_LIBRARIES "${LIBAO_LIBRARY}") | ||
if(NOT TARGET libao::libao) | ||
add_library(libao::libao UNKNOWN IMPORTED) | ||
set_target_properties(libao::libao PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBAO_INCLUDE_DIRS}") | ||
set_target_properties(libao::libao PROPERTIES IMPORTED_LOCATION "${LIBAO_LIBRARY}") | ||
endif() | ||
endif() |