-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
87 lines (68 loc) · 1.82 KB
/
Copy pathCMakeLists.txt
File metadata and controls
87 lines (68 loc) · 1.82 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
cmake_minimum_required(VERSION 3.16)
project(dec_g711_ulaw_file)
set (target dec_g711_ulaw_file)
add_executable(${target})
# Operating System
string(TOLOWER ${CMAKE_SYSTEM_NAME} OS)
# output
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../../../bin/${PLATFORM})
if (CMAKE_GENERATOR STREQUAL "Xcode")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../../../bin)
endif()
# debug definitions
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(${target} PUBLIC _DEBUG)
endif()
# release definitions
if (CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_definitions(${target} PUBLIC NDEBUG)
endif()
# macOS
if(OS STREQUAL "darwin")
# common compile options
target_compile_options(${target} PRIVATE -std=c++17 -stdlib=libc++)
# x64 compile options
if (PLATFORM STREQUAL "x64")
target_compile_options(${target} PRIVATE -m64 -fPIC)
endif()
# x86 compile options
if (PLATFORM STREQUAL "x86")
target_compile_options(${target} PRIVATE -m32)
endif()
# debug compile options
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(${target} PRIVATE -g)
endif()
# release compile options
if (CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_options(${target} PRIVATE -Os)
endif()
endif()
# include dirs
target_include_directories(${target}
PUBLIC
../../../sdk/include
)
# sources
file(GLOB source "./*.cpp" "./*.mm")
target_sources(${target}
PRIVATE
${source}
)
# lib dirs
target_link_directories(${target}
PRIVATE
# avblocks
${PROJECT_SOURCE_DIR}/../../../sdk/lib/${PLATFORM}
)
# libs
if (OS STREQUAL "darwin")
target_link_libraries(
${target}
# primo-avblocks
libAVBlocks.dylib
# os
"-framework CoreFoundation"
"-framework AppKit"
)
endif()