2014-10-03 02:24:00 +08:00
|
|
|
#
|
|
|
|
# Try to find FLAC libraries and include paths.
|
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# FLAC_FOUND
|
|
|
|
# FLAC_INCLUDE_DIR
|
|
|
|
# FLAC_LIBRARY
|
|
|
|
#
|
|
|
|
|
2014-10-07 15:35:46 +08:00
|
|
|
find_path(FLAC_INCLUDE_DIR FLAC/all.h)
|
|
|
|
find_path(FLAC_INCLUDE_DIR FLAC/stream_decoder.h)
|
2014-10-03 02:24:00 +08:00
|
|
|
|
2014-10-07 15:35:46 +08:00
|
|
|
find_library(FLAC_LIBRARY NAMES FLAC)
|
2014-10-03 02:24:00 +08:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(FLAC DEFAULT_MSG FLAC_LIBRARY FLAC_INCLUDE_DIR)
|
2015-02-25 17:46:37 +08:00
|
|
|
|
|
|
|
mark_as_advanced(FLAC_INCLUDE_DIR FLAC_LIBRARY)
|
2023-08-27 03:30:05 +08:00
|
|
|
|
|
|
|
add_library(FLAC::FLAC IMPORTED UNKNOWN)
|
|
|
|
set_target_properties(FLAC::FLAC PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${FLAC_INCLUDE_DIR})
|
|
|
|
if(FLAC_LIBRARY MATCHES "/([^/]+)\\.framework$")
|
|
|
|
set_target_properties(FLAC::FLAC PROPERTIES IMPORTED_LOCATION ${FLAC_LIBRARY}/${CMAKE_MATCH_1})
|
|
|
|
else()
|
|
|
|
set_target_properties(FLAC::FLAC PROPERTIES IMPORTED_LOCATION ${FLAC_LIBRARY})
|
|
|
|
endif()
|