mirror of https://github.com/axmolengine/axmol.git
Merge pull request #1 from iSevenDays/v3_sevendays
CMake fix for Mac Os X
This commit is contained in:
commit
40c5319f65
|
@ -87,7 +87,7 @@ if(WINDOWS)
|
||||||
|
|
||||||
ADD_DEFINITIONS (-DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32)
|
ADD_DEFINITIONS (-DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32)
|
||||||
set(PLATFORM_FOLDER win32)
|
set(PLATFORM_FOLDER win32)
|
||||||
elseif(MACOSX)
|
elseif(MACOSX OR APPLE)
|
||||||
ADD_DEFINITIONS (-DCC_TARGET_OS_MAC)
|
ADD_DEFINITIONS (-DCC_TARGET_OS_MAC)
|
||||||
ADD_DEFINITIONS (-DUSE_FILE32API)
|
ADD_DEFINITIONS (-DUSE_FILE32API)
|
||||||
set(PLATFORM_FOLDER mac)
|
set(PLATFORM_FOLDER mac)
|
||||||
|
|
|
@ -32,7 +32,6 @@ THE SOFTWARE.
|
||||||
#include "deprecated/CCString.h"
|
#include "deprecated/CCString.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
include_directories(
|
include_directories(
|
||||||
../external/ConvertUTF
|
../external/ConvertUTF, .
|
||||||
)
|
)
|
||||||
|
|
||||||
set(COCOS_2D_SRC
|
set(COCOS_2D_SRC
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
# this CMakeLists is to generate libcocos2d.a
|
# this CMakeLists is to generate libcocos2d.a
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 2.7)
|
||||||
|
|
||||||
if(WINDOWS)
|
if(WINDOWS)
|
||||||
ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
|
ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
|
||||||
endif()
|
endif()
|
||||||
|
@ -74,6 +76,19 @@ set(COCOS_SRC cocos2d.cpp
|
||||||
${COCOS_EXTENSIONS_SRC}
|
${COCOS_EXTENSIONS_SRC}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(MACOSX OR APPLE)
|
||||||
|
|
||||||
|
include(FindFreetype REQUIRED)
|
||||||
|
IF(NOT FREETYPE_FOUND)
|
||||||
|
FIND_LIBRARY(FREETYPE_LIBRARIES NAMES libfreetype freetype.dll PATHS "../external/freetype2/prebuilt/mac" "../external/freetype2/prebuilt/ios" DOC "Freetype includes")
|
||||||
|
find_path(FREETYPE_INCLUDE_DIRS ft2build.h "../external/freetype2/include/mac" "../external/freetype2/include/mac/freetype" "../external/freetype2/include/ios" "../external/freetype2/include/ios/freetype" DOC "Freetype includes")
|
||||||
|
ENDIF(NOT FREETYPE_FOUND)
|
||||||
|
|
||||||
|
find_package(Freetype)
|
||||||
|
include_directories(${FREETYPE_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
find_package(WebP REQUIRED)
|
find_package(WebP REQUIRED)
|
||||||
|
@ -126,8 +141,8 @@ elseif(WINDOWS)
|
||||||
elseif(LINUX)
|
elseif(LINUX)
|
||||||
set(PLATFORM_SPECIFIC_LIBS jpeg webp tiff freetype curl websockets
|
set(PLATFORM_SPECIFIC_LIBS jpeg webp tiff freetype curl websockets
|
||||||
fontconfig png pthread glfw GLEW GL X11 rt z protobuf ${FMOD_LIB})
|
fontconfig png pthread glfw GLEW GL X11 rt z protobuf ${FMOD_LIB})
|
||||||
elseif(MACOSX)
|
elseif(MACOSX OR APPLE)
|
||||||
|
set (CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++")
|
||||||
INCLUDE_DIRECTORIES ( /System/Library/Frameworks )
|
INCLUDE_DIRECTORIES ( /System/Library/Frameworks )
|
||||||
|
|
||||||
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
|
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
if(MACOSX)
|
if(MACOSX OR APPLE)
|
||||||
set(COCOS_BASE_SPECIFIC_SRC
|
set(COCOS_BASE_SPECIFIC_SRC
|
||||||
base/CCUserDefault-apple.mm)
|
base/CCUserDefault-apple.mm)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -57,7 +57,7 @@ THE SOFTWARE.
|
||||||
#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN
|
#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN
|
||||||
|
|
||||||
// mac
|
// mac
|
||||||
#if defined(CC_TARGET_OS_MAC)
|
#if defined(CC_TARGET_OS_MAC) || defined(__APPLE__)
|
||||||
#undef CC_TARGET_PLATFORM
|
#undef CC_TARGET_PLATFORM
|
||||||
#define CC_TARGET_PLATFORM CC_PLATFORM_MAC
|
#define CC_TARGET_PLATFORM CC_PLATFORM_MAC
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -10,7 +10,7 @@ set(COCOS_PLATFORM_SPECIFIC_SRC
|
||||||
platform/desktop/CCGLViewImpl-desktop.cpp
|
platform/desktop/CCGLViewImpl-desktop.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
elseif(MACOSX)
|
elseif(MACOSX OR APPLE)
|
||||||
|
|
||||||
set(COCOS_PLATFORM_SPECIFIC_SRC
|
set(COCOS_PLATFORM_SPECIFIC_SRC
|
||||||
platform/mac/CCApplication-mac.mm
|
platform/mac/CCApplication-mac.mm
|
||||||
|
|
|
@ -17,7 +17,7 @@ elseif(IOS)
|
||||||
proj.ios/RootViewController.mm
|
proj.ios/RootViewController.mm
|
||||||
)
|
)
|
||||||
|
|
||||||
elseif(MACOSX)
|
elseif(MACOSX OR APPLE)
|
||||||
set(PLATFORM_SRC
|
set(PLATFORM_SRC
|
||||||
proj.mac/main.cpp
|
proj.mac/main.cpp
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue