| 1 |
#[[ |
| 2 |
A module to look for Opus |
| 3 |
]] |
| 4 |
|
| 5 |
if( NOT opusfile_FOUND ) |
| 6 |
include( FindPackageHandleStandardArgs) |
| 7 |
|
| 8 |
find_path( opusfile_INCLUDE_DIR opus/opusfile.h |
| 9 |
HINTS |
| 10 |
${OPUSFILE_ROOT} |
| 11 |
) |
| 12 |
|
| 13 |
find_library( opusfile_LIBRARIES |
| 14 |
NAMES |
| 15 |
opusfile |
| 16 |
HINTS |
| 17 |
${OPUSFILE_ROOT} |
| 18 |
) |
| 19 |
|
| 20 |
find_package_handle_standard_args( opusfile DEFAULT_MSG opusfile_INCLUDE_DIR opusfile_LIBRARIES ) |
| 21 |
|
| 22 |
if( opusfile_FOUND ) |
| 23 |
if( NOT TARGET opusfile::opusfile ) |
| 24 |
add_library( opusfile::opusfile INTERFACE IMPORTED GLOBAL ) |
| 25 |
|
| 26 |
target_include_directories( opusfile::opusfile INTERFACE ${opusfile_INCLUDE_DIR} "${opusfile_INCLUDE_DIR}/opus" ) |
| 27 |
target_link_libraries( opusfile::opusfile INTERFACE ${opusfile_LIBRARIES} ) |
| 28 |
endif() |
| 29 |
|
| 30 |
mark_as_advanced( |
| 31 |
opusfile_FOUND |
| 32 |
opusfile_INCLUDE_DIR |
| 33 |
opusfile_LIBRARIES |
| 34 |
) |
| 35 |
endif() |
| 36 |
endif() |