2014-08-06 22:43:19 +08:00
|
|
|
if(WINDOWS)
|
|
|
|
ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
|
2014-05-02 04:01:51 +08:00
|
|
|
endif()
|
|
|
|
|
2014-08-06 22:43:19 +08:00
|
|
|
set(COCOS_SRC cocos2d.cpp)
|
2014-05-02 04:01:51 +08:00
|
|
|
|
|
|
|
include(2d/CMakeLists.txt)
|
2014-05-17 05:36:00 +08:00
|
|
|
include(platform/CMakeLists.txt)
|
2014-05-02 04:01:51 +08:00
|
|
|
include(physics/CMakeLists.txt)
|
|
|
|
include(math/CMakeLists.txt)
|
|
|
|
include(renderer/CMakeLists.txt)
|
|
|
|
include(base/CMakeLists.txt)
|
|
|
|
include(deprecated/CMakeLists.txt)
|
|
|
|
|
|
|
|
add_library(cocos2d STATIC
|
|
|
|
${COCOS_SRC}
|
|
|
|
${COCOS_2D_SRC}
|
2014-05-17 05:36:00 +08:00
|
|
|
${COCOS_PLATFORM_SRC}
|
2014-05-02 04:01:51 +08:00
|
|
|
${COCOS_BASE_SRC}
|
|
|
|
${COCOS_RENDERER_SRC}
|
|
|
|
${COCOS_MATH_SRC}
|
|
|
|
${COCOS_PHYSICS_SRC}
|
|
|
|
${COCOS_DEPRECATED_SRC}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(MINGW)
|
2014-08-06 22:43:19 +08:00
|
|
|
set(COCOS_LINK z jpeg png webp tiff glfw3 glew32 opengl32 iconv freetype bz2)
|
|
|
|
elseif(WINDOWS)
|
|
|
|
set(COCOS_LINK libjpeg libpng libwebp libtiff freetype250 glfw3 glew32 opengl32 libiconv libzlib)
|
|
|
|
elseif(LINUX)
|
|
|
|
set(COCOS_LINK jpeg webp tiff freetype fontconfig png pthread glfw GLEW GL X11 rt z)
|
2014-05-02 04:01:51 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
target_link_libraries(cocos2d
|
|
|
|
chipmunk_static
|
|
|
|
tinyxml2
|
|
|
|
unzip
|
|
|
|
xxhash
|
|
|
|
${COCOS_LINK}
|
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties(cocos2d
|
|
|
|
PROPERTIES
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
|
|
)
|