2014-03-11 17:56:33 +08:00
|
|
|
set(APP_NAME lua-empty-test)
|
2014-03-10 20:07:20 +08:00
|
|
|
|
|
|
|
set(SAMPLE_SRC
|
|
|
|
Classes/AppDelegate.cpp
|
|
|
|
)
|
|
|
|
|
2014-09-10 03:18:31 +08:00
|
|
|
if(LINUX)
|
|
|
|
set(SAMPLE_SRC
|
|
|
|
${SAMPLE_SRC}
|
|
|
|
proj.linux/main.cpp
|
|
|
|
)
|
2014-11-11 14:49:27 +08:00
|
|
|
elseif(MACOSX OR APPLE)
|
|
|
|
set(SAMPLE_SRC
|
|
|
|
${SAMPLE_SRC}
|
|
|
|
proj.mac/main.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
list(APPEND SAMPLE_SRC ${APP_RESOURCES} ${APP_SCRIPTS} ${COCOS_SCRIPTS})
|
2014-09-10 03:18:31 +08:00
|
|
|
endif()
|
|
|
|
|
2014-03-10 20:07:20 +08:00
|
|
|
include_directories(
|
|
|
|
Classes
|
2014-08-24 18:52:51 +08:00
|
|
|
../../../cocos/scripting/lua-bindings/manual
|
2014-03-10 20:07:20 +08:00
|
|
|
../../../external/lua/lua
|
|
|
|
../../../external/lua/tolua
|
|
|
|
)
|
|
|
|
|
|
|
|
# add the executable
|
2014-08-24 18:52:51 +08:00
|
|
|
add_executable(${APP_NAME} ${SAMPLE_SRC})
|
2014-03-10 20:07:20 +08:00
|
|
|
|
2014-08-24 18:52:51 +08:00
|
|
|
target_link_libraries(${APP_NAME} cocos2d luacocos2d)
|
2014-03-10 20:07:20 +08:00
|
|
|
|
2014-11-11 14:49:27 +08:00
|
|
|
if(MACOSX OR APPLE)
|
|
|
|
set_target_properties(${APP_NAME} PROPERTIES
|
|
|
|
MACOSX_BUNDLE 1
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
|
|
|
)
|
|
|
|
|
|
|
|
else()
|
2014-03-10 20:07:20 +08:00
|
|
|
|
2014-11-11 14:49:27 +08:00
|
|
|
set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}")
|
2014-03-10 20:07:20 +08:00
|
|
|
|
2014-11-11 14:49:27 +08:00
|
|
|
set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}")
|
|
|
|
|
|
|
|
pre_build(${APP_NAME}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../res ${APP_BIN_DIR}/Resources/res
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../src ${APP_BIN_DIR}/Resources/src
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/ ${APP_BIN_DIR}/Resources/src/cocos
|
|
|
|
)
|
|
|
|
|
|
|
|
endif()
|