From f44ecaa4f27e7538ddcad66d40e543bffa2d2d86 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 4 Jun 2017 16:57:49 +0200 Subject: sync with upstream --- cmake/modules/FindAML.cmake | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 cmake/modules/FindAML.cmake (limited to 'cmake/modules/FindAML.cmake') 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 @@ +#.rst: +# FindAML +# ------- +# Finds the AML codec +# +# This will will define the following variables:: +# +# AML_FOUND - system has AML +# AML_INCLUDE_DIRS - the AML include directory +# AML_DEFINITIONS - the AML definitions +# +# and the following imported targets:: +# +# AML::AML - The AML codec + +find_path(AML_INCLUDE_DIR codec_error.h + PATH_SUFFIXES amcodec) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(AML + REQUIRED_VARS AML_INCLUDE_DIR) + +if(AML_FOUND) + set(AML_INCLUDE_DIRS ${AML_INCLUDE_DIR}) + set(AML_DEFINITIONS -DHAS_LIBAMCODEC=1) + + if(NOT TARGET AML::AML) + add_library(AML::AML UNKNOWN IMPORTED) + set_target_properties(AML::AML PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${AML_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAS_LIBAMCODEC=1) + endif() +endif() + +mark_as_advanced(AMLCODEC_INCLUDE_DIR) -- cgit v1.2.3