質問編集履歴
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,6 +12,308 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
+
追記:CMakeLists.txtの中身です。
|
16
|
+
|
17
|
+
```ここに言語を入力
|
18
|
+
|
19
|
+
#/****************************************************************************
|
20
|
+
|
21
|
+
# Copyright (c) 2013-2014 cocos2d-x.org
|
22
|
+
|
23
|
+
# Copyright (c) 2015-2017 Chukong Technologies Inc.
|
24
|
+
|
25
|
+
#
|
26
|
+
|
27
|
+
# http://www.cocos2d-x.org
|
28
|
+
|
29
|
+
#
|
30
|
+
|
31
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
32
|
+
|
33
|
+
# of this software and associated documentation files (the "Software"), to deal
|
34
|
+
|
35
|
+
# in the Software without restriction, including without limitation the rights
|
36
|
+
|
37
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
38
|
+
|
39
|
+
# copies of the Software, and to permit persons to whom the Software is
|
40
|
+
|
41
|
+
# furnished to do so, subject to the following conditions:
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
# The above copyright notice and this permission notice shall be included in
|
46
|
+
|
47
|
+
# all copies or substantial portions of the Software.
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
52
|
+
|
53
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
54
|
+
|
55
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
56
|
+
|
57
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
58
|
+
|
59
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
60
|
+
|
61
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
62
|
+
|
63
|
+
# THE SOFTWARE.
|
64
|
+
|
65
|
+
# ****************************************************************************/
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
cmake_minimum_required(VERSION 3.6)
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
set(APP_NAME MyApp1)
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
project(${APP_NAME})
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cocos2d)
|
82
|
+
|
83
|
+
set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/)
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
include(CocosBuildSet)
|
88
|
+
|
89
|
+
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
# record sources, headers, resources...
|
94
|
+
|
95
|
+
set(GAME_SOURCE)
|
96
|
+
|
97
|
+
set(GAME_HEADER)
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
set(GAME_RES_FOLDER
|
102
|
+
|
103
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/Resources"
|
104
|
+
|
105
|
+
)
|
106
|
+
|
107
|
+
if(APPLE OR WINDOWS)
|
108
|
+
|
109
|
+
cocos_mark_multi_resources(common_res_files RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER})
|
110
|
+
|
111
|
+
endif()
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
# add cross-platforms source files and header files
|
116
|
+
|
117
|
+
list(APPEND GAME_SOURCE
|
118
|
+
|
119
|
+
Classes/AppDelegate.cpp
|
120
|
+
|
121
|
+
Classes/HelloWorldScene.cpp
|
122
|
+
|
123
|
+
)
|
124
|
+
|
125
|
+
list(APPEND GAME_HEADER
|
126
|
+
|
127
|
+
Classes/AppDelegate.h
|
128
|
+
|
129
|
+
Classes/HelloWorldScene.h
|
130
|
+
|
131
|
+
)
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
if(ANDROID)
|
136
|
+
|
137
|
+
# change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml
|
138
|
+
|
139
|
+
set(APP_NAME MyGame)
|
140
|
+
|
141
|
+
list(APPEND GAME_SOURCE
|
142
|
+
|
143
|
+
proj.android/app/jni/hellocpp/main.cpp
|
144
|
+
|
145
|
+
)
|
146
|
+
|
147
|
+
elseif(LINUX)
|
148
|
+
|
149
|
+
list(APPEND GAME_SOURCE
|
150
|
+
|
151
|
+
proj.linux/main.cpp
|
152
|
+
|
153
|
+
)
|
154
|
+
|
155
|
+
elseif(WINDOWS)
|
156
|
+
|
157
|
+
list(APPEND GAME_HEADER
|
158
|
+
|
159
|
+
proj.win32/main.h
|
160
|
+
|
161
|
+
proj.win32/resource.h
|
162
|
+
|
163
|
+
)
|
164
|
+
|
165
|
+
list(APPEND GAME_SOURCE
|
166
|
+
|
167
|
+
proj.win32/main.cpp
|
168
|
+
|
169
|
+
proj.win32/game.rc
|
170
|
+
|
171
|
+
${common_res_files}
|
172
|
+
|
173
|
+
)
|
174
|
+
|
175
|
+
elseif(APPLE)
|
176
|
+
|
177
|
+
if(IOS)
|
178
|
+
|
179
|
+
list(APPEND GAME_HEADER
|
180
|
+
|
181
|
+
proj.ios_mac/ios/AppController.h
|
182
|
+
|
183
|
+
proj.ios_mac/ios/RootViewController.h
|
184
|
+
|
185
|
+
)
|
186
|
+
|
187
|
+
set(APP_UI_RES
|
188
|
+
|
189
|
+
proj.ios_mac/ios/LaunchScreen.storyboard
|
190
|
+
|
191
|
+
proj.ios_mac/ios/LaunchScreenBackground.png
|
192
|
+
|
193
|
+
proj.ios_mac/ios/Images.xcassets
|
194
|
+
|
195
|
+
)
|
196
|
+
|
197
|
+
list(APPEND GAME_SOURCE
|
198
|
+
|
199
|
+
proj.ios_mac/ios/main.m
|
200
|
+
|
201
|
+
proj.ios_mac/ios/AppController.mm
|
202
|
+
|
203
|
+
proj.ios_mac/ios/RootViewController.mm
|
204
|
+
|
205
|
+
proj.ios_mac/ios/Prefix.pch
|
206
|
+
|
207
|
+
${APP_UI_RES}
|
208
|
+
|
209
|
+
)
|
210
|
+
|
211
|
+
elseif(MACOSX)
|
212
|
+
|
213
|
+
set(APP_UI_RES
|
214
|
+
|
215
|
+
proj.ios_mac/mac/Icon.icns
|
216
|
+
|
217
|
+
proj.ios_mac/mac/Info.plist
|
218
|
+
|
219
|
+
)
|
220
|
+
|
221
|
+
list(APPEND GAME_SOURCE
|
222
|
+
|
223
|
+
proj.ios_mac/mac/main.cpp
|
224
|
+
|
225
|
+
proj.ios_mac/mac/Prefix.pch
|
226
|
+
|
227
|
+
${APP_UI_RES}
|
228
|
+
|
229
|
+
)
|
230
|
+
|
231
|
+
endif()
|
232
|
+
|
233
|
+
list(APPEND GAME_SOURCE ${common_res_files})
|
234
|
+
|
235
|
+
endif()
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
# mark app complie info and libs info
|
240
|
+
|
241
|
+
set(all_code_files
|
242
|
+
|
243
|
+
${GAME_HEADER}
|
244
|
+
|
245
|
+
${GAME_SOURCE}
|
246
|
+
|
247
|
+
)
|
248
|
+
|
249
|
+
if(NOT ANDROID)
|
250
|
+
|
251
|
+
add_executable(${APP_NAME} ${all_code_files})
|
252
|
+
|
253
|
+
else()
|
254
|
+
|
255
|
+
add_library(${APP_NAME} SHARED ${all_code_files})
|
256
|
+
|
257
|
+
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/platform)
|
258
|
+
|
259
|
+
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
|
260
|
+
|
261
|
+
endif()
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
target_link_libraries(${APP_NAME} cocos2d)
|
266
|
+
|
267
|
+
target_include_directories(${APP_NAME}
|
268
|
+
|
269
|
+
PRIVATE Classes
|
270
|
+
|
271
|
+
PRIVATE ${COCOS2DX_ROOT_PATH}/cocos/audio/include/
|
272
|
+
|
273
|
+
)
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
# mark app resources
|
278
|
+
|
279
|
+
setup_cocos_app_config(${APP_NAME})
|
280
|
+
|
281
|
+
if(APPLE)
|
282
|
+
|
283
|
+
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
|
284
|
+
|
285
|
+
if(MACOSX)
|
286
|
+
|
287
|
+
set_target_properties(${APP_NAME} PROPERTIES
|
288
|
+
|
289
|
+
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist"
|
290
|
+
|
291
|
+
)
|
292
|
+
|
293
|
+
elseif(IOS)
|
294
|
+
|
295
|
+
cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
|
296
|
+
|
297
|
+
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
|
298
|
+
|
299
|
+
endif()
|
300
|
+
|
301
|
+
elseif(WINDOWS)
|
302
|
+
|
303
|
+
cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}/..)
|
304
|
+
|
305
|
+
endif()
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
if(LINUX OR WINDOWS)
|
310
|
+
|
311
|
+
cocos_copy_res(COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
|
312
|
+
|
313
|
+
endif()
|
314
|
+
|
315
|
+
```
|
316
|
+
|
15
317
|
### 補足情報(FW/ツールのバージョンなど)
|
16
318
|
|
17
319
|
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,10 +7,6 @@
|
|
7
7
|

|
8
8
|
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
Configure project:MyApp1
|
14
10
|
|
15
11
|
いくら調べても解決方法が見つからず、困っています。エラーの原因がわかる方がいれば、ご教授願います。
|
16
12
|
|