mirror of https://github.com/axmolengine/axmol.git
Add CMake macro BUILD_TESTS=OFF to support exclude all tests project
This commit is contained in:
parent
540c9375ff
commit
5ab0b04d01
|
@ -40,6 +40,8 @@ include(PreventInSourceBuilds)
|
||||||
# works before build libcocos2d
|
# works before build libcocos2d
|
||||||
include(CocosBuildSet)
|
include(CocosBuildSet)
|
||||||
|
|
||||||
|
option(BUILD_TESTS "Build cpp & lua tests" ON)
|
||||||
|
|
||||||
set(BUILD_LUA_LIBS ON)
|
set(BUILD_LUA_LIBS ON)
|
||||||
|
|
||||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
|
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
|
||||||
|
@ -47,18 +49,20 @@ add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
|
||||||
# prevent tests project to build "cocos2d-x/cocos" again
|
# prevent tests project to build "cocos2d-x/cocos" again
|
||||||
set(BUILD_ENGINE_DONE ON)
|
set(BUILD_ENGINE_DONE ON)
|
||||||
|
|
||||||
# add cpp tests default
|
if(BUILD_TESTS)
|
||||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-empty-test ${ENGINE_BINARY_PATH}/tests/cpp-empty-test)
|
# add cpp tests default
|
||||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests)
|
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-empty-test ${ENGINE_BINARY_PATH}/tests/cpp-empty-test)
|
||||||
|
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests)
|
||||||
|
|
||||||
if(BUILD_EXTENSION_FAIRYGUI)
|
if(BUILD_EXTENSION_FAIRYGUI)
|
||||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/fairygui-tests ${ENGINE_BINARY_PATH}/tests/fairygui-tests)
|
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/fairygui-tests ${ENGINE_BINARY_PATH}/tests/fairygui-tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_LUA_LIBS)
|
||||||
|
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/lua-empty-test/project ${ENGINE_BINARY_PATH}/tests/lua-empty-test)
|
||||||
|
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/lua-tests/project ${ENGINE_BINARY_PATH}/tests/lua-test)
|
||||||
|
endif(BUILD_LUA_LIBS)
|
||||||
|
|
||||||
|
# add cpp-template-default into project(Cocos2d-x) for tmp test
|
||||||
|
add_subdirectory(${COCOS2DX_ROOT_PATH}/templates/cpp-template-default ${ENGINE_BINARY_PATH}/tests/HelloCpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_LUA_LIBS)
|
|
||||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/lua-empty-test/project ${ENGINE_BINARY_PATH}/tests/lua-empty-test)
|
|
||||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/lua-tests/project ${ENGINE_BINARY_PATH}/tests/lua-test)
|
|
||||||
endif(BUILD_LUA_LIBS)
|
|
||||||
|
|
||||||
# add cpp-template-default into project(Cocos2d-x) for tmp test
|
|
||||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/templates/cpp-template-default ${ENGINE_BINARY_PATH}/tests/HelloCpp)
|
|
||||||
|
|
Loading…
Reference in New Issue