-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCMakeLists.txt
158 lines (133 loc) · 3.94 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
cmake_minimum_required(VERSION 3.5)
project(LinkKit LANGUAGES C CXX Swift)
if(NOT DEFINED LINK_DIR)
message(FATAL_ERROR "LINK_DIR must be defined!")
endif()
# ___ _ _
# / _ \ _ __ | |_(_) ___ _ __ ___
# | | | | '_ \| __| |/ _ \| '_ \/ __|
# | |_| | |_) | |_| | (_) | | | \__ \
# \___/| .__/ \__|_|\___/|_| |_|___/
# |_|
add_subdirectory(${LINK_DIR}/include ${CMAKE_BINARY_DIR}/link)
include_directories(LinkKit)
include_directories(${LINK_DIR}/include)
include_directories(${LINK_DIR}/modules/asio-standalone/asio/include)
add_definitions("-DLINK_PLATFORM_MACOSX=1")
set(CMAKE_OSX_SYSROOT "iphoneos")
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator,-macosx")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# ____
# / ___| ___ _ _ _ __ ___ ___ ___
# \___ \ / _ \| | | | '__/ __/ _ \/ __|
# ___) | (_) | |_| | | | (_| __/\__ \
# |____/ \___/ \__,_|_| \___\___||___/
#
set(link_kit_DIR ${CMAKE_CURRENT_SOURCE_DIR}/LinkKit)
set(link_kit_SOURCES
${link_kit_DIR}/ABLLink.h
${link_kit_DIR}/ABLLink.mm
${link_kit_DIR}/ABLLinkSettingsViewController.h
${link_kit_DIR}/ABLLinkSettingsViewController.mm
${link_kit_DIR}/ABLLinkUtils.h
${link_kit_DIR}/detail/ABLLinkAggregate.h
${link_kit_DIR}/detail/ABLNotificationView.h
${link_kit_DIR}/detail/ABLNotificationView.mm
${link_kit_DIR}/detail/ABLObjCUtils.h
${link_kit_DIR}/detail/ABLSettingsViewController.h
${link_kit_DIR}/detail/ABLSettingsViewController.mm
${link_kit_DIR}/detail/LocalizableString.h
${link_kit_DIR}/detail/LocalizableString.mm
)
set(link_hut_DIR ${CMAKE_CURRENT_SOURCE_DIR}/examples/LinkHut/LinkHut)
set(link_hut_SOURCES
${link_hut_DIR}/AudioEngine.h
${link_hut_DIR}/AudioEngine.m
${link_hut_DIR}/AudioEngineController.swift
${link_hut_DIR}/ContentView.swift
${link_hut_DIR}/LinkHutApp.swift
${link_hut_DIR}/LinkHut-Bridging-Header.h
)
set(
link_hut_RESOURCES
${link_hut_DIR}/Assets.xcassets
${link_kit_DIR}/LinkKitResources.bundle
)
set(
link_hut_BRIDGING_HEADER
"${link_hut_DIR}/LinkHut-Bridging-Header.h"
)
set(
link_hut_PLIST
${link_hut_DIR}/Info.plist
)
set(
link_hut_ENTITLEMENTS
${link_hut_DIR}/LinkHut.entitlements
)
# _ _ _ _ ___ _
# | | (_)_ __ | | _| |/ (_) |_
# | | | | '_ \| |/ / ' /| | __|
# | |___| | | | | <| . \| | |_
# |_____|_|_| |_|_|\_\_|\_\_|\__|
#
add_library(LinkKit STATIC
${link_HEADERS}
${link_kit_SOURCES}
)
target_link_libraries(
LinkKit
"-framework UIKit"
"-framework CoreText"
)
set_target_properties(
LinkKit
PROPERTIES
XCODE_ATTRIBUTE_ARCHS "$(ARCHS_STANDARD)"
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "12.0"
XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode
XCODE_ATTRIBUTE_SUPPORTS_UIKITFORMAC "YES"
)
# _ _ _ _ _ _
# | | (_)_ __ | | _| | | |_ _| |_
# | | | | '_ \| |/ / |_| | | | | __|
# | |___| | | | | <| _ | |_| | |_
# |_____|_|_| |_|_|\_\_| |_|\__,_|\__|
#
add_executable(
LinkHut
${link_hut_SOURCES}
${link_hut_BRIDGING_HEADER}
${link_hut_RESOURCES}
)
add_dependencies(
LinkHut
LinkKit
)
target_link_libraries(
LinkHut
LinkKit
"-framework UIKit"
"-framework AVFoundation"
"-framework AudioToolbox"
"-framework CoreText"
"-framework CoreGraphics"
)
set_target_properties(
LinkHut
PROPERTIES
MACOSX_BUNDLE YES
MACOSX_BUNDLE_INFO_PLIST "${link_hut_PLIST}"
RESOURCE "${link_hut_RESOURCES}"
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon"
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${link_hut_ENTITLEMENTS}"
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "15.0"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.ableton.linkhut"
XCODE_ATTRIBUTE_SUPPORTS_UIKITFORMAC "YES"
XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER "${link_hut_BRIDGING_HEADER}"
XCODE_ATTRIBUTE_SWIFT_OPTIMIZATION_LEVEL "-Onone"
XCODE_ATTRIBUTE_SWIFT_VERSION "5.0"
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2"
)