diff options
Diffstat (limited to 'cmake/modules/FindAML.cmake')
| -rw-r--r-- | cmake/modules/FindAML.cmake | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cmake/modules/FindAML.cmake b/cmake/modules/FindAML.cmake new file mode 100644 index 0000000..5b9a859 --- /dev/null +++ b/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 | |||
| 16 | find_path(AML_INCLUDE_DIR codec_error.h | ||
| 17 | PATH_SUFFIXES amcodec) | ||
| 18 | |||
| 19 | include(FindPackageHandleStandardArgs) | ||
| 20 | find_package_handle_standard_args(AML | ||
| 21 | REQUIRED_VARS AML_INCLUDE_DIR) | ||
| 22 | |||
| 23 | if(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() | ||
| 33 | endif() | ||
| 34 | |||
| 35 | mark_as_advanced(AMLCODEC_INCLUDE_DIR) | ||
