blob: 908d7efeb316fcd16622b5c7f8c2bb254a0974f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
https://github.com/audacity/audacity/pull/4916
https://github.com/audacity/audacity/pull/4917
From b42dfbe2be1994ccfeff449b5c5cbe49994ffb38 Mon Sep 17 00:00:00 2001
From: Matthew White <mehw.is.me@inventati.org>
Date: Fri, 14 Jul 2023 21:17:45 +0000
Subject: [PATCH] Add missing Findlibmad.cmake file
This fixes compiling against the system installed libmad.
--- /dev/null
+++ b/cmake-proxies/cmake-modules/Findlibmad.cmake
@@ -0,0 +1,35 @@
+#[[
+A module to look for libmad
+]]
+
+if( NOT libmad_FOUND )
+ find_path( libmad_INCLUDE_DIR mad.h )
+ find_library( libmad_LIBRARIES NAMES mad )
+
+ if( libmad_INCLUDE_DIR AND libmad_LIBRARIES )
+ set( libmad_FOUND Yes )
+ endif()
+
+ if( libmad_FOUND )
+ if( NOT libmad_FIND_QUIETLY )
+ message( STATUS "Found mad: \n\tlibmad_INCLUDE_DIR: ${libmad_INCLUDE_DIR}\n\tlibmad_LIBRARIES: ${libmad_LIBRARIES}" )
+ endif()
+
+ if( NOT TARGET libmad::libmad )
+ add_library( libmad::libmad INTERFACE IMPORTED GLOBAL)
+
+ target_include_directories( libmad::libmad INTERFACE ${libmad_INCLUDE_DIR} )
+ target_link_libraries( libmad::libmad INTERFACE ${libmad_LIBRARIES} )
+ endif()
+ else()
+ if( libmad_FIND_REQUIRED )
+ message( FATAL_ERROR "Could not find libmad")
+ endif()
+ endif()
+
+ mark_as_advanced(
+ libmad_FOUND
+ libmad_INCLUDE_DIR
+ libmad_LIBRARIES
+ )
+endif()
|