cmake: Add modules for curl and alsa
Older versions of cmake (e.g. in Ubuntu 18.04) did not provide cmake modules for these libraries that also created a target. Fixes #2393
This commit is contained in:
parent
3f03b671bb
commit
43d754bd1d
@ -50,12 +50,10 @@ find_package(CairoFC REQUIRED)
|
||||
|
||||
if (ENABLE_ALSA)
|
||||
find_package(ALSA REQUIRED)
|
||||
set(ALSA_VERSION ${ALSA_VERSION_STRING})
|
||||
endif()
|
||||
|
||||
if (ENABLE_CURL)
|
||||
find_package(CURL REQUIRED)
|
||||
set(CURL_VERSION ${CURL_VERSION_STRING})
|
||||
endif()
|
||||
|
||||
if (ENABLE_MPD)
|
||||
|
14
cmake/modules/FindALSA.cmake
Normal file
14
cmake/modules/FindALSA.cmake
Normal file
@ -0,0 +1,14 @@
|
||||
# This module defines an imported target `ALSA::ALSA` if alsa is found
|
||||
#
|
||||
# Defines the following Variables (see find_package_impl for more info):
|
||||
# ALSA_FOUND
|
||||
# ALSA_INCLUDE_DIR
|
||||
# ALSA_INCLUDE_DIRS
|
||||
# ALSA_LIBRARY
|
||||
# ALSA_LIBRARIES
|
||||
# ALSA_VERSION
|
||||
find_package_impl("alsa" "ALSA" "alsa/asoundlib.h")
|
||||
|
||||
if(ALSA_FOUND AND NOT TARGET ALSA::ALSA)
|
||||
create_imported_target("ALSA::ALSA" "${ALSA_INCLUDE_DIR}" "${ALSA_LIBRARY}")
|
||||
endif()
|
14
cmake/modules/FindCURL.cmake
Normal file
14
cmake/modules/FindCURL.cmake
Normal file
@ -0,0 +1,14 @@
|
||||
# This module defines an imported target `CURL::libcurl` if libcurl is found
|
||||
#
|
||||
# Defines the following Variables (see find_package_impl for more info):
|
||||
# CURL_FOUND
|
||||
# CURL_INCLUDE_DIR
|
||||
# CURL_INCLUDE_DIRS
|
||||
# CURL_LIBRARY
|
||||
# CURL_LIBRARIES
|
||||
# CURL_VERSION
|
||||
find_package_impl("libcurl" "CURL" "curl/curl.h")
|
||||
|
||||
if(CURL_FOUND AND NOT TARGET CURL::libcurl)
|
||||
create_imported_target("CURL::libcurl" "${CURL_INCLUDE_DIR}" "${CURL_LIBRARY}")
|
||||
endif()
|
Loading…
Reference in New Issue
Block a user