forked from nativeformat/NFDriver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·112 lines (105 loc) · 2.91 KB
/
CMakeLists.txt
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Copyright (c) 2018 Spotify AB.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
set(SOURCE_FILES
../include/NFDriver/NFDriver.h
NFDriverAdapter.h
NFDriverAdapter.cpp
NFDriver.cpp
NFDriverFileImplementation.h
NFDriverFileImplementation.cpp)
set(LINK_LIBRARIES)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT ANDROID)
list(APPEND
SOURCE_FILES
NFDriver_Linux.cpp
NFDriverFileMP3Implementation.h
NFDriverFileMP3Implementation.cpp)
find_package(ALSA REQUIRED)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
list(APPEND
LINK_LIBRARIES
${ALSA_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS})
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT IOS AND NOT ANDROID)
list(APPEND
SOURCE_FILES
NFDriver_MacOSX.cpp
NFDriverFileMP3Implementation.h
NFDriverFileMP3Implementation.cpp
NFDriverFileAACImplementation.h
NFDriverFileAACImplementation.cpp)
find_library(AUDIO_UNIT AudioUnit)
find_library(CORE_AUDIO CoreAudio)
find_library(AUDIO_TOOLBOX AudioToolbox)
find_library(CORE_FOUNDATION CoreFoundation)
list(APPEND
LINK_LIBRARIES
${AUDIO_UNIT}
${CORE_AUDIO}
${AUDIO_TOOLBOX}
${CORE_FOUNDATION})
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND IOS AND NOT ANDROID)
list(APPEND
SOURCE_FILES
NFDriver_iOS.mm
NFDriverFileAACImplementation.h
NFDriverFileAACImplementation.cpp)
find_library(AVFOUNDATION AVFoundation)
find_library(CORE_AUDIO CoreAudio)
find_library(AUDIO_TOOLBOX AudioToolbox)
list(APPEND
LINK_LIBRARIES
${AVFOUNDATION}
${CORE_AUDIO}
${AUDIO_TOOLBOX})
endif()
if(WIN32 AND NOT ANDROID)
list(APPEND
SOURCE_FILES
NFDriver_Windows.cpp)
list(APPEND
LINK_LIBRARIES
dxva2.lib
evr.lib
mf.lib
mfplat.lib
mfplay.lib
mfreadwrite.lib
mfuuid.lib
mmdevapi.lib)
endif()
if(ANDROID)
list(APPEND
SOURCE_FILES
NFDriver_Android.cpp)
endif()
add_library(NFDriver STATIC ${SOURCE_FILES})
target_include_directories(NFDriver
PUBLIC
../include
${CMAKE_BINARY_DIR}/output
../libraries/lame/include)
target_link_libraries(NFDriver ${LINK_LIBRARIES})
if(NOT ANDROID)
add_subdirectory(cli)
endif()