From 9fc8b732737f139d3e466510d75668ab45578960 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 8 Mar 2016 21:02:53 +0100 Subject: sync with upstream --- project/cmake/modules/FindAML.cmake | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 project/cmake/modules/FindAML.cmake (limited to 'project/cmake/modules/FindAML.cmake') 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 @@ +#.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