2016-05-14 08:49:39 +08:00
|
|
|
set(APP_NAME lua-tests)
|
2014-03-10 17:10:08 +08:00
|
|
|
|
|
|
|
set(SAMPLE_SRC
|
2014-09-10 03:18:31 +08:00
|
|
|
Classes/AppDelegate.cpp
|
|
|
|
Classes/lua_assetsmanager_test_sample.cpp
|
2014-10-10 09:49:25 +08:00
|
|
|
Classes/lua_test_bindings.cpp
|
2014-03-10 17:10:08 +08:00
|
|
|
)
|
|
|
|
|
2014-09-10 03:18:31 +08:00
|
|
|
if(LINUX)
|
2014-11-17 06:42:04 +08:00
|
|
|
set(SAMPLE_SRC ${SAMPLE_SRC} proj.linux/main.cpp)
|
|
|
|
set(RES_PREFIX "/Resources")
|
|
|
|
elseif(WINDOWS)
|
|
|
|
list(APPEND SAMPLE_SRC proj.win32/main.cpp)
|
|
|
|
set(RES_PREFIX "")
|
2014-09-10 03:18:31 +08:00
|
|
|
elseif(MACOSX)
|
2014-11-17 06:42:04 +08:00
|
|
|
set(SAMPLE_SRC ${SAMPLE_SRC} proj.ios_mac/mac/main.cpp)
|
2014-11-11 14:49:27 +08:00
|
|
|
|
|
|
|
file(GLOB_RECURSE APP_RESOURCES ../res/*)
|
|
|
|
cocos_mark_resources(FILES ${APP_RESOURCES} BASEDIR ../res RESOURCEBASE Resources/res)
|
|
|
|
file(GLOB_RECURSE APP_SCRIPTS ../src/*)
|
|
|
|
cocos_mark_resources(FILES ${APP_SCRIPTS} BASEDIR ../src RESOURCEBASE Resources/src)
|
|
|
|
file(GLOB_RECURSE COCOS_SCRIPTS ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/*)
|
|
|
|
cocos_mark_resources(FILES ${COCOS_SCRIPTS} BASEDIR ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script RESOURCEBASE Resources/src/cocos)
|
|
|
|
file(GLOB_RECURSE TEST_RESOURCES ${CMAKE_SOURCE_DIR}/tests/cpp-tests/Resources/*)
|
|
|
|
cocos_mark_resources(FILES ${TEST_RESOURCES} BASEDIR ${CMAKE_SOURCE_DIR}/tests/cpp-tests/Resources RESOURCEBASE Resources/res)
|
|
|
|
|
|
|
|
list(APPEND SAMPLE_SRC ${APP_RESOURCES} ${APP_SCRIPTS} ${COCOS_SCRIPTS} ${TEST_RESOURCES})
|
2014-09-10 03:18:31 +08:00
|
|
|
endif()
|
|
|
|
|
2014-03-10 17:10:08 +08:00
|
|
|
include_directories(
|
|
|
|
Classes
|
|
|
|
../../../cocos/scripting/lua-bindings/manual
|
|
|
|
../../../cocos/scripting/lua-bindings/auto
|
|
|
|
../../../external/lua/lua
|
|
|
|
../../../external/lua/tolua
|
|
|
|
)
|
|
|
|
|
|
|
|
# add the executable
|
2014-11-11 14:49:27 +08:00
|
|
|
add_executable(${APP_NAME} ${SAMPLE_SRC})
|
2014-03-10 17:10:08 +08:00
|
|
|
|
2014-11-11 14:49:27 +08:00
|
|
|
target_link_libraries(${APP_NAME} luacocos2d cocos2d)
|
|
|
|
|
|
|
|
if(MACOSX OR APPLE)
|
|
|
|
set_target_properties(${APP_NAME} PROPERTIES
|
|
|
|
MACOSX_BUNDLE 1
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
|
|
|
)
|
|
|
|
|
|
|
|
else()
|
2014-03-10 17:10:08 +08:00
|
|
|
|
2014-11-11 14:49:27 +08:00
|
|
|
set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}")
|
2014-03-10 17:10:08 +08:00
|
|
|
|
2014-11-11 14:49:27 +08:00
|
|
|
set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}")
|
2014-03-10 17:10:08 +08:00
|
|
|
|
2014-11-11 14:49:27 +08:00
|
|
|
pre_build(${APP_NAME}
|
2014-11-17 06:42:04 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../res ${APP_BIN_DIR}${RES_PREFIX}/res
|
2014-11-27 11:17:48 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../src ${APP_BIN_DIR}${RES_PREFIX}/src
|
2014-11-19 08:28:41 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/ ${APP_BIN_DIR}/Resources/src/cocos
|
2014-11-17 06:42:04 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tests/cpp-tests/Resources ${APP_BIN_DIR}${RES_PREFIX}/res
|
2014-11-11 14:49:27 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
endif()
|
2014-03-10 17:10:08 +08:00
|
|
|
|