John b9bd66b36b Updated spine-c, spine-sfml, spine-cocos2d-objc and spine-cocos2dx to 3.2.01
- Updated spine-c to 3.2.01, adding shearing and transform constraints plus various bug fixes
- Introduced CMake based system to generated IDE projects for spine-sfml, and download dependencies for all other runtimes
- Updated all spine-c based runtime READMEs with new usage and example instructions
- Moved spine-cocos2d-iphone v2 and spine-cocos2dx v2 to separate branches. These will no longer be updated
- Renamed spine-cocos2d-iphone to spine-cocos2d-iphone

Removed cocos2d-ios v2 Spine runtime. See branch cocos2d-ios-v2 for legacy apps

Moved cocos2d-ios v3 Spine runtime to top-level sphine-cocos2d-iphone directory

Added Visual Studio support to CMake build

Added Linux support for spine-sfml. Do apt-get install sfml-dev as a prerequisit, makes everyone's life easier

Refactored Mac OS X framework detection and linking, added SFML_STATIC define for Win32 build

Removed spine-cocos2dx v2 runtime. See cocos2dx-v2 branch on Github

Moved spine-cocos2dx v3 runtime to root of spine-cocos2dx

spine-c, spine-cocos2d-iphone, spine-cocos2dx, spine-sfml updated to 3.2.00

* Added CMake build for spine-c and spine-sfml
* Removed spine-cocos2dx v2 and spine-cocos2d-iphone v2. See the cocos2dx-v2 and cocos2d-ios-v2 branches if you need these runtimes still
* Added transform constraint rotate, scale, and shear offsets and mixes
* Added spTransformConstraintTimeline
* Added bone shearing
* Added spShearTimeline
* Changed spSkeleton_updateCache
* Changed JSON format, see http://esotericsoftware.com/spine-json-format

Ported 1be89d1c5766fedb91f080a23bffaef6609b86c3 to spine-c

Cleaned up spine-c, removed IDE specific files and unnecessary data/ folder. Use CMake to import into your most beloved IDE

Added spine-cocos2d-iphone to CMake, only downloads cocos2d-objc dependency. Use Xcode project in spine-cocos2d-iphone/ to run examples

Added -std=c98 -pedantic -Wall to spine-c CMake file, fixed up all warnings, fixed up .gitignore

Fixed warnings, replaced calls to stdlib cos/sin/atan2 with macros

New cocos2dx example project, for Windows, Linux and Mac OS X. Doesn't work on Windows/Linux yet

Fixed spine-cocos2dx Visual Studio projects

Reworked cocos2dx dependency resolution

Fixed up src/header paths in CMake files. Dependencies are only downloaded if you build a specific runtime example

Updated spine-sfml README with instructions for Windows

Updated spine-sfml README with instructions for Linux and Mac OS X

Fixed README formatting

More formatting, sorry, can't preview markdown...

More README changes

Renamed spine-cocos2d-iphone to spine-cocos2d-objc, fixed up Xcode project and README

Updated spine-cocos2d-objc README

Added context when exceptions are thrown during attachment and animation parsing.

Added JsonRollback, a tool for converting newer JSON so it can be loaded by an older Spine version.

[Unity] Update BoneFollower

Added coverting linkedmesh to weightedlinkedmesh.

