123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- cmake_minimum_required(VERSION 3.1)
- cmake_policy(SET CMP0017 NEW)
- if(CMAKE_VERSION VERSION_GREATER 3.1)
- cmake_policy(SET CMP0054 NEW)
- endif()
- project (Cocos2d-X)
- set(COCOS2D_X_VERSION 3.13)
- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/")
- set(COCOS_EXTERNAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
- if (CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(ARCH_DIR "64-bit")
- elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
- set(ARCH_DIR "32-bit")
- else()
- message(FATAL_ERROR "Unsupported architecture, CMake will exit")
- return()
- endif()
- if (NOT CMAKE_BUILD_TYPE)
- if(DEBUG_MODE)
- set(CMAKE_BUILD_TYPE DEBUG)
- else(DEBUG_MODE)
- set(CMAKE_BUILD_TYPE RELEASE)
- endif(DEBUG_MODE)
- endif(NOT CMAKE_BUILD_TYPE)
- include(CocosBuildHelpers)
- message(${BUILDING_STRING})
- include(SelectModule)
- SelectModule()
- include(SetCompilerOptions)
- SetCompilerOptions()
- if (CMAKE_FIND_ROOT_PATH AND USE_PREBUILT_LIBS)
-
- set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${COCOS_EXTERNAL_DIR})
- endif ()
- include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/cocos
- ${CMAKE_CURRENT_SOURCE_DIR}/deprecated
- ${CMAKE_CURRENT_SOURCE_DIR}/cocos/platform
- ${CMAKE_CURRENT_SOURCE_DIR}/extensions
- ${CMAKE_CURRENT_SOURCE_DIR}/external
- )
- if(USE_PREBUILT_LIBS)
- include(CocosUsePrebuiltLibs)
- endif()
- include(BuildModules)
- BuildModules()
- if(BUILD_CPP_EMPTY_TEST)
- add_subdirectory(tests/cpp-empty-test)
- endif(BUILD_CPP_EMPTY_TEST)
- if(BUILD_CPP_TESTS)
- add_subdirectory(tests/cpp-tests)
- endif(BUILD_CPP_TESTS)
- if(BUILD_LUA_LIBS)
- add_subdirectory(cocos/scripting/lua-bindings)
-
- if(BUILD_LUA_TESTS)
- add_subdirectory(tests/lua-tests/project)
- add_subdirectory(tests/lua-empty-test/project)
- endif(BUILD_LUA_TESTS)
- endif(BUILD_LUA_LIBS)
- if(BUILD_JS_LIBS)
- add_subdirectory(cocos/scripting/js-bindings)
-
- if(BUILD_JS_TESTS)
- add_subdirectory(tests/js-tests/project)
- endif(BUILD_JS_TESTS)
- endif(BUILD_JS_LIBS)
|