forked from EmbeddedSynth/sonivox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsonivox-config.cmake.in
More file actions
67 lines (60 loc) · 2.11 KB
/
sonivox-config.cmake.in
File metadata and controls
67 lines (60 loc) · 2.11 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
set(SONIVOX_WANTS_ZLIB @ZLIB_FOUND@)
if (UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
find_library(HAVE_LIBM NAMES "m" NO_CACHE)
endif()
if (SONIVOX_WANTS_ZLIB)
find_dependency(ZLIB)
endif()
set(sonivox_known_comps static shared)
set(sonivox_comp_static NO)
set(sonivox_comp_shared NO)
foreach (sonivox_comp IN LISTS ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
if (sonivox_comp IN_LIST sonivox_known_comps)
set(sonivox_comp_${sonivox_comp} YES)
else ()
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"sonivox does not recognize component `${sonivox_comp}`.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif ()
endforeach ()
if (sonivox_comp_static AND sonivox_comp_shared)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"sonivox `static` and `shared` components are mutually exclusive.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif ()
set(sonivox_static_targets "${CMAKE_CURRENT_LIST_DIR}/sonivox-static-targets.cmake")
set(sonivox_shared_targets "${CMAKE_CURRENT_LIST_DIR}/sonivox-shared-targets.cmake")
macro(sonivox_load_targets type)
if (NOT EXISTS "${sonivox_${type}_targets}")
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"sonivox `${type}` libraries were requested but not found.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif ()
include("${sonivox_${type}_targets}")
endmacro()
if (sonivox_comp_static)
sonivox_load_targets(static)
elseif (sonivox_comp_shared)
sonivox_load_targets(shared)
elseif (DEFINED sonivox_SHARED_LIBS AND sonivox_SHARED_LIBS)
sonivox_load_targets(shared)
elseif (DEFINED sonivox_SHARED_LIBS AND NOT sonivox_SHARED_LIBS)
sonivox_load_targets(static)
elseif (BUILD_SHARED_LIBS)
if (EXISTS "${sonivox_shared_targets}")
sonivox_load_targets(shared)
else ()
sonivox_load_targets(static)
endif ()
else ()
if (EXISTS "${sonivox_static_targets}")
sonivox_load_targets(static)
else ()
sonivox_load_targets(shared)
endif ()
endif ()