summaryrefslogtreecommitdiffstats
path: root/project/cmake/modules/FindAML.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'project/cmake/modules/FindAML.cmake')
-rw-r--r--project/cmake/modules/FindAML.cmake35
1 files changed, 35 insertions, 0 deletions
diff --git a/project/cmake/modules/FindAML.cmake b/project/cmake/modules/FindAML.cmake
new file mode 100644
index 0000000..5b9a859
--- /dev/null
+++ b/project/cmake/modules/FindAML.cmake
@@ -0,0 +1,35 @@
1#.rst:
2# FindAML
3# -------
4# Finds the AML codec
5#
6# This will will define the following variables::
7#
8# AML_FOUND - system has AML
9# AML_INCLUDE_DIRS - the AML include directory
10# AML_DEFINITIONS - the AML definitions
11#
12# and the following imported targets::
13#
14# AML::AML - The AML codec
15
16find_path(AML_INCLUDE_DIR codec_error.h
17 PATH_SUFFIXES amcodec)
18
19include(FindPackageHandleStandardArgs)
20find_package_handle_standard_args(AML
21 REQUIRED_VARS AML_INCLUDE_DIR)
22
23if(AML_FOUND)
24 set(AML_INCLUDE_DIRS ${AML_INCLUDE_DIR})
25 set(AML_DEFINITIONS -DHAS_LIBAMCODEC=1)
26
27 if(NOT TARGET AML::AML)
28 add_library(AML::AML UNKNOWN IMPORTED)
29 set_target_properties(AML::AML PROPERTIES
30 INTERFACE_INCLUDE_DIRECTORIES "${AML_INCLUDE_DIR}"
31 INTERFACE_COMPILE_DEFINITIONS HAS_LIBAMCODEC=1)
32 endif()
33endif()
34
35mark_as_advanced(AMLCODEC_INCLUDE_DIR)