summaryrefslogtreecommitdiff
path: root/Modules/FindALSA.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2018-05-28 15:47:23 +0200
committerRolf Eike Beer <eike@sf-mail.de>2018-05-31 09:35:53 +0200
commit1c87844856f7995bccc30c32567540be948f80da (patch)
treed8d299419429ea419c060700a7e8086ede830652 /Modules/FindALSA.cmake
parent0b32ae944fe058883c65532b353a709980eabe6d (diff)
downloadcmake-1c87844856f7995bccc30c32567540be948f80da.tar.gz
FindALSA: provide an imported target
Diffstat (limited to 'Modules/FindALSA.cmake')
-rw-r--r--Modules/FindALSA.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index fa9a43438b..84b6ec56de 100644
--- a/Modules/FindALSA.cmake
+++ b/Modules/FindALSA.cmake
@@ -9,6 +9,15 @@
#
# Find the alsa libraries (asound)
#
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines :prop_tgt:`IMPORTED` target ``ALSA::ALSA``, if
+# ALSA has been found.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
# ::
#
# This module defines the following variables:
@@ -47,6 +56,11 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA
if(ALSA_FOUND)
set( ALSA_LIBRARIES ${ALSA_LIBRARY} )
set( ALSA_INCLUDE_DIRS ${ALSA_INCLUDE_DIR} )
+ if(NOT TARGET ALSA::ALSA)
+ add_library(ALSA::ALSA UNKNOWN IMPORTED)
+ set_target_properties(ALSA::ALSA PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ALSA_INCLUDE_DIRS}")
+ set_property(TARGET ALSA::ALSA APPEND PROPERTY IMPORTED_LOCATION "${ALSA_LIBRARY}")
+ endif()
endif()
mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY)