summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2018-05-28 13:47:23 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2018-05-31 07:35:53 (GMT)
commit1c87844856f7995bccc30c32567540be948f80da (patch)
treed8d299419429ea419c060700a7e8086ede830652
parent0b32ae944fe058883c65532b353a709980eabe6d (diff)
downloadCMake-1c87844856f7995bccc30c32567540be948f80da.zip
CMake-1c87844856f7995bccc30c32567540be948f80da.tar.gz
CMake-1c87844856f7995bccc30c32567540be948f80da.tar.bz2
FindALSA: provide an imported target
-rw-r--r--Help/release/dev/alsa-target.rst4
-rw-r--r--Modules/FindALSA.cmake14
2 files changed, 18 insertions, 0 deletions
diff --git a/Help/release/dev/alsa-target.rst b/Help/release/dev/alsa-target.rst
new file mode 100644
index 0000000..e970580
--- /dev/null
+++ b/Help/release/dev/alsa-target.rst
@@ -0,0 +1,4 @@
+alsa-target
+-----------
+
+* The :module:`FindALSA` module now provides imported targets.
diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index fa9a434..84b6ec5 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)