cmake add collect headers list, unify the logic of source add (#18722)

* fix mistake for ios lua template

* auto select headers depend on sources

* change cmake "cocos_build_app" from macro to function

* fix cmake dll repeat copy

* update travis srcipt

* add header list for cocos lib

* add header list in cmake files

* re-add include dir Classes

* improve template cpp var name

* remove func get_headers_by_sources

* cmake add simulator header list

* make source and header collect more clear

* improve macos app pkg

* improve ios pkg, run failed

* revert the ios pak logic, keep older

* expand var APP_BIN_DIR scope

* fix use sqlite3 error on linux

* fix win32 compile error

* remove multi-add mistake

* try to fix python install issue on travis

* fix js-tests build on android

* uninstall old python in travis

* add travis  python print info

* fix command ll to ls -l

* remove useless link

* PYTHON_BIN adapt homebrew python
This commit is contained in:
leda 2018-03-14 13:51:29 +08:00 committed by minggo
parent d32f33056f
commit 86ea3a8aee
44 changed files with 1999 additions and 599 deletions

View File

@ -41,7 +41,7 @@ CocosBuildSet()
# default tests include lua, js test project, so we set those option on to build libs
set(BUILD_LUA_LIBS ON)
set(BUILD_JS_LIBS ON)
set(USE_SIMULATOR ON)
set(BUILD_SIMU_LIB ON)
if(NOT USE_COCOS_PREBUILT)
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)

View File