[LUA] AnimationState trackCount bugfixes (#466)

* resolved conflict

* made trackCount keep count, not maximum track index.

Prettier with varargs.

Updated .gitignore to exclude cocos2dx dependencies

Fixed up READMEs of spine-c based runtimes with proper version info. Fixed cocos2d-x CMake build to delete outdated Spine runtime shipped by cocos2d-x
2016-06-22 15:23:31 +02:00

170 lines
5.4 KiB
CMake

#/****************************************************************************
# Copyright (c) 2013-2014 cocos2d-x.org
# Copyright (c) 2015 Chukong Technologies Inc.
#
# http://www.cocos2d-x.org
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ****************************************************************************/
cmake_policy(SET CMP0017 NEW)
cmake_minimum_required(VERSION 3.1)
set(APP_NAME MyGame)
project (${APP_NAME})
set(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/cocos2d)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${COCOS2D_ROOT}/cmake/Modules/")
include(CocosBuildHelpers)
# libcocos2d
set(BUILD_CPP_EMPTY_TEST OFF CACHE BOOL "turn off build cpp-empty-test")
set(BUILD_CPP_TESTS OFF CACHE BOOL "turn off build cpp-tests")
set(BUILD_LUA_LIBS OFF CACHE BOOL "turn off build lua related targets")
set(BUILD_JS_LIBS OFF CACHE BOOL "turn off build js related targets")
add_subdirectory(${COCOS2D_ROOT})
# Some macro definitions
if(WINDOWS)
if(BUILD_SHARED_LIBS)
ADD_DEFINITIONS (-D_USRDLL -D_EXPORT_DLL_ -D_USEGUIDLL -D_USREXDLL -D_USRSTUDIODLL)
else()
ADD_DEFINITIONS (-DCC_STATIC)
endif()
ADD_DEFINITIONS (-DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32 -D_WIN32)
set(PLATFORM_FOLDER win32)
elseif(MACOSX OR APPLE)
ADD_DEFINITIONS (-DCC_TARGET_OS_MAC)
ADD_DEFINITIONS (-DUSE_FILE32API)
set(PLATFORM_FOLDER mac)
elseif(LINUX)
ADD_DEFINITIONS(-DLINUX)
set(PLATFORM_FOLDER linux)
elseif(ANDROID)
ADD_DEFINITIONS (-DUSE_FILE32API)
set(PLATFORM_FOLDER android)
else()
message( FATAL_ERROR "Unsupported platform, CMake will exit" )
endif()
# Compiler options
if(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-wd4251 -wd4244 -wd4334 -wd4005 -wd4820 -wd4710
-wd4514 -wd4056 -wd4996 -wd4099)
else()
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -DCOCOS2D_DEBUG=1")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-deprecated-declarations -Wno-reorder")
if(CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
endif(MSVC)
set(PLATFORM_SPECIFIC_SRC)
set(PLATFORM_SPECIFIC_HEADERS)
if(MACOSX OR APPLE)
set(PLATFORM_SPECIFIC_SRC
proj.ios_mac/mac/main.cpp
)
elseif(LINUX)
set(PLATFORM_SPECIFIC_SRC
proj.linux/main.cpp
)
elseif ( WIN32 )
set(PLATFORM_SPECIFIC_SRC
proj.win32/main.cpp
)
set(PLATFORM_SPECIFIC_HEADERS
proj.win32/main.h
proj.win32/resource.h
)
elseif(ANDROID)
set(PLATFORM_SPECIFIC_SRC
proj.android-studio/app/jni/hellocpp/main.cpp
)
endif()
include_directories(
/usr/local/include/GLFW
/usr/include/GLFW
${COCOS2D_ROOT}/cocos
${COCOS2D_ROOT}/cocos/platform
${COCOS2D_ROOT}/cocos/audio/include/
Classes
)
if ( WIN32 )
include_directories(
${COCOS2D_ROOT}/external/glfw3/include/win32
${COCOS2D_ROOT}/external/win32-specific/gles/include/OGLES
)
endif( WIN32 )
set(GAME_SRC
Classes/AppDelegate.cpp
Classes/HelloWorldScene.cpp
${PLATFORM_SPECIFIC_SRC}
)
set(GAME_HEADERS
Classes/AppDelegate.h
Classes/HelloWorldScene.h
${PLATFORM_SPECIFIC_HEADERS}
)
if( ANDROID )
add_library(${APP_NAME} SHARED ${GAME_SRC} ${GAME_HEADERS})
IF(CMAKE_BUILD_TYPE MATCHES RELEASE)
ADD_CUSTOM_COMMAND(TARGET ${APP_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} lib${APP_NAME}.so)
ENDIF()
else()
add_executable(${APP_NAME} ${GAME_SRC} ${GAME_HEADERS})
endif()
target_link_libraries(${APP_NAME} cocos2d)
set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin")
set_target_properties(${APP_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}")
if ( WIN32 )
#also copying dlls to binary directory for the executable to run
pre_build(${APP_NAME}
COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy ${COCOS2D_ROOT}/external/win32-specific/gles/prebuilt/glew32.dll ${APP_BIN_DIR}/${CMAKE_BUILD_TYPE}
COMMAND ${CMAKE_COMMAND} -E copy ${COCOS2D_ROOT}/external/win32-specific/zlib/prebuilt/zlib1.dll ${APP_BIN_DIR}/${CMAKE_BUILD_TYPE}
)
elseif( ANDROID )
else()
pre_build(${APP_NAME}
COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources
)
endif()