mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 19:02:48 +00:00

using pkg-config search as primary method with fallback to path lookup, this may result in overlinking however if libraries require additional include paths (as is the case with PulseAudio) with this change that will not be a problem. it will also reduce the lookups done during configuration/build since path lookups will not be done, unless pkg-config lookup does not set the required variables. Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
43 lines
1.1 KiB
CMake
43 lines
1.1 KiB
CMake
# - Try to find the FLAC++ library
|
|
#
|
|
# Once done this will define
|
|
#
|
|
# FLAC_FOUND - system has FLAC++
|
|
# FLAC_INCLUDES - the FLAC++ include directory
|
|
# FLAC_LIBRARIES - Link these to use FLAC++
|
|
# FLAC_DEFINITIONS - Compiler switches required for using FLAC++
|
|
#
|
|
# Copyright (c) 2019-2020, Ivailo Monev, <xakepa10@gmail.com>
|
|
#
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
if(NOT WIN32)
|
|
find_package(PkgConfig)
|
|
pkg_check_modules(PC_FLAC QUIET flac++)
|
|
|
|
set(FLAC_INCLUDES ${PC_FLAC_INCLUDE_DIRS})
|
|
set(FLAC_LIBRARIES ${PC_FLAC_LIBRARIES})
|
|
endif()
|
|
|
|
set(FLAC_DEFINITIONS ${PC_FLAC_CFLAGS_OTHER})
|
|
|
|
if(NOT FLAC_LIBRARIES OR NOT FLAC_INCLUDES)
|
|
find_path(FLAC_INCLUDES
|
|
NAMES FLAC++/metadata.h
|
|
HINTS $ENV{FLACPPDIR}/include
|
|
)
|
|
|
|
find_library(FLAC_LIBRARIES
|
|
NAMES FLAC++
|
|
HINTS $ENV{FLACPPDIR}/lib
|
|
)
|
|
endif()
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(FLAC++
|
|
VERSION_VAR PC_FLAC_VERSION
|
|
REQUIRED_VARS FLAC_INCLUDES FLAC_LIBRARIES
|
|
)
|
|
|
|
mark_as_advanced(FLAC_INCLUDES FLAC_LIBRARIES)
|