@ -51,8 +51,9 @@ function(cocos_mark_multi_resources res_out)
set(tmp_file_list)
foreach(cc_file ${opt_FILES})
get_filename_component(file_dir ${cc_file} DIRECTORY)
cocos_mark_resources(FILES ${cc_file} BASEDIR ${file_dir} RESOURCEBASE ${opt_RES_TO})
get_filename_component(cc_file_abs ${cc_file} ABSOLUTE)
get_filename_component(file_dir ${cc_file_abs} DIRECTORY)
cocos_mark_resources(FILES ${cc_file_abs} BASEDIR ${file_dir} RESOURCEBASE ${opt_RES_TO})
endforeach()
list(APPEND tmp_file_list ${opt_FILES})
@ -109,7 +110,7 @@ function(cocos_copy_target_dll cocos_target)
foreach(single_target_dll ${all_depend_dlls} )
add_custom_command(TARGET ${cocos_target} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${all_depend_dlls}
${single_target_dll}
${opt_COPY_TO}
)
endforeach(single_target_dll)
@ -169,27 +170,33 @@ function(cocos_mark_code_files cocos_target)
endif()
message(STATUS "cocos_mark_code_files: ${cocos_target}")
set(group_base "Source Files")
get_property(file_list TARGET ${cocos_target} PROPERTY SOURCES)
foreach(single_file ${file_list})
# get relative_path
get_filename_component(abs_path ${single_file} ABSOLUTE)
file(RELATIVE_PATH relative_path_with_name ${root_dir} ${abs_path})
get_filename_component(relative_path ${relative_path_with_name} PATH)
# set source_group, consider sub source group
string(REPLACE "/" "\\" ide_file_group "${group_base}/${relative_path}")
source_group("${ide_file_group}" FILES ${single_file})
source_group_single_file(${single_file} GROUP_TO "Source Files" BASE_PATH "${root_dir}")
endforeach()
endfunction()
# source group one file
# cut the `single_file` absolute path from `BASE_PATH`, then mark file to `GROUP_TO`
function(source_group_single_file single_file)
set(oneValueArgs GROUP_TO BASE_PATH)
cmake_parse_arguments(opt "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# get relative_path
get_filename_component(abs_path ${single_file} ABSOLUTE)
file(RELATIVE_PATH relative_path_with_name ${opt_BASE_PATH} ${abs_path})
get_filename_component(relative_path ${relative_path_with_name} PATH)
# set source_group, consider sub source group
string(REPLACE "/" "\\" ide_file_group "${opt_GROUP_TO}/${relative_path}")
source_group("${ide_file_group}" FILES ${single_file})
endfunction()
# build a cocos application
# hrough compile the files `APP_SRC`, link the libs in `*LIBS`, use the packages in `*.PKGS`
# this method hide the link lib details, those is prebuilt libs or not
macro(cocos_build_app app_name)
function(cocos_build_app app_name)
set(multiValueArgs
APP_SRC
DEPEND_COMMON_LIBS
@ -200,7 +207,7 @@ macro(cocos_build_app app_name)
DEPEND_WINDOWS_LIBS
)
cmake_parse_arguments(opt "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(ANDROID)
add_library(${app_name} SHARED ${opt_APP_SRC})
foreach(android_lib ${opt_DEPEND_ANDROID_LIBS})
@ -274,7 +281,10 @@ macro(cocos_build_app app_name)
if(GEN_COCOS_PREBUILT)
add_dependencies(${APP_NAME} prebuilt)
endif()
endmacro()
set(APP_BIN_DIR ${APP_BIN_DIR} PARENT_SCOPE)
set(APP_RES_DIR ${APP_RES_DIR} PARENT_SCOPE)
endfunction()
# if cc_variable not set, then set it cc_value
macro(cocos_fake_set cc_variable cc_value)
@ -325,11 +335,10 @@ macro(cocos_pak_xcode cocos_target)
message("cocos package: ${cocos_target}, plist file: ${COCOS_APP_INFO_PLIST}")
endmacro()
# This little macro lets you set any XCode specific property, from ios.toolchain.cmake
macro (set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE)
function(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE)
set_property (TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE})
endmacro (set_xcode_property)
endfunction(set_xcode_property)
# works same as find_package, but do additional care to properly find
macro(cocos_find_package pkg_name pkg_prefix)

View File

@ -15,7 +15,7 @@ macro(cocos2d_depend_libs)
elseif(LINUX)
# need review those libs: X11 Xi Xrandr Xxf86vm Xinerama Xcursor rt m
list(APPEND PLATFORM_SPECIFIC_LIBS dl X11 Xi Xrandr Xxf86vm Xinerama Xcursor rt m)
foreach(_pkg OPENGL GLEW GLFW3 FMOD FONTCONFIG THREADS GTK3)
foreach(_pkg OPENGL GLEW GLFW3 FMOD FONTCONFIG THREADS GTK3 SQLITE3)
list(APPEND PREBUILT_SPECIFIC_LIBS ${_pkg})
endforeach()
elseif(ANDROID)
@ -148,7 +148,7 @@ macro(jscocos2d_depend_libs)
set(PLATFORM_SPECIFIC_LIBS)
set(PREBUILT_SPECIFIC_LIBS)
list(APPEND PREBUILT_SPECIFIC_LIBS SPIDERMONKEY SQLITE3)
list(APPEND PREBUILT_SPECIFIC_LIBS SPIDERMONKEY)
if(APPLE)
find_library(GAME_CONTROLLER GameController)
list(APPEND PLATFORM_SPECIFIC_LIBS ${GAME_CONTROLLER})

View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
</dict>
</plist>

View File

@ -67,7 +67,9 @@ If you want to add cmake build arguments, please add it at [externalNativeBuild]
To solve the problem that compiling engine sources spends too long time, we add the feature of pre-builds libs. Using this feature you only need build engine sources once for a specific environment.
### Next is a example of build libs once, and use it in next build:
### Example
This is an example of build cpp libs once, and use it in different cpp project.
```sh
cocos new -l cpp -p my.pack.app1 test_app1

View File

@ -5,6 +5,82 @@ include_directories(
../external/poly2tri/sweep
)
set(COCOS_2D_HEADER
2d/CCActionPageTurn3D.h
2d/CCActionTween.h
2d/CCGrid.h
2d/CCSpriteFrameCache.h
2d/CCTMXTiledMap.h
2d/CCLayer.h
2d/CCActionCamera.h
2d/CCLabelTTF.h
2d/CCParticleExamples.h
2d/CCSprite.h
2d/CCNode.h
2d/CCComponentContainer.h
2d/CCActionProgressTimer.h
2d/CCTweenFunction.h
2d/CCLight.h
2d/CCAutoPolygon.h
2d/CCFontAtlas.h
2d/CCAtlasNode.h
2d/CCClippingNode.h
2d/CCRenderTexture.h
2d/CCActionInterval.h
2d/CCTMXXMLParser.h
2d/CCActionInstant.h
2d/CCLabel.h
2d/CCComponent.h
2d/CCLabelAtlas.h
2d/CCActionCatmullRom.h
2d/CCActionGrid.h
2d/CCDrawingPrimitives.h
2d/CCParticleBatchNode.h
2d/CCClippingRectangleNode.h
2d/CCActionEase.h
2d/CCScene.h
2d/CCProtectedNode.h
2d/CCTextFieldTTF.h
2d/CCAnimationCache.h
2d/CCFastTMXLayer.h
2d/CCFontAtlasCache.h
2d/CCFont.h
2d/CCParticleSystemQuad.h
2d/CCActionGrid3D.h
2d/CCCameraBackgroundBrush.h
2d/CCFastTMXTiledMap.h
2d/CCLabelTextFormatter.h
2d/CCMenuItem.h
2d/CCLabelBMFont.h
2d/CCFontFNT.h
2d/CCSpriteBatchNode.h
2d/CCTransitionProgress.h
2d/CCSpriteFrame.h
2d/CCTMXObjectGroup.h
2d/CCAnimation.h
2d/CCNodeGrid.h
2d/CCFontFreeType.h
2d/CCGLBufferedNode.h
2d/CCAction.h
2d/CCTransition.h
2d/CCTransitionPageTurn.h
2d/CCFontCharMap.h
2d/CCParticleSystem.h
2d/CCProgressTimer.h
2d/CCTileMapAtlas.h
2d/CCActionTiledGrid.h
2d/CCActionManager.h
2d/CCMotionStreak.h
2d/CCMenu.h
2d/CCDrawNode.h
2d/CCTMXLayer.h
2d/CCCamera.h
2d/CCParallaxNode.h
2d/CCGrabber.h
)
set(COCOS_2D_SRC
2d/CCActionCamera.cpp

View File

@ -3,6 +3,35 @@ if(WINDOWS AND BUILD_SHARED_LIBS)
ADD_DEFINITIONS (-D_USE3DDLL)
endif()
set(COCOS_3D_HEADER
3d/CCBillBoard.h
3d/CCFrustum.h
3d/CCSprite3DMaterial.h
3d/CCMeshVertexIndexData.h
3d/CCPlane.h
3d/CCRay.h
3d/CCMesh.h
3d/CCAnimate3D.h
3d/CCTerrain.h
3d/CCAnimationCurve.h
3d/CCSprite3D.h
3d/CCOBB.h
3d/CCAnimation3D.h
3d/CCMotionStreak3D.h
3d/CCSkybox.h
3d/CCMeshSkin.h
3d/cocos3d.h
3d/CCAABB.h
3d/CCBundle3D.h
3d/CCObjLoader.h
3d/CCBundle3DData.h
3d/CCSkeleton3D.h
3d/CCBundleReader.h
3d/CCAttachNode.h
)
set(COCOS_3D_SRC
3d/CCAABB.cpp

View File

@ -55,24 +55,44 @@ include(audio/CMakeLists.txt)
include(storage/CMakeLists.txt)
if(BUILD_EDITOR_COCOSBUILDER)
include(editor-support/cocosbuilder/CMakeLists.txt)
set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_CCB_SRC})
include(editor-support/cocosbuilder/CMakeLists.txt)
set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_CCB_SRC} ${COCOS_CCB_HEADER})
endif(BUILD_EDITOR_COCOSBUILDER)
if(BUILD_EDITOR_COCOSTUDIO)
include(editor-support/cocostudio/CMakeLists.txt)
set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_CS_SRC})
include(editor-support/cocostudio/CMakeLists.txt)
set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_CS_SRC} ${COCOS_CS_HEADER})
endif(BUILD_EDITOR_COCOSTUDIO)
if(BUILD_EDITOR_SPINE)
include(editor-support/spine/CMakeLists.txt)
set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_SPINE_SRC})
set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_SPINE_SRC} ${COCOS_SPINE_HEADER})
endif(BUILD_EDITOR_SPINE)
if(BUILD_EXTENSIONS)
include(../extensions/CMakeLists.txt)
endif(BUILD_EXTENSIONS)
set(COCOS_HEADER cocos2d.h
${COCOS_2D_HEADER}
${COCOS_3D_HEADER}
${COCOS_PLATFORM_HEADER}
${COCOS_PHYSICS_HEADER}
${COCOS_PHYSICS3D_HEADER}
${COCOS_MATH_HEADER}
${COCOS_NAVMESH_HEADER}
${COCOS_RENDERER_HEADER}
${COCOS_VR_HEADER}
${COCOS_BASE_HEADER}
${COCOS_AUDIO_HEADER}
${COCOS_UI_HEADER}
${COCOS_DEPRECATED_HEADER}
${COCOS_NETWORK_HEADER}
${COCOS_EDITOR_SUPPORT_HEADER}
${COCOS_EXTENSIONS_HEADER}
${COCOS_STORAGE_HEADER}
)
set(COCOS_SRC cocos2d.cpp
${COCOS_2D_SRC}
${COCOS_3D_SRC}
@ -91,11 +111,13 @@ set(COCOS_SRC cocos2d.cpp
${COCOS_EDITOR_SUPPORT_SRC}
${COCOS_EXTENSIONS_SRC}
${COCOS_STORAGE_SRC}
)
)
#todo: provide prebuild versions of the xx libs for all platforms
include_directories(../external/xxtea)
include_directories(../external/clipper)
#todo: provide prebuild versions of the xx libs for all platforms
include_directories(../external/xxtea)
include_directories(../external/clipper)
list(APPEND COCOS_SRC ${COCOS_HEADER})
add_library(cocos2d ${COCOS_SRC})
@ -132,7 +154,7 @@ if(GEN_COCOS_PREBUILT)
if(BUILD_JS_LIBS)
add_dependencies(prebuilt jscocos2d)
endif()
if(USE_SIMULATOR AND (MACOSX OR WINDOWS))
if(BUILD_SIMU_LIB AND (MACOSX OR WINDOWS))
add_dependencies(prebuilt simulator)
endif()
endif()
@ -146,7 +168,7 @@ if(BUILD_JS_LIBS)
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/scripting/js-bindings ${ENGINE_BINARY_PATH}/cocos/js-bindings)
endif()
# simulator
if(USE_SIMULATOR AND (MACOSX OR WINDOWS))
if(BUILD_SIMU_LIB AND (MACOSX OR WINDOWS))
add_subdirectory(${COCOS2DX_ROOT_PATH}/tools/simulator/libsimulator ${ENGINE_BINARY_PATH}/cocos/libsimulator)
endif()

View File

@ -1,9 +1,22 @@
set(COCOS_AUDIO_SRC
audio/AudioEngine.cpp
)
)
if(WINDOWS)
set(COCOS_AUDIO_PLATFORM_HEADER
audio/win32/AudioDecoderManager.h
audio/win32/AudioDecoder.h
audio/win32/MciPlayer.h
audio/win32/AudioPlayer.h
audio/win32/AudioDecoderOgg.h
audio/win32/AudioMacros.h
audio/win32/AudioEngine-win32.h
audio/win32/AudioDecoderMp3.h
audio/win32/AudioCache.h
)
set(COCOS_AUDIO_PLATFORM_SRC
audio/win32/SimpleAudioEngine.cpp
audio/win32/MciPlayer.cpp
@ -18,6 +31,52 @@ if(WINDOWS)
)
elseif(ANDROID)
set(COCOS_AUDIO_PLATFORM_HEADER
audio/android/PcmAudioService.h
audio/android/AudioBufferProvider.h
audio/android/IAudioPlayer.h
audio/android/AudioResampler.h
audio/android/AudioDecoder.h
audio/android/AudioResamplerPublic.h
audio/android/AudioMixer.h
audio/android/tinysndfile.h
audio/android/mp3reader.h
audio/android/AudioMixerOps.h
audio/android/cutils/bitops.h
audio/android/cutils/log.h
audio/android/audio.h
audio/android/AudioPlayerProvider.h
audio/android/utils/Utils.h
audio/android/utils/Errors.h
audio/android/utils/Compat.h
audio/android/ccdandroidUtils.h
audio/android/AudioDecoderOgg.h
audio/android/Track.h
audio/android/OpenSLHelper.h
audio/android/PcmAudioPlayer.h
audio/android/AssetFd.h
audio/android/PcmBufferProvider.h
audio/android/CCThreadPool.h
audio/android/audio_utils/include/audio_utils/minifloat.h
audio/android/audio_utils/include/audio_utils/primitives.h
audio/android/audio_utils/include/audio_utils/format.h
audio/android/audio_utils/private/private.h
audio/android/ICallerThreadUtils.h
audio/android/AudioDecoderWav.h
audio/android/AudioDecoderProvider.h
audio/android/UrlAudioPlayer.h
audio/android/AudioDecoderSLES.h
audio/android/AudioDecoderMp3.h
audio/android/PcmData.h
audio/android/jni/cddandroidAndroidJavaEngine.h
audio/android/AudioMixerController.h
audio/android/AudioResamplerCubic.h
audio/android/AudioEngine-inl.h
audio/android/IVolumeProvider.h
)
set(COCOS_AUDIO_PLATFORM_SRC
audio/android/cddSimpleAudioEngine.cpp
audio/android/ccdandroidUtils.cpp
@ -51,6 +110,10 @@ elseif(ANDROID)
)
elseif(LINUX)
set(COCOS_AUDIO_PLATFORM_HEADER
audio/linux/AudioEngine-linux.h
)
set(COCOS_AUDIO_PLATFORM_SRC
audio/linux/SimpleAudioEngine.cpp
audio/linux/AudioEngine-linux.h
@ -59,6 +122,13 @@ elseif(LINUX)
elseif(APPLE)
# common
set(COCOS_AUDIO_PLATFORM_HEADER
audio/apple/AudioDecoder.h
audio/apple/AudioPlayer.h
audio/apple/AudioMacros.h
audio/apple/AudioCache.h
audio/apple/AudioEngine-inl.h
)
set(COCOS_AUDIO_PLATFORM_SRC
audio/apple/AudioCache.mm
audio/apple/AudioDecoder.mm
@ -69,6 +139,15 @@ elseif(APPLE)
# because C files needs to be compiled with C compiler and not C++
# compiler
if(MACOSX)
set(COCOS_AUDIO_PLATFORM_HEADER
${COCOS_AUDIO_PLATFORM_HEADER}
audio/mac/CDConfig.h
audio/mac/SimpleAudioEngine_objc.h
audio/mac/CDOpenALSupport.h
audio/mac/CDXMacOSXSupport.h
audio/mac/CDAudioManager.h
audio/mac/CocosDenshion.h
)
set(COCOS_AUDIO_PLATFORM_SRC_C
audio/mac/CDAudioManager.m
audio/mac/CDOpenALSupport.m
@ -82,6 +161,14 @@ elseif(APPLE)
audio/mac/CDXMacOSXSupport.mm
)
elseif(IOS)
set(COCOS_AUDIO_PLATFORM_HEADER
${COCOS_AUDIO_PLATFORM_HEADER}
audio/ios/CDConfig.h
audio/ios/SimpleAudioEngine_objc.h
audio/ios/CDOpenALSupport.h
audio/ios/CDAudioManager.h
audio/ios/CocosDenshion.h
)
set(COCOS_AUDIO_PLATFORM_SRC_C
audio/ios/CDAudioManager.m
audio/ios/CDOpenALSupport.m
@ -101,4 +188,5 @@ elseif(APPLE)
)
endif()
set(COCOS_AUDIO_HEADER ${COCOS_AUDIO_PLATFORM_HEADER})
list(APPEND COCOS_AUDIO_SRC ${COCOS_AUDIO_PLATFORM_SRC})

View File

@ -16,6 +16,81 @@ elseif(LINUX)
)
endif()
set(COCOS_BASE_HEADER
base/pvr.h
base/CCValue.h
base/CCEventListenerMouse.h
base/atitc.h
base/utlist.h
base/CCEventTouch.h
base/CCData.h
base/ccMacros.h
base/CCEventAcceleration.h
base/CCEventListenerKeyboard.h
base/CCController.h
base/CCTouch.h
base/base64.h
base/CCEventListenerController.h
base/s3tc.h
base/etc1.h
base/CCGameController.h
base/CCConsole.h
base/CCEvent.h
base/ccTypes.h
base/CCAsyncTaskPool.h
base/ccRandom.h
base/CCRef.h
base/CCProfiling.h
base/ObjectFactory.h
base/CCProperties.h
base/CCVector.h
base/CCEventCustom.h
base/CCEventKeyboard.h
base/CCNinePatchImageParser.h
base/CCEventListenerCustom.h
base/CCEventDispatcher.h
base/uthash.h
base/ccUtils.h
base/CCEventController.h
base/CCRefPtr.h
base/CCDirector.h
base/CCEventListenerFocus.h
base/CCUserDefault.h
base/ccConfig.h
base/ccFPSImages.h
base/ZipUtils.h
base/CCMap.h
base/ccUTF8.h
base/CCScriptSupport.h
base/allocator/CCAllocatorBase.h
base/allocator/CCAllocatorDiagnostics.h
base/allocator/CCAllocatorMacros.h
base/allocator/CCAllocatorMutex.h
base/allocator/CCAllocatorStrategyGlobalSmallBlock.h
base/allocator/CCAllocatorStrategyDefault.h
base/allocator/CCAllocatorStrategyPool.h
base/allocator/CCAllocatorGlobal.h
base/allocator/CCAllocatorStrategyFixedBlock.h
base/CCEventFocus.h
base/CCConfiguration.h
base/CCProtocols.h
base/TGAlib.h
base/CCDataVisitor.h
base/CCEventMouse.h
base/CCIMEDelegate.h
base/CCNS.h
base/CCAutoreleasePool.h
base/CCStencilStateManager.h
base/CCEventListenerTouch.h
base/CCEventListenerAcceleration.h
base/firePngData.h
base/ccCArray.h
base/CCEventListener.h
base/CCScheduler.h
base/CCEventType.h
base/CCIMEDispatcher.h
)
set(COCOS_BASE_SRC
base/CCAsyncTaskPool.cpp
base/CCAutoreleasePool.cpp

View File

@ -1,3 +1,16 @@
set(COCOS_DEPRECATED_HEADER
deprecated/CCDictionary.h
deprecated/CCDouble.h
deprecated/CCBool.h
deprecated/CCDeprecated.h
deprecated/CCNotificationCenter.h
deprecated/CCString.h
deprecated/CCFloat.h
deprecated/CCSet.h
deprecated/CCInteger.h
deprecated/CCArray.h
)
set(COCOS_DEPRECATED_SRC

View File

@ -1,3 +1,33 @@
set(COCOS_CCB_HEADER
editor-support/cocosbuilder/CCControlButtonLoader.h
editor-support/cocosbuilder/CCMenuLoader.h
editor-support/cocosbuilder/CCMenuItemImageLoader.h
editor-support/cocosbuilder/CCMenuItemLoader.h
editor-support/cocosbuilder/CCLabelBMFontLoader.h
editor-support/cocosbuilder/CCBMemberVariableAssigner.h
editor-support/cocosbuilder/CCBSequence.h
editor-support/cocosbuilder/CCNodeLoaderListener.h
editor-support/cocosbuilder/CCNodeLoader.h
editor-support/cocosbuilder/CCLayerColorLoader.h
editor-support/cocosbuilder/CCBAnimationManager.h
editor-support/cocosbuilder/CCLayerLoader.h
editor-support/cocosbuilder/CCBSequenceProperty.h
editor-support/cocosbuilder/CCLayerGradientLoader.h
editor-support/cocosbuilder/CCScrollViewLoader.h
editor-support/cocosbuilder/CCScale9SpriteLoader.h
editor-support/cocosbuilder/CCControlLoader.h
editor-support/cocosbuilder/CCLabelTTFLoader.h
editor-support/cocosbuilder/CCBKeyframe.h
editor-support/cocosbuilder/CocosBuilder.h
editor-support/cocosbuilder/CCBFileLoader.h
editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h
editor-support/cocosbuilder/CCNodeLoaderLibrary.h
editor-support/cocosbuilder/CCBReader.h
editor-support/cocosbuilder/CCParticleSystemQuadLoader.h
editor-support/cocosbuilder/CCBSelectorResolver.h
editor-support/cocosbuilder/CCSpriteLoader.h
)
set(COCOS_CCB_SRC
editor-support/cocosbuilder/CCBAnimationManager.cpp
editor-support/cocosbuilder/CCBFileLoader.cpp

View File

@ -5,6 +5,103 @@ endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")
set(COCOS_CS_HEADER
editor-support/cocostudio/CCProcessBase.h
editor-support/cocostudio/TriggerMng.h
editor-support/cocostudio/CCDataReaderHelper.h
editor-support/cocostudio/CCDisplayManager.h
editor-support/cocostudio/CCComAttribute.h
editor-support/cocostudio/CCArmatureDefine.h
editor-support/cocostudio/CCUtilMath.h
editor-support/cocostudio/CCInputDelegate.h
editor-support/cocostudio/CCDecorativeDisplay.h
editor-support/cocostudio/CCActionManagerEx.h
editor-support/cocostudio/ActionTimeline/CCTimelineMacro.h
editor-support/cocostudio/ActionTimeline/CCSkeletonNode.h
editor-support/cocostudio/ActionTimeline/CCFrame.h
editor-support/cocostudio/ActionTimeline/CCActionTimeline.h
editor-support/cocostudio/ActionTimeline/CCActionTimelineNode.h
editor-support/cocostudio/ActionTimeline/CCBoneNode.h
editor-support/cocostudio/ActionTimeline/CCTimeLine.h
editor-support/cocostudio/ActionTimeline/CSLoader.h
editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.h
editor-support/cocostudio/ActionTimeline/CCSkinNode.h
editor-support/cocostudio/CocosStudioExtension.h
editor-support/cocostudio/CCTransformHelp.h
editor-support/cocostudio/CocoStudio.h
editor-support/cocostudio/CCBatchNode.h
editor-support/cocostudio/CCActionFrame.h
editor-support/cocostudio/FlatBuffersSerialize.h
editor-support/cocostudio/CCComRender.h
editor-support/cocostudio/CSLanguageDataBinary_generated.h
editor-support/cocostudio/CCSpriteFrameCacheHelper.h
editor-support/cocostudio/CCBone.h
editor-support/cocostudio/CocosStudioExport.h
editor-support/cocostudio/CCArmatureAnimation.h
editor-support/cocostudio/CCActionFrameEasing.h
editor-support/cocostudio/CCTween.h
editor-support/cocostudio/CCActionNode.h
editor-support/cocostudio/CSParse3DBinary_generated.h
editor-support/cocostudio/DictionaryHelper.h
editor-support/cocostudio/CSParseBinary_generated.h
editor-support/cocostudio/CCComBase.h
editor-support/cocostudio/WidgetCallBackHandlerProtocol.h
editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h
editor-support/cocostudio/WidgetReader/ArmatureNodeReader/CSArmatureNode_generated.h
editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h
editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h
editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h
editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h
editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h
editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h
editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h
editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h
editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h
editor-support/cocostudio/WidgetReader/WidgetReaderProtocol.h
editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h
editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.h
editor-support/cocostudio/WidgetReader/TabControlReader/TabControlReader.h
editor-support/cocostudio/WidgetReader/TabControlReader/CSTabControl_generated.h
editor-support/cocostudio/WidgetReader/TextReader/TextReader.h
editor-support/cocostudio/WidgetReader/WidgetReader.h
editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h
editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h
editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h
editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h
editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h
editor-support/cocostudio/WidgetReader/NodeReaderDefine.h
editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h
editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h
editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h
editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h
editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h
editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h
editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h
editor-support/cocostudio/WidgetReader/SkeletonReader/CSBoneBinary_generated.h
editor-support/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h
editor-support/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h
editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h
editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h
editor-support/cocostudio/WidgetReader/NodeReaderProtocol.h
editor-support/cocostudio/CCComAudio.h
editor-support/cocostudio/CCDisplayFactory.h
editor-support/cocostudio/CCArmature.h
editor-support/cocostudio/CCArmatureDataManager.h
editor-support/cocostudio/CCDatas.h
editor-support/cocostudio/CCComExtensionData.h
editor-support/cocostudio/CCComController.h
editor-support/cocostudio/TriggerObj.h
editor-support/cocostudio/CocoLoader.h
editor-support/cocostudio/CCColliderDetector.h
editor-support/cocostudio/LocalizationManager.h
editor-support/cocostudio/CCActionObject.h
editor-support/cocostudio/TriggerBase.h
editor-support/cocostudio/CCSSceneReader.h
editor-support/cocostudio/CCSGUIReader.h
editor-support/cocostudio/CCSkin.h
)
set(COCOS_CS_SRC
editor-support/cocostudio/CCActionFrame.cpp

View File

@ -1,50 +1,102 @@
include_directories(editor-support)
set(COCOS_SPINE_SRC
editor-support/spine/Animation.c
editor-support/spine/AnimationState.c
editor-support/spine/AnimationStateData.c
editor-support/spine/Array.c
editor-support/spine/Atlas.c
editor-support/spine/AtlasAttachmentLoader.c
editor-support/spine/Attachment.c
editor-support/spine/AttachmentLoader.c
editor-support/spine/AttachmentVertices.cpp
editor-support/spine/Bone.c
editor-support/spine/BoneData.c
editor-support/spine/BoundingBoxAttachment.c
editor-support/spine/ClippingAttachment.c
editor-support/spine/Cocos2dAttachmentLoader.cpp
editor-support/spine/Color.c
editor-support/spine/Event.c
editor-support/spine/EventData.c
editor-support/spine/IkConstraint.c
editor-support/spine/IkConstraintData.c
editor-support/spine/Json.c
editor-support/spine/MeshAttachment.c
editor-support/spine/PathAttachment.c
editor-support/spine/PathConstraint.c
editor-support/spine/PathConstraintData.c
editor-support/spine/PointAttachment.c
editor-support/spine/RegionAttachment.c
editor-support/spine/Skeleton.c
editor-support/spine/SkeletonAnimation.cpp
editor-support/spine/SkeletonBatch.cpp
editor-support/spine/SkeletonBinary.c
editor-support/spine/SkeletonBounds.c
editor-support/spine/SkeletonClipping.c
editor-support/spine/SkeletonData.c
editor-support/spine/SkeletonJson.c
editor-support/spine/SkeletonRenderer.cpp
editor-support/spine/SkeletonTwoColorBatch.cpp
editor-support/spine/Skin.c
editor-support/spine/Slot.c
editor-support/spine/SlotData.c
editor-support/spine/TransformConstraint.c
editor-support/spine/TransformConstraintData.c
editor-support/spine/Triangulator.c
editor-support/spine/VertexAttachment.c
editor-support/spine/VertexEffect.c
editor-support/spine/extension.c
editor-support/spine/spine-cocos2dx.cpp
set(COCOS_SPINE_HEADER
editor-support/spine/Animation.h
editor-support/spine/EventData.h
editor-support/spine/SkeletonAnimation.h
editor-support/spine/SlotData.h
editor-support/spine/SkeletonClipping.h
editor-support/spine/PathAttachment.h
editor-support/spine/PointAttachment.h
editor-support/spine/Event.h
editor-support/spine/Bone.h
editor-support/spine/Atlas.h
editor-support/spine/VertexAttachment.h
editor-support/spine/SkeletonRenderer.h
editor-support/spine/spine.h
editor-support/spine/ClippingAttachment.h
editor-support/spine/spine-cocos2dx.h
editor-support/spine/Color.h
editor-support/spine/Triangulator.h
editor-support/spine/RegionAttachment.h
editor-support/spine/Attachment.h
editor-support/spine/TransformConstraint.h
editor-support/spine/dll.h
editor-support/spine/SkeletonJson.h
editor-support/spine/IkConstraintData.h
editor-support/spine/AnimationStateData.h
editor-support/spine/kvec.h
editor-support/spine/Skeleton.h
editor-support/spine/Json.h
editor-support/spine/AttachmentLoader.h
editor-support/spine/Skin.h
editor-support/spine/VertexEffect.h
editor-support/spine/SkeletonBinary.h
editor-support/spine/SkeletonData.h
editor-support/spine/Array.h
editor-support/spine/PathConstraintData.h
editor-support/spine/SkeletonBatch.h
editor-support/spine/TransformConstraintData.h
editor-support/spine/Cocos2dAttachmentLoader.h
editor-support/spine/extension.h
editor-support/spine/PathConstraint.h
editor-support/spine/IkConstraint.h
editor-support/spine/BoundingBoxAttachment.h
editor-support/spine/AttachmentVertices.h
editor-support/spine/SkeletonTwoColorBatch.h
editor-support/spine/SkeletonBounds.h
editor-support/spine/Slot.h
editor-support/spine/BoneData.h
editor-support/spine/AnimationState.h
editor-support/spine/MeshAttachment.h
editor-support/spine/AtlasAttachmentLoader.h
)
set(COCOS_SPINE_SRC
editor-support/spine/Animation.c
editor-support/spine/AnimationState.c
editor-support/spine/AnimationStateData.c
editor-support/spine/Array.c
editor-support/spine/Atlas.c
editor-support/spine/AtlasAttachmentLoader.c
editor-support/spine/Attachment.c
editor-support/spine/AttachmentLoader.c
editor-support/spine/AttachmentVertices.cpp
editor-support/spine/Bone.c
editor-support/spine/BoneData.c
editor-support/spine/BoundingBoxAttachment.c
editor-support/spine/ClippingAttachment.c
editor-support/spine/Cocos2dAttachmentLoader.cpp
editor-support/spine/Color.c
editor-support/spine/Event.c
editor-support/spine/EventData.c
editor-support/spine/IkConstraint.c
editor-support/spine/IkConstraintData.c
editor-support/spine/Json.c
editor-support/spine/MeshAttachment.c
editor-support/spine/PathAttachment.c
editor-support/spine/PathConstraint.c
editor-support/spine/PathConstraintData.c
editor-support/spine/PointAttachment.c
editor-support/spine/RegionAttachment.c
editor-support/spine/Skeleton.c
editor-support/spine/SkeletonAnimation.cpp
editor-support/spine/SkeletonBatch.cpp
editor-support/spine/SkeletonBinary.c
editor-support/spine/SkeletonBounds.c
editor-support/spine/SkeletonClipping.c
editor-support/spine/SkeletonData.c
editor-support/spine/SkeletonJson.c
editor-support/spine/SkeletonRenderer.cpp
editor-support/spine/SkeletonTwoColorBatch.cpp
editor-support/spine/Skin.c
editor-support/spine/Slot.c
editor-support/spine/SlotData.c
editor-support/spine/TransformConstraint.c
editor-support/spine/TransformConstraintData.c
editor-support/spine/Triangulator.c
editor-support/spine/VertexAttachment.c
editor-support/spine/VertexEffect.c
editor-support/spine/extension.c
editor-support/spine/spine-cocos2dx.cpp
)

View File

@ -1,15 +1,27 @@
set(COCOS_MATH_HEADER
math/Vec2.h
math/Mat4.h
math/Quaternion.h
math/TransformUtils.h
math/Vec4.h
math/CCAffineTransform.h
math/CCGeometry.h
math/CCVertex.h
math/Vec3.h
math/CCMathBase.h
math/MathUtil.h
math/CCMath.h
)
set(COCOS_MATH_SRC
math/CCAffineTransform.cpp
math/CCGeometry.cpp
math/CCVertex.cpp
math/Mat4.cpp
math/MathUtil.cpp
math/Quaternion.cpp
math/TransformUtils.cpp
math/Vec2.cpp
math/Vec3.cpp
math/Vec4.cpp
math/CCAffineTransform.cpp
math/CCGeometry.cpp
math/CCVertex.cpp
math/Mat4.cpp
math/MathUtil.cpp
math/Quaternion.cpp
math/TransformUtils.cpp
math/Vec2.cpp
math/Vec3.cpp
math/Vec4.cpp
)

View File

@ -1,6 +1,12 @@
set(COCOS_NAVMESH_HEADER
navmesh/CCNavMeshAgent.h
navmesh/CCNavMeshObstacle.h
navmesh/CCNavMeshUtils.h
navmesh/CCNavMeshDebugDraw.h
navmesh/CCNavMesh.h
)
set(COCOS_NAVMESH_SRC
navmesh/CCNavMesh.cpp
navmesh/CCNavMeshAgent.cpp
navmesh/CCNavMeshDebugDraw.cpp

View File

@ -1,15 +1,7 @@
if(WINDOWS)
set(PLATFORM_LINK websockets)
elseif(LINUX)
set(PLATFORM_LINK websockets ssl crypto)
elseif(ANDROID)
set(PLATFORM_LINK websockets)
else()
set(PLATFORM_LINK websockets)
endif()
if(ANDROID)
set(COCOS_NETWORK_HEADER
network/CCDownloader-android.h
)
set(COCOS_NETWORK_SRC
network/HttpClient-android.cpp
network/SocketIO.cpp
@ -18,7 +10,11 @@ if(ANDROID)
network/CCDownloader-android.cpp
network/Uri.cpp
)
elseif(MACOSX OR IOS)
elseif(APPLE)
set(COCOS_NETWORK_HEADER
network/CCDownloader-apple.h
network/HttpAsynConnection-apple.h
)
set(COCOS_NETWORK_SRC
network/CCDownloader-apple.mm
network/HttpClient.cpp
@ -39,18 +35,16 @@ else()
)
endif()
if(WINDOWS)
set(COCOS_NETWORK_LINK
libcurl_imp
${PLATFORM_LINK}
)
elseif(ANDROID)
set(COCOS_NETWORK_LINK
${PLATFORM_LINK}
)
else()
set(COCOS_NETWORK_LINK
curl
${PLATFORM_LINK}
)
endif()
set(COCOS_NETWORK_HEADER
${COCOS_NETWORK_HEADER}
network/CCDownloader-curl.h
network/CCIDownloaderImpl.h
network/CCDownloader.h
network/WebSocket.h
network/Uri.h
network/SocketIO.h
network/HttpClient.h
network/HttpResponse.h
network/HttpRequest.h
network/HttpCookie.h
)

View File

@ -1,6 +1,14 @@
set(COCOS_PHYSICS_HEADER
physics/CCPhysicsContact.h
physics/CCPhysicsWorld.h
physics/CCPhysicsBody.h
physics/cpCompat62.h
physics/CCPhysicsShape.h
physics/CCPhysicsHelper.h
physics/CCPhysicsJoint.h
)
set(COCOS_PHYSICS_SRC
physics/CCPhysicsBody.cpp
physics/CCPhysicsContact.cpp
physics/CCPhysicsJoint.cpp

View File

@ -1,6 +1,15 @@
set(COCOS_PHYSICS3D_HEADER
physics3d/CCPhysics3DConstraint.h
physics3d/CCPhysics3DShape.h
physics3d/CCPhysics3D.h
physics3d/CCPhysics3DWorld.h
physics3d/CCPhysicsSprite3D.h
physics3d/CCPhysics3DObject.h
physics3d/CCPhysics3DComponent.h
physics3d/CCPhysics3DDebugDrawer.h
)
set(COCOS_PHYSICS3D_SRC
physics3d/CCPhysics3D.cpp
physics3d/CCPhysics3DComponent.cpp
physics3d/CCPhysics3DConstraint.cpp

View File

@ -23,20 +23,34 @@
# ****************************************************************************/
if(WINDOWS)
set(COCOS_PLATFORM_SPECIFIC_SRC
platform/win32/CCStdC-win32.cpp
platform/win32/CCUtils-win32.cpp
platform/win32/CCFileUtils-win32.cpp
platform/win32/CCCommon-win32.cpp
platform/win32/CCApplication-win32.cpp
platform/win32/CCDevice-win32.cpp
platform/win32/inet_pton_mingw.cpp
platform/desktop/CCGLViewImpl-desktop.cpp
)
set(COCOS_PLATFORM_SPECIFIC_HEADER
platform/win32/compat/stdint.h
platform/win32/CCApplication-win32.h
platform/win32/inet_pton_mingw.h
platform/win32/CCGL-win32.h
platform/win32/CCFileUtils-win32.h
platform/win32/CCStdC-win32.h
platform/win32/CCPlatformDefine-win32.h
platform/win32/CCUtils-win32.h
platform/desktop/CCGLViewImpl-desktop.h
)
set(COCOS_PLATFORM_SPECIFIC_SRC
platform/win32/CCStdC-win32.cpp
platform/win32/CCUtils-win32.cpp
platform/win32/CCFileUtils-win32.cpp
platform/win32/CCCommon-win32.cpp
platform/win32/CCApplication-win32.cpp
platform/win32/CCDevice-win32.cpp
platform/win32/inet_pton_mingw.cpp
platform/desktop/CCGLViewImpl-desktop.cpp
)
elseif(APPLE)
set(COCOS_PLATFORM_SPECIFIC_HEADER
platform/apple/CCFileUtils-apple.h
platform/apple/CCLock-apple.h
platform/apple/CCDevice-apple.h
)
set(COCOS_PLATFORM_SPECIFIC_SRC
platform/apple/CCLock-apple.cpp
platform/apple/CCFileUtils-apple.mm
@ -44,15 +58,37 @@ elseif(APPLE)
platform/apple/CCDevice-apple.mm
)
if(MACOSX)
set(COCOS_PLATFORM_SPECIFIC_HEADER
${COCOS_PLATFORM_SPECIFIC_HEADER}
platform/mac/CCStdC-mac.h
platform/mac/CCPlatformDefine-mac.h
platform/mac/CCApplication-mac.h
platform/mac/CCGL-mac.h
platform/desktop/CCGLViewImpl-desktop.h
)
set(COCOS_PLATFORM_SPECIFIC_SRC
${COCOS_PLATFORM_SPECIFIC_SRC}
platform/mac/CCApplication-mac.mm
platform/mac/CCCommon-mac.mm
platform/mac/CCDevice-mac.mm
platform/desktop/CCGLViewImpl-desktop.cpp
${COCOS_PLATFORM_SPECIFIC_SRC}
)
elseif(IOS)
set(COCOS_PLATFORM_SPECIFIC_HEADER
${COCOS_PLATFORM_SPECIFIC_HEADER}
platform/ios/CCGL-ios.h
platform/ios/CCApplication-ios.h
platform/ios/CCDirectorCaller-ios.h
platform/ios/CCESRenderer-ios.h
platform/ios/OpenGL_Internal-ios.h
platform/ios/CCPlatformDefine-ios.h
platform/ios/CCStdC-ios.h
platform/ios/CCEAGLView-ios.h
platform/ios/CCGLViewImpl-ios.h
platform/ios/CCES2Renderer-ios.h
)
set(COCOS_PLATFORM_SPECIFIC_SRC
${COCOS_PLATFORM_SPECIFIC_SRC}
platform/ios/CCApplication-ios.mm
platform/ios/CCCommon-ios.mm
platform/ios/CCDevice-ios.mm
@ -61,11 +97,9 @@ elseif(APPLE)
platform/ios/CCES2Renderer-ios.m
platform/ios/CCGLViewImpl-ios.mm
platform/ios/CCImage-ios.mm
${COCOS_PLATFORM_SPECIFIC_SRC}
)
endif()
elseif(LINUX)
include_directories(
@ -73,48 +107,70 @@ elseif(LINUX)
/usr/include/GLFW
/usr/local/include/GLFW
)
set(COCOS_PLATFORM_SPECIFIC_SRC
platform/linux/CCStdC-linux.cpp
platform/linux/CCFileUtils-linux.cpp
platform/linux/CCCommon-linux.cpp
platform/linux/CCApplication-linux.cpp
platform/linux/CCDevice-linux.cpp
platform/desktop/CCGLViewImpl-desktop.cpp
)
set(COCOS_PLATFORM_SPECIFIC_HEADER
platform/linux/CCApplication-linux.h
platform/linux/CCGL-linux.h
platform/linux/CCStdC-linux.h
platform/linux/CCFileUtils-linux.h
platform/linux/CCPlatformDefine-linux.h
platform/desktop/CCGLViewImpl-desktop.h
)
set(COCOS_PLATFORM_SPECIFIC_SRC
platform/linux/CCStdC-linux.cpp
platform/linux/CCFileUtils-linux.cpp
platform/linux/CCCommon-linux.cpp
platform/linux/CCApplication-linux.cpp
platform/linux/CCDevice-linux.cpp
platform/desktop/CCGLViewImpl-desktop.cpp
)
elseif(ANDROID)
# need move to COCOS2DX_ANDROID_STATIC?
# need refactor
set(COCOS_PLATFORM_SPECIFIC_SRC
platform/android/CCApplication-android.cpp
platform/android/CCCommon-android.cpp
platform/android/CCGLViewImpl-android.cpp
platform/android/CCFileUtils-android.cpp
platform/android/CCEnhanceAPI-android.cpp
platform/android/jni/JniHelper.cpp
)
set(COCOS2DX_ANDROID_STATIC
platform/android/CCDevice-android.cpp
platform/android/javaactivity-android.cpp
platform/android/jni/TouchesJni.cpp
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.cpp
set(COCOS_PLATFORM_SPECIFIC_HEADER
platform/android/CCApplication-android.h
platform/android/CCStdC-android.h
platform/android/CCFileUtils-android.h
platform/android/CCEnhanceAPI-android.h
platform/android/CCPlatformDefine-android.h
platform/android/CCGLViewImpl-android.h
platform/android/jni/ProcessCpuTracker.h
platform/android/jni/JniHelper.h
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.h
platform/android/CCGL-android.h
)
# need move to COCOS2DX_ANDROID_SRC?
# need refactor
set(COCOS_PLATFORM_SPECIFIC_SRC
platform/android/CCApplication-android.cpp
platform/android/CCCommon-android.cpp
platform/android/CCGLViewImpl-android.cpp
platform/android/CCFileUtils-android.cpp
platform/android/CCEnhanceAPI-android.cpp
platform/android/jni/JniHelper.cpp
)
)
set(COCOS2DX_ANDROID_SRC
platform/android/CCDevice-android.cpp
platform/android/javaactivity-android.cpp
platform/android/jni/TouchesJni.cpp
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp
platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.cpp
add_library(cocos2d_android STATIC ${COCOS2DX_ANDROID_STATIC})
set_property(TARGET cocos2d_android PROPERTY POSITION_INDEPENDENT_CODE TRUE)
set_target_properties(cocos2d_android
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
VERSION "${COCOS2D_X_VERSION}"
)
)
add_library(cocos2d_android STATIC ${COCOS2DX_ANDROID_SRC})
set_property(TARGET cocos2d_android PROPERTY POSITION_INDEPENDENT_CODE TRUE)
set_target_properties(cocos2d_android
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
VERSION "${COCOS2D_X_VERSION}"
)
endif()
@ -129,8 +185,26 @@ include_directories(
../external/poly2tri/sweep
)
set(COCOS_PLATFORM_SRC
set(COCOS_PLATFORM_HEADER
${COCOS_PLATFORM_SPECIFIC_HEADER}
platform/CCApplication.h
platform/CCApplicationProtocol.h
platform/CCCommon.h
platform/CCDevice.h
platform/CCFileUtils.h
platform/CCGL.h
platform/CCGLView.h
platform/CCImage.h
platform/CCPlatformConfig.h
platform/CCPlatformDefine.h
platform/CCPlatformMacros.h
platform/CCSAXParser.h
platform/CCStdC.h
platform/CCThread.h
)
set(COCOS_PLATFORM_SRC
${COCOS_PLATFORM_SPECIFIC_SRC}
platform/CCSAXParser.cpp
platform/CCThread.cpp
platform/CCGLView.cpp
@ -145,6 +219,4 @@ set(COCOS_PLATFORM_SRC
../external/poly2tri/sweep/cdt.cc
../external/poly2tri/sweep/sweep_context.cc
../external/poly2tri/sweep/sweep.cc
${COCOS_PLATFORM_SPECIFIC_SRC}
)

View File

@ -1,3 +1,34 @@
set(COCOS_RENDERER_HEADER
renderer/CCTextureCache.h
renderer/CCRenderer.h
renderer/CCMaterial.h
renderer/ccGLStateCache.h
renderer/CCRenderCommandPool.h
renderer/ccShaders.h
renderer/CCMeshCommand.h
renderer/CCGLProgramStateCache.h
renderer/CCRenderCommand.h
renderer/CCTextureCube.h
renderer/CCGLProgram.h
renderer/CCGLProgramCache.h
renderer/CCTextureAtlas.h
renderer/CCGroupCommand.h
renderer/CCVertexAttribBinding.h
renderer/CCVertexIndexBuffer.h
renderer/CCVertexIndexData.h
renderer/CCPrimitive.h
renderer/CCTexture2D.h
renderer/CCCustomCommand.h
renderer/CCFrameBuffer.h
renderer/CCQuadCommand.h
renderer/CCTechnique.h
renderer/CCPrimitiveCommand.h
renderer/CCGLProgramState.h
renderer/CCTrianglesCommand.h
renderer/CCBatchCommand.h
renderer/CCPass.h
renderer/CCRenderState.h
)
set(COCOS_RENDERER_SRC
renderer/CCBatchCommand.cpp

View File

@ -26,29 +26,87 @@ set(cocos_root ${COCOS2DX_ROOT_PATH})
#platform
if(WIN32) # Win32
set(PLATFORM_FOLDER win32)
add_definitions(-D_USRJSSTATIC)
elseif(APPLE)# osx or ios
set(PLATFORM_FOLDER mac)
set(PLATFORM_HEADER manual/platform/ios/JavaScriptObjCBridge.h)
set(PLATFORM_SRC manual/platform/ios/JavaScriptObjCBridge.mm)
elseif(ANDROID)
set(PLATFORM_FOLDER android)
set(PLATFORM_HEADER manual/platform/android/CCJavascriptJavaBridge.h)
set(PLATFORM_SRC manual/platform/android/CCJavascriptJavaBridge.cpp)
else() # Assume Linux
set(PLATFORM_FOLDER linux)
endif()
if(ANDROID OR IOS)
set(PLATFORM_HEADER
${PLATFORM_HEADER}
auto/jsb_cocos2dx_experimental_webView_auto.hpp
manual/experimental/jsb_cocos2dx_experimental_webView_manual.h
auto/jsb_cocos2dx_experimental_video_auto.hpp
manual/experimental/jsb_cocos2dx_experimental_video_manual.h
)
set(PLATFORM_SRC
${PLATFORM_SRC}
auto/jsb_cocos2dx_experimental_webView_auto.cpp
manual/experimental/jsb_cocos2dx_experimental_webView_manual.cpp
auto/jsb_cocos2dx_experimental_video_auto.cpp
manual/experimental/jsb_cocos2dx_experimental_video_manual.cpp
${PLATFORM_SRC}
)
endif()
set(JSBINDING_HEADER
${PLATFORM_HEADER}
auto/jsb_cocos2dx_extension_auto.hpp
auto/jsb_cocos2dx_builder_auto.hpp
auto/jsb_cocos2dx_physics3d_auto.hpp
auto/jsb_cocos2dx_ui_auto.hpp
auto/jsb_cocos2dx_spine_auto.hpp
auto/jsb_cocos2dx_auto.hpp
auto/jsb_cocos2dx_studio_auto.hpp
auto/jsb_cocos2dx_navmesh_auto.hpp
auto/jsb_cocos2dx_audioengine_auto.hpp
auto/js_bindings_chipmunk_functions_registration.h
auto/js_bindings_chipmunk_auto_classes.h
auto/js_bindings_chipmunk_auto_classes_registration.h
auto/jsb_cocos2dx_network_auto.hpp
auto/jsb_cocos2dx_3d_auto.hpp
auto/jsb_cocos2dx_3d_extension_auto.hpp
auto/js_bindings_chipmunk_functions.h
manual/js_bindings_core.h
manual/js_module_register.h
manual/ui/jsb_cocos2dx_ui_manual.h
manual/3d/jsb_cocos2dx_3d_manual.h
manual/cocosbuilder/js_bindings_ccbreader.h
manual/js_manual_conversions.h
manual/extension/jsb_cocos2dx_extension_manual.h
manual/spine/jsb_cocos2dx_spine_manual.h
manual/jsb_opengl_registration.h
manual/jsb_opengl_manual.h
manual/network/jsb_websocket.h
manual/network/js_network_manual.h
manual/network/XMLHTTPRequest.h
manual/network/jsb_socketio.h
manual/component/CCComponentJS.h
manual/navmesh/jsb_cocos2dx_navmesh_conversions.h
manual/navmesh/jsb_cocos2dx_navmesh_manual.h
manual/jsb_helper.h
manual/js_bindings_opengl.h
manual/chipmunk/js_bindings_chipmunk_manual.h
manual/chipmunk/js_bindings_chipmunk_registration.h
manual/js_bindings_config.h
manual/ScriptingCore.h
manual/localstorage/js_bindings_system_functions.h
manual/localstorage/js_bindings_system_functions_registration.h
manual/localstorage/js_bindings_system_registration.h
manual/js-BindingsExport.h
manual/physics3d/jsb_cocos2dx_physics3d_manual.h
manual/jsb_opengl_functions.h
manual/cocostudio/jsb_cocos2dx_studio_conversions.h
manual/cocostudio/jsb_cocos2dx_studio_manual.h
manual/jsb_event_dispatcher_manual.h
manual/spidermonkey_specifics.h
)
set(JSBINDING_SRC
${PLATFORM_SRC}
auto/jsb_cocos2dx_auto.cpp
auto/jsb_cocos2dx_audioengine_auto.cpp
auto/jsb_cocos2dx_builder_auto.cpp
@ -91,18 +149,15 @@ set(JSBINDING_SRC
manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp
manual/navmesh/jsb_cocos2dx_navmesh_conversions.cpp
manual/navmesh/jsb_cocos2dx_navmesh_manual.cpp
${cocos_root}/cocos/storage/local-storage/LocalStorage.cpp
${PLATFORM_SRC}
)
# if(USE_CHIPMUNK)
# include_directories(${CHIPMUNK_INCLUDE_DIRS})
# endif()
include_directories(
${cocos_root}/cocos/platform/${PLATFORM_FOLDER}
${cocos_root}/external/spidermonkey/include/${PLATFORM_FOLDER}
)
list(APPEND JSBINDING_SRC ${JSBINDING_HEADER} ${PLATFORM_HEADER})
add_library(jscocos2d STATIC
${JSBINDING_SRC}
)

View File

@ -13,29 +13,29 @@ if(ANDROID)
include_directories(
manual/platform/android
manual/platform/android/jni
)
)
endif()
file(GLOB lua_cocos2d_source_files
"${cocos_root}/external/lua/tolua/*.c"
"${cocos_root}/external/xxtea/xxtea.cpp"
)
)
list(APPEND lua_cocos2d_source_files
${cocos_root}/external/lua/luasocket/luasocket.c
${cocos_root}/external/lua/luasocket/timeout.c
${cocos_root}/external/lua/luasocket/buffer.c
${cocos_root}/external/lua/luasocket/io.c
${cocos_root}/external/lua/luasocket/auxiliar.c
${cocos_root}/external/lua/luasocket/options.c
${cocos_root}/external/lua/luasocket/inet.c
${cocos_root}/external/lua/luasocket/except.c
${cocos_root}/external/lua/luasocket/select.c
${cocos_root}/external/lua/luasocket/tcp.c
${cocos_root}/external/lua/luasocket/udp.c
${cocos_root}/external/lua/luasocket/mime.c
${cocos_root}/external/lua/luasocket/luasocket_scripts.c
)
${cocos_root}/external/lua/luasocket/luasocket.c
${cocos_root}/external/lua/luasocket/timeout.c
${cocos_root}/external/lua/luasocket/buffer.c
${cocos_root}/external/lua/luasocket/io.c
${cocos_root}/external/lua/luasocket/auxiliar.c
${cocos_root}/external/lua/luasocket/options.c
${cocos_root}/external/lua/luasocket/inet.c
${cocos_root}/external/lua/luasocket/except.c
${cocos_root}/external/lua/luasocket/select.c
${cocos_root}/external/lua/luasocket/tcp.c
${cocos_root}/external/lua/luasocket/udp.c
${cocos_root}/external/lua/luasocket/mime.c
${cocos_root}/external/lua/luasocket/luasocket_scripts.c
)
if(WINDOWS)
if(MINGW)
@ -62,6 +62,42 @@ elseif(UNIX OR ANDROID)
)
endif()
set(lua_bindings_manual_headers
manual/CCComponentLua.h
manual/3d/lua_cocos2dx_3d_manual.h
manual/cocosbuilder/CCBProxy.h
manual/cocosbuilder/lua_cocos2dx_cocosbuilder_manual.h
manual/CCLuaStack.h
manual/CCLuaEngine.h
manual/lua_module_register.h
manual/CCLuaBridge.h
manual/extension/lua_cocos2dx_extension_manual.h
manual/LuaBasicConversions.h
manual/spine/LuaSkeletonAnimation.h
manual/platform/ios/CCLuaObjcBridge.h
manual/network/lua_cocos2dx_network_manual.h
manual/network/lua_xml_http_request.h
manual/network/Lua_web_socket.h
manual/network/lua_extensions.h
manual/audioengine/lua_cocos2dx_audioengine_manual.h
manual/Lua-BindingsExport.h
manual/tolua_fix.h
manual/navmesh/lua_cocos2dx_navmesh_manual.h
manual/navmesh/lua_cocos2dx_navmesh_conversions.h
manual/cocos2d/lua_cocos2dx_deprecated.h
manual/cocos2d/LuaOpengl.h
manual/cocos2d/LuaScriptHandlerMgr.h
manual/cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h
manual/Cocos2dxLuaLoader.h
manual/CCLuaValue.h
manual/physics3d/lua_cocos2dx_physics3d_manual.h
manual/cocostudio/lua-cocos-studio-conversions.h
manual/cocostudio/CustomGUIReader.h
manual/ui/lua_cocos2dx_ui_manual.hpp
manual/ui/lua_cocos2dx_experimental_video_manual.hpp
manual/controller/lua_cocos2dx_controller_manual.hpp
)
set(lua_bindings_manual_files
manual/CCLuaBridge.cpp
manual/CCLuaEngine.cpp
@ -97,14 +133,32 @@ set(lua_bindings_manual_files
manual/spine/LuaSkeletonAnimation.cpp
manual/ui/lua_cocos2dx_experimental_video_manual.cpp
manual/ui/lua_cocos2dx_ui_manual.cpp
# android.mk not include this
# manual/video/lua_cocos2dx_experimental_video_manual.cpp
manual/audioengine/lua_cocos2dx_audioengine_manual.cpp
manual/physics3d/lua_cocos2dx_physics3d_manual.cpp
manual/navmesh/lua_cocos2dx_navmesh_conversions.cpp
manual/navmesh/lua_cocos2dx_navmesh_manual.cpp
)
set(lua_bindings_auto_headers
auto/lua_cocos2dx_cocosdenshion_auto.hpp
auto/lua_cocos2dx_audioengine_auto.hpp
auto/lua_cocos2dx_3d_auto.hpp
auto/lua_cocos2dx_controller_auto.hpp
auto/lua_cocos2dx_spine_auto.hpp
auto/lua_cocos2dx_experimental_webview_auto.hpp
auto/lua_cocos2dx_studio_auto.hpp
auto/lua_cocos2dx_auto.hpp
auto/lua_cocos2dx_experimental_video_auto.hpp
auto/lua_cocos2dx_navmesh_auto.hpp
auto/lua_cocos2dx_csloader_auto.hpp
auto/lua_cocos2dx_experimental_auto.hpp
auto/lua_cocos2dx_physics3d_auto.hpp
auto/lua_cocos2dx_ui_auto.hpp
auto/lua_cocos2dx_physics_auto.hpp
auto/lua_cocos2dx_extension_auto.hpp
auto/lua_cocos2dx_cocosbuilder_auto.hpp
)
set(lua_bindings_auto_files
auto/lua_cocos2dx_3d_auto.cpp
auto/lua_cocos2dx_auto.cpp
@ -126,32 +180,59 @@ set(lua_bindings_auto_files
if(APPLE)
# CCLuaObjcBridge.mm needed by ios and mac
set(lua_bindings_manual_headers
${lua_bindings_manual_headers}
manual/platform/ios/CCLuaObjcBridge.h
)
set(lua_bindings_manual_files
${lua_bindings_manual_files}
manual/platform/ios/CCLuaObjcBridge.mm
)
if(IOS)
set(lua_bindings_manual_headers
${lua_bindings_manual_headers}
auto/lua_cocos2dx_experimental_webview_auto.hpp
manual/ui/lua_cocos2dx_experimental_webview_manual.hpp
)
set(lua_bindings_manual_files
${lua_bindings_manual_files}
auto/lua_cocos2dx_experimental_webview_auto.cpp
manual/ui/lua_cocos2dx_experimental_webview_manual.cpp
${lua_bindings_manual_files}
auto/lua_cocos2dx_experimental_webview_auto.cpp
manual/ui/lua_cocos2dx_experimental_webview_manual.cpp
)
endif()
elseif(ANDROID)
set(lua_bindings_manual_headers
${lua_bindings_manual_headers}
manual/platform/android/CCLuaJavaBridge.h
manual/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h
auto/lua_cocos2dx_experimental_webview_auto.hpp
manual/ui/lua_cocos2dx_experimental_webview_manual.hpp
)
set(lua_bindings_manual_files
${lua_bindings_manual_files}
manual/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp
manual/platform/android/CCLuaJavaBridge.cpp
auto/lua_cocos2dx_experimental_webview_auto.cpp
manual/ui/lua_cocos2dx_experimental_webview_manual.cpp
)
)
endif()
if(USE_BULLET)
include_directories(${BULLET_INCLUDE_DIRS})
endif()
set(lua_bindings_files ${lua_cocos2d_source_files} ${lua_bindings_manual_files} ${lua_bindings_auto_files})
set(lua_bindings_files
${lua_cocos2d_source_files}
${lua_bindings_manual_files}
${lua_bindings_auto_files}
)
set(lua_bindings_headers
${lua_cocos2d_source_headers}
${lua_bindings_manual_headers}
${lua_bindings_auto_headers}
)
list(APPEND lua_bindings_files ${lua_bindings_headers})
add_library(luacocos2d ${lua_bindings_files})
target_link_libraries(luacocos2d cocos2d)

View File

@ -1,3 +1,7 @@
set(COCOS_STORAGE_HEADER
storage/local-storage/LocalStorage.h
)
if(ANDROID)
set(COCOS_STORAGE_SRC
storage/local-storage/LocalStorage-android.cpp

View File

@ -4,51 +4,117 @@ if(WINDOWS AND BUILD_SHARED_LIBS)
endif()
if(WINDOWS)
set(COCOS_UI_SPECIFIC_HEADER
ui/UIEditBox/UIEditBoxImpl-win32.h
)
set(COCOS_UI_SPECIFIC_SRC
ui/UIEditBox/UIEditBoxImpl-win32.cpp
)
ui/UIEditBox/UIEditBoxImpl-win32.cpp
)
elseif(APPLE)
if(MACOSX)
set(COCOS_UI_SPECIFIC_SRC
ui/UIEditBox/UIEditBoxImpl-mac.mm
ui/UIEditBox/Mac/CCUIEditBoxMac.mm
ui/UIEditBox/Mac/CCUIMultilineTextField.m
ui/UIEditBox/Mac/CCUIPasswordTextField.m
ui/UIEditBox/Mac/CCUISingleLineTextField.m
ui/UIEditBox/Mac/CCUITextFieldFormatter.m
)
elseif(IOS)
set(COCOS_UI_SPECIFIC_SRC
ui/UIWebView.mm
ui/UIVideoPlayer-ios.mm
ui/UIWebViewImpl-ios.mm
ui/UIEditBox/UIEditBoxImpl-ios.mm
ui/UIEditBox/iOS/CCUIEditBoxIOS.mm
ui/UIEditBox/iOS/CCUIMultilineTextField.mm
ui/UIEditBox/iOS/CCUISingleLineTextField.mm
ui/UIEditBox/iOS/UITextField+CCUITextInput.mm
ui/UIEditBox/iOS/UITextView+CCUITextInput.mm
)
endif()
elseif(LINUX)
set(COCOS_UI_SPECIFIC_SRC
ui/UIEditBox/UIEditBoxImpl-linux.cpp
)
elseif(ANDROID)
set(COCOS_UI_SPECIFIC_SRC
ui/UIEditBox/UIEditBoxImpl-android.cpp
ui/UIVideoPlayer-android.cpp
ui/UIWebViewImpl-android.cpp
# it's special for android, not a common file
ui/UIWebView.cpp
set(COCOS_UI_SPECIFIC_HEADER
ui/UIEditBox/UIEditBoxImpl-mac.h
ui/UIEditBox/Mac/CCUIPasswordTextField.h
ui/UIEditBox/Mac/CCUIMultilineTextField.h
ui/UIEditBox/Mac/CCUITextInput.h
ui/UIEditBox/Mac/CCUIEditBoxMac.h
ui/UIEditBox/Mac/CCUISingleLineTextField.h
ui/UIEditBox/Mac/CCUITextFieldFormatter.h
)
set(COCOS_UI_SPECIFIC_SRC
ui/UIEditBox/UIEditBoxImpl-mac.mm
ui/UIEditBox/Mac/CCUIEditBoxMac.mm
ui/UIEditBox/Mac/CCUIMultilineTextField.m
ui/UIEditBox/Mac/CCUIPasswordTextField.m
ui/UIEditBox/Mac/CCUISingleLineTextField.m
ui/UIEditBox/Mac/CCUITextFieldFormatter.m
)
elseif(IOS)
set(COCOS_UI_SPECIFIC_HEADER
ui/UIWebView.h
ui/UIVideoPlayer.h
ui/UIWebViewImpl-ios.h
ui/UIEditBox/UIEditBoxImpl-ios.h
ui/UIEditBox/iOS/CCUIEditBoxIOS.h
ui/UIEditBox/iOS/CCUIMultilineTextField.h
ui/UIEditBox/iOS/CCUITextInput.h
ui/UIEditBox/iOS/UITextView+CCUITextInput.h
ui/UIEditBox/iOS/UITextField+CCUITextInput.h
ui/UIEditBox/iOS/CCUISingleLineTextField.h
)
set(COCOS_UI_SPECIFIC_SRC
ui/UIWebView.mm
ui/UIVideoPlayer-ios.mm
ui/UIWebViewImpl-ios.mm
ui/UIEditBox/UIEditBoxImpl-ios.mm
ui/UIEditBox/iOS/CCUIEditBoxIOS.mm
ui/UIEditBox/iOS/CCUIMultilineTextField.mm
ui/UIEditBox/iOS/CCUISingleLineTextField.mm
ui/UIEditBox/iOS/UITextField+CCUITextInput.mm
ui/UIEditBox/iOS/UITextView+CCUITextInput.mm
)
endif()
elseif(LINUX)
set(COCOS_UI_SPECIFIC_HEADER
ui/UIEditBox/UIEditBoxImpl-linux.h
)
set(COCOS_UI_SPECIFIC_SRC
ui/UIEditBox/UIEditBoxImpl-linux.cpp
)
elseif(ANDROID)
set(COCOS_UI_SPECIFIC_HEADER
ui/UIWebView.h
ui/UIVideoPlayer.h
ui/UIWebViewImpl-android.h
ui/UIEditBox/UIEditBoxImpl-android.h
)
set(COCOS_UI_SPECIFIC_SRC
ui/UIEditBox/UIEditBoxImpl-android.cpp
ui/UIVideoPlayer-android.cpp
ui/UIWebViewImpl-android.cpp
# it's special for android, not a common file
ui/UIWebView.cpp
)
endif()
#todo: android UIWebViewImpl and UIVideoPlayer
# will add when doing android support
set(COCOS_UI_HEADER
${COCOS_UI_SPECIFIC_HEADER}
ui/CocosGUI.h
ui/GUIDefine.h
ui/GUIExport.h
ui/UIAbstractCheckButton.h
ui/UIButton.h
ui/UICheckBox.h
ui/UIDeprecated.h
ui/UIHBox.h
ui/UIHelper.h
ui/UIImageView.h
ui/UILayout.h
ui/UILayoutComponent.h
ui/UILayoutManager.h
ui/UILayoutParameter.h
ui/UIListView.h
ui/UILoadingBar.h
ui/UIPageView.h
ui/UIPageViewIndicator.h
ui/UIRadioButton.h
ui/UIRelativeBox.h
ui/UIRichText.h
ui/UIScale9Sprite.h
ui/UIScrollView.h
ui/UIScrollViewBar.h
ui/UISlider.h
ui/UITabControl.h
ui/UIText.h
ui/UITextAtlas.h
ui/UITextBMFont.h
ui/UITextField.h
ui/UIVBox.h
ui/UIWidget.h
)
set(COCOS_UI_SRC
${COCOS_UI_SPECIFIC_SRC}
ui/CocosGUI.cpp
ui/UIButton.cpp
ui/UIAbstractCheckButton.cpp
@ -81,6 +147,4 @@ set(COCOS_UI_SRC
ui/UILayoutComponent.cpp
ui/UIEditBox/UIEditBoxImpl-common.cpp
ui/UITabControl.cpp
${COCOS_UI_SPECIFIC_SRC}
)

View File

@ -1,5 +1,11 @@
set(COCOS_VR_SRC)
if(NOT IOS)
set(COCOS_VR_HEADER
vr/CCVRGenericHeadTracker.h
vr/CCVRDistortion.h
vr/CCVRProtocol.h
vr/CCVRGenericRenderer.h
vr/CCVRDistortionMesh.h
)
set(COCOS_VR_SRC
vr/CCVRDistortion.cpp
vr/CCVRDistortionMesh.cpp

View File

@ -2,8 +2,184 @@ if(WINDOWS AND BUILD_SHARED_LIBS)
ADD_DEFINITIONS (-D_USREXDLL)
endif()
include_directories(
../../extensions
set(COCOS_EXTENSIONS_HEADER
../extensions/ExtensionMacros.h
../extensions/assets-manager/AssetsManagerEx.h
../extensions/assets-manager/Manifest.h
../extensions/assets-manager/CCEventListenerAssetsManagerEx.h
../extensions/assets-manager/AssetsManager.h
../extensions/assets-manager/CCEventAssetsManagerEx.h
../extensions/physics-nodes/CCPhysicsSprite.h
../extensions/physics-nodes/CCPhysicsDebugNode.h
../extensions/Particle3D/CCParticleSystem3D.h
../extensions/Particle3D/PU/CCPUDoExpireEventHandler.h
../extensions/Particle3D/PU/CCPUParticleSystem3D.h
../extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h
../extensions/Particle3D/PU/CCPUAffectorManager.h
../extensions/Particle3D/PU/CCPUTechniqueTranslator.h
../extensions/Particle3D/PU/CCPURender.h
../extensions/Particle3D/PU/CCPUObserver.h
../extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h
../extensions/Particle3D/PU/CCPUAlignAffector.h
../extensions/Particle3D/PU/CCPUSphereColliderTranslator.h
../extensions/Particle3D/PU/CCPUAffectorTranslator.h
../extensions/Particle3D/PU/CCPUTextureRotator.h
../extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h
../extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h
../extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h
../extensions/Particle3D/PU/CCPURandomiser.h
../extensions/Particle3D/PU/CCPUBoxCollider.h
../extensions/Particle3D/PU/CCPUScriptCompiler.h
../extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h
../extensions/Particle3D/PU/CCPUOnRandomObserver.h
../extensions/Particle3D/PU/CCPUOnCollisionObserver.h
../extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h
../extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h
../extensions/Particle3D/PU/CCPUEventHandlerTranslator.h
../extensions/Particle3D/PU/CCPULineEmitterTranslator.h
../extensions/Particle3D/PU/CCPUMaterialTranslator.h
../extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h
../extensions/Particle3D/PU/CCPUEmitterTranslator.h
../extensions/Particle3D/PU/CCPUOnCountObserver.h
../extensions/Particle3D/PU/CCPUScriptParser.h
../extensions/Particle3D/PU/CCPUOnEmissionObserver.h
../extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h
../extensions/Particle3D/PU/CCPURibbonTrailRender.h
../extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h
../extensions/Particle3D/PU/CCPUDoScaleEventHandler.h
../extensions/Particle3D/PU/CCPUScriptTranslator.h
../extensions/Particle3D/PU/CCPURandomiserTranslator.h
../extensions/Particle3D/PU/CCPUBoxEmitter.h
../extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h
../extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h
../extensions/Particle3D/PU/CCPUUtil.h
../extensions/Particle3D/PU/CCPUListener.h
../extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h
../extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h
../extensions/Particle3D/PU/CCPUInterParticleCollider.h
../extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h
../extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h
../extensions/Particle3D/PU/CCPUGeometryRotator.h
../extensions/Particle3D/PU/CCPUOnEventFlagObserver.h
../extensions/Particle3D/PU/CCPULinearForceAffector.h
../extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h
../extensions/Particle3D/PU/CCPUBillboardChain.h
../extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h
../extensions/Particle3D/PU/CCPUParticleFollower.h
../extensions/Particle3D/PU/CCPUPositionEmitter.h
../extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h
../extensions/Particle3D/PU/CCPUPlaneCollider.h
../extensions/Particle3D/PU/CCPUBehaviour.h
../extensions/Particle3D/PU/CCPUOnQuotaObserver.h
../extensions/Particle3D/PU/CCPULineAffectorTranslator.h
../extensions/Particle3D/PU/CCPUJetAffectorTranslator.h
../extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h
../extensions/Particle3D/PU/CCPUForceFieldAffector.h
../extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h
../extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h
../extensions/Particle3D/PU/CCPUAffector.h
../extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h
../extensions/Particle3D/PU/CCPUEmitterManager.h
../extensions/Particle3D/PU/CCPUObserverTranslator.h
../extensions/Particle3D/PU/CCPUBaseCollider.h
../extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h
../extensions/Particle3D/PU/CCPUBaseColliderTranslator.h
../extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h
../extensions/Particle3D/PU/CCPUVertexEmitter.h
../extensions/Particle3D/PU/CCPUMaterialManager.h
../extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h
../extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h
../extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h
../extensions/Particle3D/PU/CCPUEmitter.h
../extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h
../extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h
../extensions/Particle3D/PU/CCPUSimpleSpline.h
../extensions/Particle3D/PU/CCPUFlockCenteringAffector.h
../extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h
../extensions/Particle3D/PU/CCPULineEmitter.h
../extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h
../extensions/Particle3D/PU/CCPUTextureAnimator.h
../extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h
../extensions/Particle3D/PU/CCPUCircleEmitter.h
../extensions/Particle3D/PU/CCPUSlaveBehaviour.h
../extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h
../extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h
../extensions/Particle3D/PU/CCPUScriptLexer.h
../extensions/Particle3D/PU/CCPUOnExpireObserver.h
../extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h
../extensions/Particle3D/PU/CCPURibbonTrail.h
../extensions/Particle3D/PU/CCPUColorAffectorTranslator.h
../extensions/Particle3D/PU/CCPUEventHandler.h
../extensions/Particle3D/PU/CCPUNoise.h
../extensions/Particle3D/PU/CCPUEventHandlerManager.h
../extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h
../extensions/Particle3D/PU/CCPUColorAffector.h
../extensions/Particle3D/PU/CCPUScaleVelocityAffector.h
../extensions/Particle3D/PU/CCPUDynamicAttribute.h
../extensions/Particle3D/PU/CCPUSphere.h
../extensions/Particle3D/PU/CCPUSlaveEmitter.h
../extensions/Particle3D/PU/CCPUBaseForceAffector.h
../extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h
../extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h
../extensions/Particle3D/PU/CCPUGravityAffector.h
../extensions/Particle3D/PU/CCPUBeamRender.h
../extensions/Particle3D/PU/CCPUOnClearObserver.h
../extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h
../extensions/Particle3D/PU/CCPUJetAffector.h
../extensions/Particle3D/PU/CCPUSphereCollider.h
../extensions/Particle3D/PU/CCPUPathFollowerTranslator.h
../extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h
../extensions/Particle3D/PU/CCPUPointEmitter.h
../extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h
../extensions/Particle3D/PU/CCPUPlane.h
../extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h
../extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h
../extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h
../extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h
../extensions/Particle3D/PU/CCPULineAffector.h
../extensions/Particle3D/PU/CCPUSineForceAffector.h
../extensions/Particle3D/PU/CCPUPathFollower.h
../extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h
../extensions/Particle3D/PU/CCPUObserverManager.h
../extensions/Particle3D/PU/CCPUBoxColliderTranslator.h
../extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h
../extensions/Particle3D/PU/CCPUOnVelocityObserver.h
../extensions/Particle3D/PU/CCPUScaleAffector.h
../extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h
../extensions/Particle3D/PU/CCPUPointEmitterTranslator.h
../extensions/Particle3D/PU/CCPUVortexAffector.h
../extensions/Particle3D/PU/CCPUTranslateManager.h
../extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h
../extensions/Particle3D/PU/CCPUOnTimeObserver.h
../extensions/Particle3D/PU/CCPUBehaviourManager.h
../extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h
../extensions/Particle3D/PU/CCPURendererTranslator.h
../extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h
../extensions/Particle3D/PU/CCPUBehaviourTranslator.h
../extensions/Particle3D/PU/CCPUForceField.h
../extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h
../extensions/Particle3D/PU/CCPUOnPositionObserver.h
../extensions/Particle3D/CCParticle3DEmitter.h
../extensions/Particle3D/CCParticle3DAffector.h
../extensions/Particle3D/CCParticle3DRender.h
../extensions/cocos-ext.h
../extensions/GUI/CCControlExtension/CCControlHuePicker.h
../extensions/GUI/CCControlExtension/CCControlUtils.h
../extensions/GUI/CCControlExtension/CCControl.h
../extensions/GUI/CCControlExtension/CCControlExtensions.h
../extensions/GUI/CCControlExtension/CCControlColourPicker.h
../extensions/GUI/CCControlExtension/CCControlButton.h
../extensions/GUI/CCControlExtension/CCInvocation.h
../extensions/GUI/CCControlExtension/CCControlSlider.h
../extensions/GUI/CCControlExtension/CCControlStepper.h
../extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h
../extensions/GUI/CCControlExtension/CCControlPotentiometer.h
../extensions/GUI/CCControlExtension/CCControlSwitch.h
../extensions/GUI/CCScrollView/CCTableViewCell.h
../extensions/GUI/CCScrollView/CCScrollView.h
../extensions/GUI/CCScrollView/CCTableView.h
../extensions/ExtensionDeprecated.h
../extensions/ExtensionExport.h
)
set(COCOS_EXTENSIONS_SRC
@ -180,5 +356,4 @@ set(COCOS_EXTENSIONS_SRC
../extensions/Particle3D/PU/CCPUBehaviourTranslator.cpp
../extensions/Particle3D/PU/CCPUSlaveBehaviour.cpp
../extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.cpp
${PLATFORM_EXTENSIONS_SRC}
)

View File

@ -40,87 +40,102 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
endif()
endif()
# mark app resources
set(res_res_folders
# record sources, headers, resources...
set(GAME_SOURCE)
set(GAME_HEADER)
set(GAME_RES_FOLDER
"${CMAKE_CURRENT_SOURCE_DIR}/Resources"
)
if(APPLE OR VS)
cocos_mark_multi_resources(cc_common_res RES_TO "Resources" FOLDERS ${res_res_folders})
if(APPLE OR WINDOWS)
cocos_mark_multi_resources(common_res_files RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER})
endif()
include_directories(
${COCOS2DX_ROOT_PATH}/cocos/audio/include/
Classes
${COCOS2DX_ROOT_PATH}/cocos/audio/include/
)
# add cross-platforms source files and header files
set(common_code_files
list(APPEND GAME_SOURCE
Classes/AppDelegate.cpp
Classes/HelloWorldScene.cpp
)
set(common_header_files
list(APPEND GAME_HEADER
Classes/AppDelegate.h
Classes/HelloWorldScene.h
)
# add platform specific source files, save to platform_specific_src
if(ANDROID)
# change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml
set(APP_NAME MyGame)
set(platform_specific_src proj.android/app/jni/hellocpp/main.cpp)
elseif(LINUX)
set(platform_specific_src proj.linux/main.cpp)
elseif(WINDOWS)
set(windows_src
proj.win32/main.cpp
proj.win32/game.rc
list(APPEND GAME_SOURCE
proj.android/app/jni/hellocpp/main.cpp
)
set(platform_specific_header
elseif(LINUX)
list(APPEND GAME_SOURCE
proj.linux/main.cpp
)
elseif(WINDOWS)
list(APPEND GAME_HEADER
proj.win32/main.h
proj.win32/resource.h
)
set(platform_specific_src ${cc_common_res} ${windows_src})
list(APPEND GAME_SOURCE
proj.win32/main.cpp
proj.win32/game.rc
${common_res_files}
)
elseif(APPLE)
if(IOS)
set(ios_code_files
list(APPEND GAME_HEADER
proj.ios_mac/ios/AppController.h
proj.ios_mac/ios/RootViewController.h
)
set(APP_UI_RES
proj.ios_mac/ios/Info.plist
proj.ios_mac/ios/exportoptions.plist
proj.ios_mac/ios/LaunchScreen.storyboard
proj.ios_mac/ios/LaunchScreenBackground.png
proj.ios_mac/ios/Images.xcassets
)
list(APPEND GAME_SOURCE
proj.ios_mac/ios/main.m
proj.ios_mac/ios/AppController.mm
proj.ios_mac/ios/RootViewController.mm
proj.ios_mac/ios/Prefix.pch
${APP_UI_RES}
)
set(ios_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/LaunchScreen.storyboard
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/LaunchScreenBackground.png
)
cocos_mark_multi_resources(ios_res_files RES_TO "Resources" FILES ${ios_res_files})
set(apple_src_files ${ios_code_files} ${ios_res_files})
elseif(MACOSX)
set(mac_code_files proj.ios_mac/mac/main.cpp)
set(mac_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Icon.icns
set(APP_UI_RES
proj.ios_mac/mac/Icon.icns
proj.ios_mac/mac/Info.plist
)
list(APPEND GAME_SOURCE
proj.ios_mac/mac/main.cpp
proj.ios_mac/mac/Prefix.pch
${APP_UI_RES}
)
cocos_mark_multi_resources(mac_res_files RES_TO "Resources" FILES ${mac_res_files})
set(apple_src_files ${mac_res_files} ${mac_code_files})
endif()
set(platform_specific_src ${cc_common_res} ${apple_src_files})
else()
message(FATAL_ERROR "Unsupported platform, CMake will exit" )
list(APPEND GAME_SOURCE ${common_res_files})
endif()
# mark app complie info and libs info
set(cocos_app_src
${platform_specific_src}
${common_header_files}
${common_code_files}
${common_header_files}
${common_code_files}
set(APP_SRC
${GAME_SOURCE}
${GAME_HEADER}
)
cocos_build_app(${APP_NAME}
APP_SRC "${cocos_app_src}"
APP_SRC "${APP_SRC}"
DEPEND_COMMON_LIBS "cocos2d"
DEPEND_ANDROID_LIBS "cocos2d_android"
)
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
cocos_pak_xcode(${APP_NAME} BUNDLE_NAME "Cpp Hello Test")
set_target_properties(${APP_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist"
)
elseif(IOS)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
endif()
@ -129,5 +144,5 @@ elseif(WINDOWS)
endif()
if(LINUX OR WINDOWS)
cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${res_res_folders})
cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
endif()

View File

@ -66,6 +66,10 @@ if(APPLE OR VS)
set(cc_common_res ${res_main} ${res_res} ${res_src} ${res_script})
endif()
# record sources, headers
set(GAME_SOURCE ${RUNTIME_SRC_ROOT}/Classes/AppDelegate.cpp)
set(GAME_HEADER ${RUNTIME_SRC_ROOT}/Classes/AppDelegate.h)
# sources need to compile info, include dirs and source files
include_directories(
${RUNTIME_SRC_ROOT}/Classes
@ -73,59 +77,70 @@ include_directories(
${COCOS2DX_ROOT_PATH}/external/spidermonkey/include/${PLATFORM_FOLDER}
)
set(GAME_SRC ${RUNTIME_SRC_ROOT}/Classes/AppDelegate.cpp)
if(ANDROID)
# change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml
set(APP_NAME cocos2djs)
list(APPEND GAME_SRC ${RUNTIME_SRC_ROOT}/proj.android/app/jni/hellojavascript/main.cpp)
list(APPEND GAME_SOURCE ${RUNTIME_SRC_ROOT}/proj.android/app/jni/hellojavascript/main.cpp)
elseif(LINUX)
list(APPEND GAME_SRC ${RUNTIME_SRC_ROOT}/proj.linux/main.cpp)
list(APPEND GAME_SOURCE ${RUNTIME_SRC_ROOT}/proj.linux/main.cpp)
elseif(WINDOWS)
set(WINDOWS_SRC ${RUNTIME_SRC_ROOT}/proj.win32/main.cpp)
list(APPEND WINDOWS_SRC ${RUNTIME_SRC_ROOT}/proj.win32/game.rc)
set(PLATFORM_SPECIFIC_HEADERS
list(APPEND GAME_HEADER
${RUNTIME_SRC_ROOT}/proj.win32/main.h
${RUNTIME_SRC_ROOT}/proj.win32/resource.h
)
list(APPEND GAME_SRC ${WINDOWS_SRC} ${PLATFORM_SPECIFIC_HEADERS} ${cc_common_res})
list(APPEND GAME_SOURCE ${WINDOWS_SRC} ${cc_common_res})
elseif(APPLE)
if(IOS)
set(ios_code_files
list(APPEND GAME_HEADER
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/AppController.h
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/RootViewController.h
)
set(APP_UI_RES
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/Info.plist
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/exportoptions.plist
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreen.storyboard
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreenBackground.png
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/Images.xcassets
)
list(APPEND GAME_SOURCE
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/main.m
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/AppController.mm
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/RootViewController.mm
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/Prefix.pch
${APP_UI_RES}
)
set(ios_res_files
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreen.storyboard
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreenBackground.png
)
cocos_mark_multi_resources(ios_res_files RES_TO "Resources" FILES ${ios_res_files})
set(apple_src_files ${ios_code_files} ${ios_res_files})
elseif(MACOSX)
set(mac_code_files ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/main.cpp)
set(mac_res_files
set(APP_UI_RES
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Icon.icns
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Info.plist
)
list(APPEND GAME_SOURCE
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/main.cpp
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Prefix.pch
${APP_UI_RES}
)
cocos_mark_multi_resources(mac_res_files RES_TO "Resources" FILES ${mac_res_files})
set(apple_src_files ${mac_res_files} ${mac_code_files})
endif()
list(APPEND GAME_SRC ${apple_src_files} ${cc_common_res})
else()
message(FATAL_ERROR "Unsupported platform, CMake will exit" )
list(APPEND GAME_SOURCE ${cc_common_res})
endif()
set(APP_SRC ${GAME_HEADER} ${GAME_SOURCE})
# mark app complie info and libs info
cocos_build_app(${APP_NAME}
APP_SRC "${GAME_SRC}"
APP_SRC "${APP_SRC}"
DEPEND_COMMON_LIBS "jscocos2d" "cocos2d"
DEPEND_ANDROID_LIBS "cocos2d_android"
)
# mark app resources, resource will be copy auto after mark
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
cocos_pak_xcode(${APP_NAME} BUNDLE_NAME "LuaTestsApp")
set_target_properties(${APP_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Info.plist"
)
elseif(IOS)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
endif()

View File

@ -25,7 +25,7 @@ android {
else if (PROP_NDK_MODE == 'cmake') {
cmake {
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \
"-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DUSE_JSCOCOS2D=TRUE"
"-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DBUILD_JS_LIBS=TRUE"
cppFlags "-frtti -fexceptions"
// prebuilt root must be defined as a directory which you have right to access or create if you use prebuilt
// set "-DGEN_COCOS_PREBUILT=ON" and "-DUSE_COCOS_PREBUILT=OFF" to generate prebuilt, this way build cocos2d-x libs

View File

@ -37,7 +37,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
CocosBuildSet()
if(NOT USE_COCOS_PREBUILT)
set(BUILD_LUA_LIBS ON)
set(USE_SIMULATOR ON)
set(BUILD_SIMU_LIB ON)
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
endif()
endif()
@ -59,6 +59,9 @@ if(APPLE OR VS)
set(cc_common_res ${res_res} ${res_src} ${res_script})
endif()
# record sources, headers
set(GAME_HEADER ${RUNTIME_SRC_ROOT}/Classes/AppDelegate.h)
set(GAME_SOURCE ${RUNTIME_SRC_ROOT}/Classes/AppDelegate.cpp)
# sources need to compile info, include dirs and source files
include_directories(
${RUNTIME_SRC_ROOT}/Classes
@ -68,16 +71,22 @@ include_directories(
${COCOS2DX_ROOT_PATH}/external/lua/tolua
${COCOS2DX_ROOT_PATH}/tools/simulator/libsimulator/lib
)
set(GAME_SRC ${RUNTIME_SRC_ROOT}/Classes/AppDelegate.cpp)
if(ANDROID)
# change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml
set(APP_NAME cocos2dlua)
list(APPEND GAME_SRC ${RUNTIME_SRC_ROOT}/proj.android/app/jni/hellolua/main.cpp)
list(APPEND GAME_SOURCE ${RUNTIME_SRC_ROOT}/proj.android/app/jni/hellolua/main.cpp)
elseif(LINUX)
list(APPEND GAME_SRC ${RUNTIME_SRC_ROOT}/proj.linux/main.cpp)
list(APPEND GAME_SOURCE ${RUNTIME_SRC_ROOT}/proj.linux/main.cpp)
elseif(WINDOWS)
add_definitions(-D_USRLUASTATIC -D_USRLIBSIMSTATIC)
list(APPEND GAME_SRC
list(APPEND GAME_HEADER
${RUNTIME_SRC_ROOT}/proj.win32/main.h
${RUNTIME_SRC_ROOT}/proj.win32/stdafx.h
${RUNTIME_SRC_ROOT}/proj.win32/SimulatorWin.h
${RUNTIME_SRC_ROOT}/proj.win32/targetver.h
${RUNTIME_SRC_ROOT}/proj.win32/resource.h
)
list(APPEND GAME_SOURCE
${RUNTIME_SRC_ROOT}/proj.win32/game.rc
${RUNTIME_SRC_ROOT}/proj.win32/stdafx.cpp
${RUNTIME_SRC_ROOT}/proj.win32/main.cpp
@ -86,46 +95,54 @@ elseif(WINDOWS)
)
elseif(APPLE)
if(IOS)
set(ios_code_files
list(APPEND GAME_HEADER
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/AppController.h
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/RootViewController.h
)
set(APP_UI_RES
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/Info.plist
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/exportoptions.plist
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreen.storyboard
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreenBackground.png
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/Images.xcassets
)
list(APPEND GAME_SOURCE
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/main.m
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/AppController.mm
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/RootViewController.mm
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/Prefix.pch
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/build-cfg.json
${APP_UI_RES}
)
set(ios_res_files
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreen.storyboard
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreenBackground.png
)
cocos_mark_multi_resources(ios_res_files RES_TO "Resources" FILES ${ios_res_files})
set(APPLE_RES_UI ${ios_code_files} ${ios_res_files})
elseif(MACOSX)
set(MAC_SRC
list(APPEND GAME_HEADER
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/SimulatorApp.h
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/ConsoleWindowController.h
)
set(APP_UI_RES
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Base.lproj/MainMenu.xib
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/en.lproj/MainMenu.xib
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/zh-Hans.lproj/MainMenu.xib
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/ConsoleWindow.xib
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Icon.icns
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Info.plist
)
list(APPEND GAME_SOURCE
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/main.m
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/SimulatorApp.mm
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/ConsoleWindowController.m
${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Prefix.pch
${APP_UI_RES}
)
file(GLOB_RECURSE RES_ICON ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Icon.icns)
cocos_mark_resources(FILES ${RES_ICON} BASEDIR ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac)
# special for lua-template
file(GLOB_RECURSE RES_MAIN_BASE ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Base.lproj/MainMenu.xib)
cocos_mark_resources(FILES ${RES_MAIN_BASE} BASEDIR ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac)
file(GLOB_RECURSE RES_MAIN_EN ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/en.lproj/MainMenu.xib)
cocos_mark_resources(FILES ${RES_MAIN_EN} BASEDIR ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac)
file(GLOB_RECURSE RES_MAIN_ZH ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/zh-Hans.lproj/MainMenu.xib)
cocos_mark_resources(FILES ${RES_MAIN_ZH} BASEDIR ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac)
file(GLOB_RECURSE RES_CONSOLE ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/ConsoleWindow.xib)
cocos_mark_resources(FILES ${RES_CONSOLE} BASEDIR ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac)
set(APPLE_SRC ${MAC_SRC} ${RES_ICON} ${RES_MAIN_BASE} ${RES_MAIN_EN} ${RES_MAIN_ZH} ${RES_CONSOLE})
# xib -> nib, need mark resources
set(APPLE_RES_UI ${RES_MAIN_BASE} ${RES_MAIN_EN} ${RES_MAIN_ZH} ${RES_CONSOLE})
endif()
list(APPEND GAME_SRC ${APPLE_SRC} ${cc_common_res})
else()
message(FATAL_ERROR "Unsupported platform, CMake will exit" )
list(APPEND GAME_SOURCE ${cc_common_res})
endif()
set(APP_SRC ${GAME_HEADER} ${GAME_SOURCE})
# mark app complie info and libs info
cocos_build_app(${APP_NAME}
APP_SRC "${GAME_SRC}"
APP_SRC "${APP_SRC}"
DEPEND_COMMON_LIBS "luacocos2d" "cocos2d"
DEPEND_ANDROID_LIBS "cocos2d_android"
DEPEND_MACOSX_LIBS "simulator"
@ -134,11 +151,11 @@ cocos_build_app(${APP_NAME}
# mark app resources
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES
RESOURCE "${APPLE_RES_UI}"
MACOSX_BUNDLE_INFO_PLIST "${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Info.plist"
)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "MacOSXBundleInfo.LuaTemplate.plist.in" BUNDLE_NAME "LuaTestsApp")
elseif(IOS)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
endif()

View File

@ -25,7 +25,7 @@ android {
else if (PROP_NDK_MODE == 'cmake') {
cmake {
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \
"-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DUSE_LUACOCOS2D=TRUE"
"-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DBUILD_LUA_LIBS=TRUE"
cppFlags "-frtti -fexceptions"
// prebuilt root must be defined as a directory which you have right to access or create if you use prebuilt
// set "-DGEN_COCOS_PREBUILT=ON" and "-DUSE_COCOS_PREBUILT=OFF" to generate prebuilt, this way build cocos2d-x libs

View File

@ -38,58 +38,84 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
endif()
endif()
set(common_code_files
# record sources, headers, resources...
set(GAME_SOURCE)
set(GAME_HEADER)
set(GAME_RES_FOLDER
"${CMAKE_CURRENT_SOURCE_DIR}/Resources"
)
if(APPLE OR VS)
cocos_mark_multi_resources(cc_common_res RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER})
endif()
list(APPEND GAME_HEADER
Classes/AppMacros.h
Classes/HelloWorldScene.h
Classes/AppDelegate.h
)
list(APPEND GAME_SOURCE
Classes/AppDelegate.cpp
Classes/HelloWorldScene.cpp
)
set(res_res_folders
"${CMAKE_CURRENT_SOURCE_DIR}/Resources"
)
if(APPLE OR VS)
cocos_mark_multi_resources(cc_common_res RES_TO "Resources" FOLDERS ${res_res_folders})
endif()
if(ANDROID)
set(platform_specific_src proj.android/app/jni/main.cpp)
list(APPEND GAME_SOURCE
proj.android/app/jni/main.cpp
)
elseif(LINUX)
set(platform_specific_src proj.linux/main.cpp)
list(APPEND GAME_SOURCE
proj.linux/main.cpp
)
elseif(WINDOWS)
set(windows_src proj.win32/main.cpp)
set(platform_specific_src ${cc_common_res} ${windows_src})
list(APPEND GAME_HEADER
proj.win32/main.h
)
list(APPEND GAME_SOURCE
proj.win32/main.cpp
${cc_common_res}
)
elseif(APPLE)
if(IOS)
set(ios_code_files
list(APPEND GAME_HEADER
proj.ios/AppController.h
proj.ios/RootViewController.h
)
set(APP_UI_RES
proj.ios/Info.plist
proj.ios/exportoptions.plist
proj.ios/LaunchScreen.storyboard
proj.ios/LaunchScreenBackground.png
proj.ios/Images.xcassets
)
list(APPEND GAME_SOURCE
proj.ios/main.m
proj.ios/AppController.mm
proj.ios/RootViewController.mm
${APP_UI_RES}
)
set(ios_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/LaunchScreen.storyboard
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/LaunchScreenBackground.png
)
cocos_mark_multi_resources(ios_res_files RES_TO "Resources" FILES ${ios_res_files})
set(apple_src_files ${ios_code_files} ${ios_res_files})
elseif(MACOSX)
set(mac_code_files proj.mac/main.cpp)
set(mac_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Icon.icns
set(APP_UI_RES
proj.mac/Icon.icns
proj.mac/Info.plist
proj.mac/en.lproj/MainMenu.xib
proj.mac/en.lproj/InfoPlist.strings
)
list(APPEND GAME_SOURCE
proj.mac/main.cpp
${APP_UI_RES}
)
cocos_mark_multi_resources(mac_res_files RES_TO "Resources" FILES ${mac_res_files})
set(apple_src_files ${mac_res_files} ${mac_code_files})
endif()
set(platform_specific_src ${cc_common_res} ${apple_src_files})
else()
message(FATAL_ERROR "Unsupported platform, CMake will exit" )
list(APPEND GAME_SOURCE ${cc_common_res})
endif()
include_directories(Classes)
set(all_code_files
${platform_specific_src}
${common_code_files}
${GAME_HEADER}
${GAME_SOURCE}
)
include_directories(Classes)
# mark app complie info and libs info
cocos_build_app(${APP_NAME}
APP_SRC "${all_code_files}"
@ -99,8 +125,11 @@ cocos_build_app(${APP_NAME}
# mark app resources
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
cocos_pak_xcode(${APP_NAME} BUNDLE_NAME "Cpp Empty Test")
set_target_properties(${APP_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist"
)
elseif(IOS)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
endif()
@ -109,5 +138,5 @@ elseif(WINDOWS)
endif()
if(LINUX OR WINDOWS)
cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${res_res_folders})
cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
endif()

View File

@ -15,51 +15,206 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
endif()
endif()
set(res_res_folders
# record sources, headers, resources...
set(GAME_SOURCE)
set(GAME_HEADER)
set(GAME_RES_FOLDER
"${CMAKE_CURRENT_SOURCE_DIR}/Resources"
)
if(APPLE OR VS)
cocos_mark_multi_resources(cc_common_res RES_TO "Resources" FOLDERS ${res_res_folders})
cocos_mark_multi_resources(cc_common_res RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER})
endif()
if(WINDOWS)
set(windows_src proj.win32/main.cpp)
set(platform_specific_src ${cc_common_res} ${windows_src})
if(ANDROID)
list(APPEND GAME_HEADER
Classes/JNITest/JNITest.h
)
list(APPEND GAME_SOURCE
Classes/JNITest/JNITest.cpp
proj.android/app/jni/main.cpp
)
elseif(LINUX)
list(APPEND GAME_SOURCE
proj.linux/main.cpp
)
elseif(WINDOWS)
list(APPEND GAME_HEADER
proj.win32/main.h
)
list(APPEND GAME_SOURCE
proj.win32/main.cpp
${cc_common_res}
)
elseif(APPLE)
if(IOS)
set(ios_code_files
list(APPEND GAME_HEADER
proj.ios/Classes/testsAppDelegate.h
proj.ios/Classes/RootViewController.h
)
set(APP_UI_RES
proj.ios/Info.plist
proj.ios/exportoptions.plist
proj.ios/LaunchScreen.storyboard
proj.ios/LaunchScreenBackground.png
proj.ios/Images.xcassets
)
list(APPEND GAME_SOURCE
proj.ios/main.m
proj.ios/Classes/testsAppDelegate.mm
proj.ios/Classes/RootViewController.mm
proj.ios/Prefix.pch
${APP_UI_RES}
)
set(ios_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/LaunchScreen.storyboard
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/LaunchScreenBackground.png
)
cocos_mark_multi_resources(ios_res_files RES_TO "Resources" FILES ${ios_res_files})
set(apple_src_files ${ios_code_files} ${ios_res_files})
elseif(MACOSX)
set(mac_code_files proj.mac/main.cpp)
set(mac_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Icon.icns
set(APP_UI_RES
proj.mac/Icon.icns
proj.mac/Info.plist
proj.mac/Prefix.pch
proj.mac/en.lproj/MainMenu.xib
proj.mac/en.lproj/InfoPlist.strings
)
list(APPEND GAME_SOURCE
proj.mac/main.cpp
${APP_UI_RES}
)
cocos_mark_multi_resources(mac_res_files RES_TO "Resources" FILES ${mac_res_files})
set(apple_src_files ${mac_res_files} ${mac_code_files})
endif()
set(platform_specific_src ${cc_common_res} ${apple_src_files})
elseif(LINUX)
set(platform_specific_src proj.linux/main.cpp)
elseif(ANDROID)
set(platform_specific_src
Classes/JNITest/JNITest.cpp
proj.android/app/jni/main.cpp)
elseif(IOS)
set(platform_specific_src proj.ios/main.m)
else()
message( FATAL_ERROR "Unsupported platform, CMake will exit" )
list(APPEND GAME_SOURCE ${cc_common_res})
endif()
set(TESTS_SRC
list(APPEND GAME_HEADER
Classes/ActionsEaseTest/ActionsEaseTest.h
Classes/ParallaxTest/ParallaxTest.h
Classes/testBasic.h
Classes/ZwoptexTest/ZwoptexTest.h
Classes/precheader.h
Classes/CurlTest/CurlTest.h
Classes/UnitTest/UnitTest.h
Classes/UnitTest/RefPtrTest.h
Classes/ConfigurationTest/ConfigurationTest.h
Classes/PhysicsTest/PhysicsTest.h
Classes/CurrentLanguageTest/CurrentLanguageTest.h
Classes/AppDelegate.h
Classes/LabelTest/LabelTestNew.h
Classes/LabelTest/LabelTest.h
Classes/Particle3DTest/Particle3DTest.h
Classes/AllocatorTest/AllocatorTest.h
Classes/VibrateTest/VibrateTest.h
Classes/ClippingNodeTest/ClippingNodeTest.h
Classes/UserDefaultTest/UserDefaultTest.h
Classes/tests.h
Classes/DataVisitorTest/DataVisitorTest.h
Classes/NewAudioEngineTest/NewAudioEngineTest.h
Classes/BugsTest/Bug-422.h
Classes/BugsTest/Bug-CCDrawNode.h
Classes/BugsTest/BugsTest.h
Classes/BugsTest/Bug-12847.h
Classes/BugsTest/Bug-899.h
Classes/BugsTest/Bug-1159.h
Classes/BugsTest/Bug-350.h
Classes/BugsTest/Bug-15594.h
Classes/BugsTest/Bug-914.h
Classes/BugsTest/Bug-624.h
Classes/BugsTest/Bug-458/QuestionContainerSprite.h
Classes/BugsTest/Bug-458/Bug-458.h
Classes/BugsTest/Bug-886.h
Classes/BugsTest/Bug-Child.h
Classes/BugsTest/Bug-15776.h
Classes/BugsTest/Bug-1174.h
Classes/ActionsTest/ActionsTest.h
Classes/TouchesTest/TouchesTest.h
Classes/TouchesTest/Ball.h
Classes/TouchesTest/Paddle.h
Classes/ActionManagerTest/ActionManagerTest.h
Classes/ClickAndMoveTest/ClickAndMoveTest.h
Classes/MaterialSystemTest/MaterialSystemTest.h
Classes/IntervalTest/IntervalTest.h
Classes/TileMapTest/TileMapTest2.h
Classes/TileMapTest/TileMapTest.h
Classes/NewEventDispatcherTest/NewEventDispatcherTest.h
Classes/ActionsProgressTest/ActionsProgressTest.h
Classes/RotateWorldTest/RotateWorldTest.h
Classes/Camera3DTest/Camera3DTest.h
Classes/TextInputTest/TextInputTest.h
Classes/Texture2dTest/Texture2dTest.h
Classes/TerrainTest/TerrainTest.h
Classes/controller.h
Classes/TransitionsTest/TransitionsTest.h
Classes/TextureCacheTest/TextureCacheTest.h
Classes/MotionStreakTest/MotionStreakTest.h
Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h
Classes/ExtensionsTest/ExtensionsTest.h
Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h
Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h
Classes/ExtensionsTest/NetworkTest/WebSocketTest.h
Classes/ExtensionsTest/NetworkTest/SocketIOTest.h
Classes/ExtensionsTest/NetworkTest/HttpClientTest.h
Classes/Sprite3DTest/Sprite3DTest.h
Classes/Sprite3DTest/DrawNode3D.h
Classes/BaseTest.h
Classes/SceneTest/SceneTest.h
Classes/ReleasePoolTest/ReleasePoolTest.h
Classes/CocosDenshionTest/CocosDenshionTest.h
Classes/InputTest/MouseTest.h
Classes/SpineTest/SpineTest.h
Classes/Scene3DTest/Scene3DTest.h
Classes/ParticleTest/ParticleTest.h
Classes/EffectsTest/EffectsTest.h
Classes/UITest/UITest.h
Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h
Classes/UITest/CocoStudioGUITest/CocosGUIScene.h
Classes/UITest/CocoStudioGUITest/UITabControlTest/UITabControlTest.h
Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h
Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h
Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h
Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.h
Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h
Classes/UITest/CocoStudioGUITest/UIEditBoxTest.h
Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.h
Classes/UITest/CocoStudioGUITest/UIScene.h
Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h
Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h
Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h
Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.h
Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h
Classes/UITest/CocoStudioGUITest/UISceneManager.h
Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.h
Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h
Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.h
Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h
Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.h
Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest.h
Classes/DrawPrimitivesTest/DrawPrimitivesTest.h
Classes/BillBoardTest/BillBoardTest.h
Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.h
Classes/EffectsAdvancedTest/EffectsAdvancedTest.h
Classes/NavMeshTest/NavMeshTest.h
Classes/SchedulerTest/SchedulerTest.h
Classes/MultiTouchTest/MultiTouchTest.h
Classes/testResource.h
Classes/ShaderTest/ShaderTest.vsh.h
Classes/ShaderTest/shaderTest.psh.h
Classes/ShaderTest/ShaderTest.h
Classes/ShaderTest/ShaderTest2.h
Classes/NewRendererTest/NewRendererTest.h
Classes/SpritePolygonTest/SpritePolygonTest.h
Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.h
Classes/ChipmunkTest/ChipmunkTest.h
Classes/NodeTest/NodeTest.h
Classes/FileUtilsTest/FileUtilsTest.h
Classes/RenderTextureTest/RenderTextureTest.h
Classes/LayerTest/LayerTest.h
Classes/SpriteTest/SpriteTest.h
Classes/FontTest/FontTest.h
Classes/LightTest/LightTest.h
Classes/VisibleRect.h
Classes/DownloaderTest/DownloaderTest.h
Classes/OpenURLTest/OpenURLTest.h
Classes/ConsoleTest/ConsoleTest.h
Classes/MenuTest/MenuTest.h
)
list(APPEND GAME_SOURCE
Classes/ActionManagerTest/ActionManagerTest.cpp
Classes/ActionsEaseTest/ActionsEaseTest.cpp
Classes/ActionsProgressTest/ActionsProgressTest.cpp
@ -101,6 +256,8 @@ set(TESTS_SRC
Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp
Classes/ExtensionsTest/ExtensionsTest.cpp
Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp
Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp
Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp
Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp
Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp
Classes/FileUtilsTest/FileUtilsTest.cpp
@ -182,23 +339,28 @@ set(TESTS_SRC
Classes/controller.cpp
# Classes/VRTest/VRTest.cpp
# Classes/VRTest/VRTest.h
${platform_specific_src}
)
if(ANDROID OR IOS)
list(APPEND TESTS_SRC
list(APPEND GAME_HEADER
Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h
Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.h
)
list(APPEND GAME_SOURCE
Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp
Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp
)
)
endif()
if(WIN32 OR MACOSX OR LINUX)
list(APPEND TESTS_SRC
list(APPEND GAME_HEADER
Classes/WindowTest/WindowTest.h
Classes/BugsTest/Bug-14327.h
)
list(APPEND GAME_SOURCE
Classes/WindowTest/WindowTest.cpp
)
list(APPEND TESTS_SRC
Classes/BugsTest/Bug-14327.cpp
)
)
endif()
if(USE_CHIPMUNK)
@ -206,31 +368,84 @@ if(USE_CHIPMUNK)
endif()
if(USE_BOX2D)
list(APPEND TESTS_SRC
list(APPEND GAME_HEADER
Classes/Box2DTest/Box2dTest.cpp
Classes/Box2DTestBed/Test.h
Classes/Box2DTestBed/Tests/Chain.h
Classes/Box2DTestBed/Tests/Confined.h
Classes/Box2DTestBed/Tests/PolyCollision.h
Classes/Box2DTestBed/Tests/EdgeTest.h
Classes/Box2DTestBed/Tests/ApplyForce.h
Classes/Box2DTestBed/Tests/Gears.h
Classes/Box2DTestBed/Tests/SliderCrank.h
Classes/Box2DTestBed/Tests/ContinuousTest.h
Classes/Box2DTestBed/Tests/Revolute.h
Classes/Box2DTestBed/Tests/TheoJansen.h
Classes/Box2DTestBed/Tests/Bridge.h
Classes/Box2DTestBed/Tests/CollisionProcessing.h
Classes/Box2DTestBed/Tests/DistanceTest.h
Classes/Box2DTestBed/Tests/PolyShapes.h
Classes/Box2DTestBed/Tests/TimeOfImpact.h
Classes/Box2DTestBed/Tests/ConveyorBelt.h
Classes/Box2DTestBed/Tests/Tiles.h
Classes/Box2DTestBed/Tests/BulletTest.h
Classes/Box2DTestBed/Tests/MotorJoint.h
Classes/Box2DTestBed/Tests/Car.h
Classes/Box2DTestBed/Tests/Mobile.h
Classes/Box2DTestBed/Tests/VaryingFriction.h
Classes/Box2DTestBed/Tests/Rope.h
Classes/Box2DTestBed/Tests/SensorTest.h
Classes/Box2DTestBed/Tests/Pyramid.h
Classes/Box2DTestBed/Tests/VaryingRestitution.h
Classes/Box2DTestBed/Tests/RopeJoint.h
Classes/Box2DTestBed/Tests/VerticalStack.h
Classes/Box2DTestBed/Tests/MobileBalanced.h
Classes/Box2DTestBed/Tests/CompoundShapes.h
Classes/Box2DTestBed/Tests/CollisionFiltering.h
Classes/Box2DTestBed/Tests/Pulleys.h
Classes/Box2DTestBed/Tests/Breakable.h
Classes/Box2DTestBed/Tests/BodyTypes.h
Classes/Box2DTestBed/Tests/DumpShell.h
Classes/Box2DTestBed/Tests/ShapeEditing.h
Classes/Box2DTestBed/Tests/SphereStack.h
Classes/Box2DTestBed/Tests/OneSidedPlatform.h
Classes/Box2DTestBed/Tests/AddPair.h
Classes/Box2DTestBed/Tests/Pinball.h
Classes/Box2DTestBed/Tests/Tumbler.h
Classes/Box2DTestBed/Tests/RayCast.h
Classes/Box2DTestBed/Tests/ConvexHull.h
Classes/Box2DTestBed/Tests/EdgeShapes.h
Classes/Box2DTestBed/Tests/Prismatic.h
Classes/Box2DTestBed/Tests/Dominos.h
Classes/Box2DTestBed/Tests/Web.h
Classes/Box2DTestBed/Tests/CharacterCollision.h
Classes/Box2DTestBed/Tests/DynamicTreeTest.h
Classes/Box2DTestBed/Tests/Cantilever.h
Classes/Box2DTestBed/Box2dView.h
Classes/Box2DTestBed/GLES-Render.h
)
list(APPEND GAME_SOURCE
Classes/Box2DTest/Box2dTest.cpp
Classes/Box2DTestBed/Box2dView.cpp
Classes/Box2DTestBed/GLES-Render.cpp
Classes/Box2DTestBed/Test.cpp
Classes/Box2DTestBed/TestEntries.cpp
)
)
include_directories(${Box2D_INCLUDE_DIRS})
endif()
if(USE_BULLET)
list(APPEND TESTS_SRC
Classes/Physics3DTest/Physics3DTest.cpp
)
list(APPEND GAME_HEADER
Classes/Physics3DTest/Physics3DTest.h
)
list(APPEND GAME_SOURCE
Classes/Physics3DTest/Physics3DTest.cpp
)
include_directories(${BULLET_INCLUDE_DIRS})
endif()
set(EXTENDED_TESTS_SRC
Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp
Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp
Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp
)
if(NOT LINUX)
list(APPEND EXTENDED_TESTS_SRC
list(APPEND GAME_SOURCE
Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp
)
endif()
@ -241,12 +456,12 @@ include_directories(
)
# mark app complie info and libs info
set(cocos_app_src
${TESTS_SRC}
${EXTENDED_TESTS_SRC}
set(APP_SRC
${GAME_HEADER}
${GAME_SOURCE}
)
cocos_build_app(${APP_NAME}
APP_SRC "${cocos_app_src}"
APP_SRC "${APP_SRC}"
DEPEND_COMMON_LIBS "cocos2d"
DEPEND_ANDROID_LIBS "cocos2d_android"
COMMON_USE_PKGS "FREETYPE" "CURL"
@ -255,8 +470,11 @@ cocos_build_app(${APP_NAME}
# mark app resources
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
cocos_pak_xcode(${APP_NAME} BUNDLE_NAME "Tests Cpp" INFO_STRING "test project for cpp")
set_target_properties(${APP_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist"
)
elseif(IOS)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
endif()
@ -265,5 +483,5 @@ elseif(WINDOWS)
endif()
if(LINUX OR WINDOWS)
cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${res_res_folders})
cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
endif()

View File

@ -64,44 +64,74 @@ if(APPLE OR VS)
set(cc_common_res ${res_main} ${res_res} ${res_src} ${res_script})
endif()
if(WINDOWS)
set(WINDOWS_SRC proj.win32/main.cpp)
set(PLATFORM_SRC ${cc_common_res} ${WINDOWS_SRC})
elseif(ANDROID)
set(PLATFORM_SRC proj.android/app/jni/main.cpp)
# record sources, headers...
set(GAME_SOURCE)
set(GAME_HEADER)
if(ANDROID)
list(APPEND GAME_SOURCE
proj.android/app/jni/main.cpp
)
elseif(LINUX)
set(PLATFORM_SRC proj.linux/main.cpp)
list(APPEND GAME_SOURCE
proj.linux/main.cpp
)
elseif(WINDOWS)
list(APPEND GAME_HEADER
proj.win32/main.h
proj.win32/resource.h
)
list(APPEND GAME_SOURCE
proj.win32/main.cpp
${cc_common_res}
)
elseif(APPLE)
if(IOS)
set(ios_code_files
list(APPEND GAME_HEADER
proj.ios/AppController.h
proj.ios/NativeOcClass.h
proj.ios/RootViewController.h
)
set(APP_UI_RES
proj.ios/Info.plist
proj.ios/exportoptions.plist
proj.ios/LaunchScreen.storyboard
proj.ios/LaunchScreenBackground.png
proj.ios/Images.xcassets
)
list(APPEND GAME_SOURCE
proj.ios/main.m
proj.ios/NativeOcClass.m
proj.ios/AppController.mm
proj.ios/RootViewController.mm
)
set(ios_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/LaunchScreen.storyboard
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/LaunchScreenBackground.png
${APP_UI_RES}
)
cocos_mark_multi_resources(ios_res_files RES_TO "Resources" FILES ${ios_res_files})
set(apple_src_files ${ios_code_files} ${ios_res_files})
elseif(MACOSX)
set(mac_code_files proj.mac/main.cpp)
set(mac_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Icon.icns
set(APP_UI_RES
proj.mac/Icon.icns
proj.mac/Test_Info.plist
proj.mac/Test_Prefix.pch
proj.mac/en.lproj/MainMenu.xib
proj.mac/en.lproj/InfoPlist.strings
)
list(APPEND GAME_SOURCE
proj.mac/main.cpp
${APP_UI_RES}
)
cocos_mark_multi_resources(mac_res_files RES_TO "Resources" FILES ${mac_res_files})
set(apple_src_files ${mac_res_files} ${mac_code_files})
endif()
set(PLATFORM_SRC ${cc_common_res} ${apple_src_files})
list(APPEND GAME_SOURCE ${cc_common_res})
endif()
set(SAMPLE_SRC
list(APPEND GAME_HEADER
Classes/AppDelegate.h
Classes/js_Effect3D_bindings.h
Classes/js_DrawNode3D_bindings.h
)
list(APPEND GAME_SOURCE
Classes/AppDelegate.cpp
Classes/js_DrawNode3D_bindings.cpp
Classes/js_Effect3D_bindings.cpp
${PLATFORM_SRC}
)
)
include_directories(
Classes
@ -112,19 +142,24 @@ include_directories(
${COCOS2DX_ROOT_PATH}/cocos/audio/include
${COCOS2DX_ROOT_PATH}/external/spidermonkey/include/${PLATFORM_FOLDER}
${COCOS2DX_ROOT_PATH}/external/chipmunk/include/chipmunk
)
)
set(APP_SRC ${GAME_HEADER} ${GAME_SOURCE})
# mark app complie info and libs info
cocos_build_app(${APP_NAME}
APP_SRC "${SAMPLE_SRC}"
APP_SRC "${APP_SRC}"
DEPEND_COMMON_LIBS "jscocos2d" "cocos2d"
DEPEND_ANDROID_LIBS "cocos2d_android"
)
# mark app resources
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
cocos_pak_xcode(${APP_NAME} BUNDLE_NAME "JS Tests")
set_target_properties(${APP_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Test_Info.plist"
)
elseif(IOS)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
endif()

View File

@ -24,7 +24,7 @@ android {
cmake {
targets "js_tests"
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \
"-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DUSE_JSCOCOS2D=TRUE"
"-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DBUILD_JS_LIBS=TRUE"
cppFlags "-frtti -fexceptions"
// prebuilt root must be defined as a directory which you have right to access or create if you use prebuilt
// set "-DGEN_COCOS_PREBUILT=ON" and "-DUSE_COCOS_PREBUILT=OFF" to generate prebuilt, this way build cocos2d-x libs

View File

@ -32,37 +32,57 @@ if(APPLE OR VS)
set(cc_common_res ${res_res} ${res_src} ${res_script})
endif()
set(SAMPLE_SRC Classes/AppDelegate.cpp)
# record sources, headers...
set(GAME_SOURCE
Classes/AppDelegate.cpp
)
set(GAME_HEADER
Classes/AppDelegate.h
Classes/lua_module_register.h
)
if(ANDROID)
list(APPEND SAMPLE_SRC proj.android/app/jni/main.cpp)
list(APPEND GAME_SOURCE proj.android/app/jni/main.cpp)
elseif(LINUX)
set(SAMPLE_SRC ${SAMPLE_SRC} proj.linux/main.cpp)
list(APPEND GAME_SOURCE proj.linux/main.cpp)
elseif(WINDOWS)
add_definitions(-D_USRLUASTATIC)
list(APPEND SAMPLE_SRC proj.win32/main.cpp ${cc_common_res})
list(APPEND GAME_HEADER proj.win32/main.h)
list(APPEND GAME_SOURCE proj.win32/main.cpp ${cc_common_res})
elseif(APPLE)
if(IOS)
set(ios_code_files
list(APPEND GAME_HEADER
proj.ios/AppController.h
proj.ios/RootViewController.h
)
set(APP_UI_RES
proj.ios/Info.plist
proj.ios/exportoptions.plist
proj.ios/LaunchScreen.storyboard
proj.ios/LaunchScreenBackground.png
proj.ios/Images.xcassets
)
list(APPEND GAME_SOURCE
proj.ios/main.m
proj.ios/AppController.mm
proj.ios/RootViewController.mm
proj.ios/HelloLua_Prefix.pch
${APP_UI_RES}
)
set(ios_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/LaunchScreen.storyboard
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/LaunchScreenBackground.png
)
cocos_mark_multi_resources(ios_res_files RES_TO "Resources" FILES ${ios_res_files})
set(apple_src_files ${ios_code_files} ${ios_res_files})
elseif(MACOSX)
set(mac_code_files proj.mac/main.cpp)
set(mac_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Icon.icns
set(APP_UI_RES
proj.mac/Icon.icns
proj.mac/Info.plist
proj.mac/en.lproj/MainMenu.xib
proj.mac/en.lproj/InfoPlist.strings
)
list(APPEND GAME_SOURCE
proj.mac/main.cpp
proj.mac/HelloLua_Prefix.pch
${APP_UI_RES}
)
cocos_mark_multi_resources(mac_res_files RES_TO "Resources" FILES ${mac_res_files})
set(apple_src_files ${mac_res_files} ${mac_code_files})
endif()
list(APPEND SAMPLE_SRC ${cc_common_res} ${apple_src_files})
list(APPEND GAME_SOURCE ${cc_common_res})
endif()
include_directories(
@ -71,21 +91,25 @@ include_directories(
${COCOS2DX_ROOT_PATH}/cocos/scripting/lua-bindings/manual
${COCOS2DX_ROOT_PATH}/external/lua/luajit/include
${COCOS2DX_ROOT_PATH}/external/lua/tolua
)
)
include_directories(${LUAJIT_INCLUDE_DIRS})
set(APP_SRC ${GAME_HEADER} ${GAME_SOURCE})
# mark app complie info and libs info
cocos_build_app(${APP_NAME}
APP_SRC "${SAMPLE_SRC}"
APP_SRC "${APP_SRC}"
DEPEND_COMMON_LIBS "luacocos2d" "cocos2d"
DEPEND_ANDROID_LIBS "cocos2d_android"
)
# mark app resources
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
cocos_pak_xcode(${APP_NAME})
set_target_properties(${APP_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist"
)
elseif(IOS)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
endif()

View File

@ -26,7 +26,7 @@ android {
cmake {
targets "lua_empty_test"
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \
"-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DUSE_LUACOCOS2D=TRUE"
"-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DBUILD_LUA_LIBS=TRUE"
cppFlags "-frtti -fexceptions"
// prebuilt root must be defined as a directory which you have right to access or create if you use prebuilt
// set "-DGEN_COCOS_PREBUILT=ON" and "-DUSE_COCOS_PREBUILT=OFF" to generate prebuilt, this way build cocos2d-x libs

View File

@ -16,7 +16,12 @@ if(NOT DEFINED BUILD_ENGINE_DONE)
endif()
endif()
set(SAMPLE_SRC
set(GAME_HEADER
Classes/AppDelegate.h
Classes/lua_test_bindings.h
Classes/lua_assetsmanager_test_sample.h
)
set(GAME_SOURCE
Classes/AppDelegate.cpp
Classes/lua_assetsmanager_test_sample.cpp
Classes/lua_test_bindings.cpp
@ -40,35 +45,53 @@ if(APPLE OR VS)
endif()
if(ANDROID)
list(APPEND SAMPLE_SRC proj.android/app/jni/main.cpp)
list(APPEND GAME_SOURCE proj.android/app/jni/main.cpp)
elseif(LINUX)
set(SAMPLE_SRC ${SAMPLE_SRC} proj.linux/main.cpp)
list(APPEND GAME_SOURCE proj.linux/main.cpp)
elseif(WINDOWS)
add_definitions(-D_USRLUASTATIC)
list(APPEND SAMPLE_SRC proj.win32/main.cpp ${cc_common_res})
list(APPEND GAME_HEADER
proj.win32/main.h
proj.win32/resource.h
)
list(APPEND GAME_SOURCE proj.win32/main.cpp ${cc_common_res})
elseif(APPLE)
if(IOS)
set(ios_code_files
list(APPEND GAME_HEADER
proj.ios_mac/ios/AppController.h
proj.ios_mac/ios/LuaObjectCBridgeTest.h
proj.ios_mac/ios/RootViewController.h
)
set(APP_UI_RES
proj.ios_mac/ios/Info.plist
proj.ios_mac/ios/exportoptions.plist
proj.ios_mac/ios/LaunchScreen.storyboard
proj.ios_mac/ios/LaunchScreenBackground.png
proj.ios_mac/ios/Images.xcassets
)
list(APPEND GAME_SOURCE
proj.ios_mac/ios/main.m
proj.ios_mac/ios/LuaObjectCBridgeTest.mm
proj.ios_mac/ios/AppController.mm
proj.ios_mac/ios/RootViewController.mm
)
set(ios_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/LaunchScreen.storyboard
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/LaunchScreenBackground.png
${APP_UI_RES}
)
cocos_mark_multi_resources(ios_res_files RES_TO "Resources" FILES ${ios_res_files})
set(apple_src_files ${ios_code_files} ${ios_res_files})
elseif(MACOSX)
set(mac_code_files proj.ios_mac/mac/main.cpp)
set(mac_res_files
${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Icon.icns
list(APPEND GAME_HEADER
proj.ios_mac/mac/LuaObjectCBridgeTest.h
)
set(APP_UI_RES
proj.ios_mac/mac/en.lproj/MainMenu.xib
proj.ios_mac/mac/Icon.icns
proj.ios_mac/mac/Info.plist
)
list(APPEND GAME_SOURCE
proj.ios_mac/mac/main.cpp
proj.ios_mac/mac/LuaObjectCBridgeTest.mm
${APP_UI_RES}
)
cocos_mark_multi_resources(mac_res_files RES_TO "Resources" FILES ${mac_res_files})
set(apple_src_files ${mac_res_files} ${mac_code_files})
endif()
list(APPEND SAMPLE_SRC ${apple_src_files} ${cc_common_res})
list(APPEND GAME_SOURCE ${cc_common_res})
endif()
include_directories(
@ -80,17 +103,21 @@ include_directories(
include_directories(${LUAJIT_INCLUDE_DIRS})
set(APP_SRC ${GAME_HEADER} ${GAME_SOURCE})
# mark app complie info and libs info
cocos_build_app(${APP_NAME}
APP_SRC "${SAMPLE_SRC}"
APP_SRC "${APP_SRC}"
DEPEND_COMMON_LIBS "luacocos2d" "cocos2d"
DEPEND_ANDROID_LIBS "cocos2d_android"
)
# mark app resources
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
cocos_pak_xcode(${APP_NAME} BUNDLE_NAME "LuaTestsApp")
set_target_properties(${APP_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist"
)
elseif(IOS)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in")
endif()

View File

@ -26,7 +26,7 @@ android {
cmake {
targets 'lua_tests'
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \
"-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DUSE_LUACOCOS2D=TRUE"
"-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DBUILD_LUA_LIBS=TRUE"
cppFlags "-frtti -fexceptions"
// prebuilt root must be defined as a directory which you have right to access or create if you use prebuilt
// set "-DGEN_COCOS_PREBUILT=ON" and "-DUSE_COCOS_PREBUILT=OFF" to generate prebuilt, this way build cocos2d-x libs

View File

@ -34,7 +34,17 @@ elseif(WINDOWS)
endif()
if(WIN32)
set(PLATFORM_SRC
set(PLATFORM_HEADER
${SIMULATOR_LIB_PATH}/../proj.win32/stdafx.h
${SIMULATOR_LIB_PATH}/../proj.win32/targetver.h
${SIMULATOR_LIB_PATH}/platform/win32/PlayerMessageBoxServiceWin.h
${SIMULATOR_LIB_PATH}/platform/win32/PlayerMenuServiceWin.h
${SIMULATOR_LIB_PATH}/platform/win32/PlayerWin.h
${SIMULATOR_LIB_PATH}/platform/win32/PlayerEditBoxServiceWin.h
${SIMULATOR_LIB_PATH}/platform/win32/PlayerFileDialogServiceWin.h
${SIMULATOR_LIB_PATH}/platform/win32/PlayerTaskServiceWin.h
)
set(PLATFORM_SOURCE
${SIMULATOR_LIB_PATH}/../proj.win32/Runtime_win32.cpp
${SIMULATOR_LIB_PATH}/../proj.win32/stdafx.cpp
${SIMULATOR_LIB_PATH}/platform/win32/DeviceEx-win32.cpp
@ -44,10 +54,18 @@ if(WIN32)
${SIMULATOR_LIB_PATH}/platform/win32/PlayerMessageBoxServiceWin.cpp
${SIMULATOR_LIB_PATH}/platform/win32/PlayerTaskServiceWin.cpp
${SIMULATOR_LIB_PATH}/platform/win32/PlayerWin.cpp
# ${SIMULATOR_LIB_PATH}/platform/win32/SimulatorWin.cpp
)
elseif(MACOSX)
set(PLATFORM_SRC
set(PLATFORM_HEADER
${SIMULATOR_LIB_PATH}/platform/mac/openudid/OpenUDIDMac.h
${SIMULATOR_LIB_PATH}/platform/mac/PlayerMessageBoxServiceMac.h
${SIMULATOR_LIB_PATH}/platform/mac/PlayerEditBoxServiceMac.h
${SIMULATOR_LIB_PATH}/platform/mac/PlayerMac.h
${SIMULATOR_LIB_PATH}/platform/mac/PlayerMenuServiceMac.h
${SIMULATOR_LIB_PATH}/platform/mac/PlayerTaskServiceMac.h
${SIMULATOR_LIB_PATH}/platform/mac/PlayerFileDialogServiceMac.h
)
set(PLATFORM_SOURCE
${SIMULATOR_LIB_PATH}/platform/mac/DeviceEx-mac.mm
${SIMULATOR_LIB_PATH}/platform/mac/PlayerEditBoxServiceMac.mm
${SIMULATOR_LIB_PATH}/platform/mac/PlayerFileDialogServiceMac.mm
@ -60,7 +78,37 @@ elseif(MACOSX)
)
endif()
set(PROTOBUF_SRC
set(PROTOBUF_HEADER
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/stl_util.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/atomicops_internals_arm_gcc.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/template_util.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/atomicops_internals_macosx.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/stringprintf.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/atomicops.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/atomicops_internals_x86_gcc.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/atomicops_internals_x86_msvc.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/atomicops_internals_generic_gcc.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/common.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/platform_macros.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/once.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/type_traits.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/atomicops_internals_atomicword_compat.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/map-util.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/stubs/hash.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/repeated_field.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/io/zero_copy_stream_impl.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/io/coded_stream_inl.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/io/zero_copy_stream_impl_lite.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/io/zero_copy_stream.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/io/coded_stream.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/wire_format_lite_inl.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/extension_set.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/message_lite.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/generated_message_util.h
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/wire_format_lite.h
)
set(PROTOBUF_SOURCE
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/extension_set.cc
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/generated_message_util.cc
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/io/coded_stream.cc
@ -76,7 +124,42 @@ set(PROTOBUF_SRC
${SIMULATOR_LIB_PATH}/protobuf-lite/google/protobuf/wire_format_lite.cc
)
set(SIMELATOR_SRC
set(SIMULATOR_HEADER
${SIMULATOR_LIB_PATH}/cocos2dx_extra.h
${SIMULATOR_LIB_PATH}/AppLang.h
${SIMULATOR_LIB_PATH}/PlayerMenuServiceProtocol.h
${SIMULATOR_LIB_PATH}/DeviceEx.h
${SIMULATOR_LIB_PATH}/SimulatorExport.h
${SIMULATOR_LIB_PATH}/network/CCHTTPRequestDelegate.h
${SIMULATOR_LIB_PATH}/network/CCHTTPRequest.h
${SIMULATOR_LIB_PATH}/runtime/Widget_mac.h
${SIMULATOR_LIB_PATH}/runtime/FileServer.h
${SIMULATOR_LIB_PATH}/runtime/ConfigParser.h
${SIMULATOR_LIB_PATH}/runtime/ConsoleCommand.h
${SIMULATOR_LIB_PATH}/runtime/RuntimeCCSImpl.h
${SIMULATOR_LIB_PATH}/runtime/Runtime.h
${SIMULATOR_LIB_PATH}/runtime/ResData.h
${SIMULATOR_LIB_PATH}/runtime/ConnectWaitLayer.h
${SIMULATOR_LIB_PATH}/runtime/RuntimeProtocol.h
${SIMULATOR_LIB_PATH}/runtime/Protos.pb.h
${SIMULATOR_LIB_PATH}/runtime/VisibleRect.h
${SIMULATOR_LIB_PATH}/PlayerSettings.h
${SIMULATOR_LIB_PATH}/PlayerEditBoxServiceProtocol.h
${SIMULATOR_LIB_PATH}/PlayerMessageBoxServiceProtocol.h
${SIMULATOR_LIB_PATH}/AppEvent.h
${SIMULATOR_LIB_PATH}/PlayerProtocol.h
${SIMULATOR_LIB_PATH}/PlayerMacros.h
${SIMULATOR_LIB_PATH}/PlayerFileDialogServiceProtocol.h
${SIMULATOR_LIB_PATH}/ProjectConfig/SimulatorConfig.h
${SIMULATOR_LIB_PATH}/ProjectConfig/ProjectConfig.h
${SIMULATOR_LIB_PATH}/PlayerServiceProtocol.h
${SIMULATOR_LIB_PATH}/PlayerUtils.h
${SIMULATOR_LIB_PATH}/PlayerTaskServiceProtocol.h
${PROTOBUF_HEADER}
${PLATFORM_HEADER}
)
set(SIMULATOR_SOURCE
${SIMULATOR_LIB_PATH}/network/CCHTTPRequest.cpp
${SIMULATOR_LIB_PATH}/ProjectConfig/ProjectConfig.cpp
${SIMULATOR_LIB_PATH}/ProjectConfig/SimulatorConfig.cpp
@ -102,8 +185,8 @@ set(SIMELATOR_SRC
${SIMULATOR_LIB_PATH}/runtime/RuntimeProtocol.cpp
${SIMULATOR_LIB_PATH}/runtime/Shine_png.cpp
${SIMULATOR_LIB_PATH}/runtime/VisibleRect.cpp
${PROTOBUF_SRC}
${PLATFORM_SRC}
${PROTOBUF_SOURCE}
${PLATFORM_SOURCE}
)
include_directories(
@ -114,8 +197,10 @@ include_directories(
${COCOS2DX_ROOT_PATH}/cocos/editor-support
)
set(LIB_SOURCE ${SIMULATOR_SOURCE} ${SIMULATOR_HEADER})
add_library(simulator STATIC
${SIMELATOR_SRC}
${LIB_SOURCE}
)
target_use_simulator_depend_libs(simulator)

View File

@ -101,10 +101,12 @@ function upgrade_openssl_for_osx()
brew upgrade openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/Cellar/openssl/1.0.2n/bin/openssl /usr/local/bin/openssl
ln -s /usr/local/opt/openssl/bin/openssl /usr/local/bin/openssl
echo "macOS SSL: `openssl version`"
brew install python2 --with-brewed-openssl
ln -s /usr/local/opt/python@2/bin/python2 /usr/local/bin/python
brew unlink python
brew install python2
echo "python link: `ls -l /usr/local/bin/python`"
echo "python SSL: `python -c "import ssl; print ssl.OPENSSL_VERSION"`"
}

View File

@ -84,6 +84,9 @@ function genernate_binding_codes()
export NDK_ROOT=$HOME/bin/android-ndk
export PYTHON_BIN=/usr/bin/python
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
export PYTHON_BIN=/usr/local/bin/python
fi
# Generate binding glue codes