axmol/tests/lua-empty-test/project/CMakeLists.txt

55 lines
1.9 KiB
CMake
Raw Normal View History

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-03-10 20:07:20 +08:00
Squashed commit of the following: commit b9181ae92541d11119bedd766773ddb01f0bb486 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 9 09:34:40 2014 -0700 Compiles luasocket on Mac commit 91fc79aa2101867fedfbcd7d846e9508009894e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 9 09:12:30 2014 -0700 disables luasockets commit 31f2ee462708ab7b604b9399eaabd275e2da9e02 Merge: 19099fd 0abe4cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 9 08:10:48 2014 -0700 Merge remote-tracking branch 'cocos2d/v3' into cmakefile_mac_osx Conflicts: cocos/3d/cocos3d.h commit 19099fd021b4ecf1f2eebd73ea14e84572d1ee33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 23:21:03 2014 -0700 compiles on Linux commit eec7b92817ac9208123468bb882612aad89f94bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 23:16:46 2014 -0700 all projecs compiles with CMake commit 40fcc8325b409a580fdbf26d2ee27aa2d1db0109 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 21:47:27 2014 -0700 CCUserDefualt.mm better includes commit 30709ec8243562858498cb118240bb45bf9b33b0 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 21:26:36 2014 -0700 cpp-tests compiles and works on Mac using CMake commit 67f0fc8df887d08d3d7a27c5fdadd335d6841676 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 20:12:09 2014 -0700 Adds missing files to CMakeLists.txt commit 36f939ea7f157ca851aee138300c13d9888c0078 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 19:52:34 2014 -0700 Adds more box2d missing files commit 00f81e3b5ec97150974cc6022e86c394ff488ccb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 19:39:54 2014 -0700 Adds missing box2d files commit 9673227b4d7d0e6d9eced49bdd69b98cb519968a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 18:44:15 2014 -0700 Initial CMake support for Mac
2014-09-10 03:18:31 +08:00
if(LINUX)
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 "")
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})
Squashed commit of the following: commit b9181ae92541d11119bedd766773ddb01f0bb486 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 9 09:34:40 2014 -0700 Compiles luasocket on Mac commit 91fc79aa2101867fedfbcd7d846e9508009894e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 9 09:12:30 2014 -0700 disables luasockets commit 31f2ee462708ab7b604b9399eaabd275e2da9e02 Merge: 19099fd 0abe4cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Sep 9 08:10:48 2014 -0700 Merge remote-tracking branch 'cocos2d/v3' into cmakefile_mac_osx Conflicts: cocos/3d/cocos3d.h commit 19099fd021b4ecf1f2eebd73ea14e84572d1ee33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 23:21:03 2014 -0700 compiles on Linux commit eec7b92817ac9208123468bb882612aad89f94bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 23:16:46 2014 -0700 all projecs compiles with CMake commit 40fcc8325b409a580fdbf26d2ee27aa2d1db0109 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 21:47:27 2014 -0700 CCUserDefualt.mm better includes commit 30709ec8243562858498cb118240bb45bf9b33b0 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 21:26:36 2014 -0700 cpp-tests compiles and works on Mac using CMake commit 67f0fc8df887d08d3d7a27c5fdadd335d6841676 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 20:12:09 2014 -0700 Adds missing files to CMakeLists.txt commit 36f939ea7f157ca851aee138300c13d9888c0078 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 19:52:34 2014 -0700 Adds more box2d missing files commit 00f81e3b5ec97150974cc6022e86c394ff488ccb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 19:39:54 2014 -0700 Adds missing box2d files commit 9673227b4d7d0e6d9eced49bdd69b98cb519968a Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Sep 8 18:44:15 2014 -0700 Initial CMake support for Mac
2014-09-10 03:18:31 +08:00
endif()
2014-03-10 20:07:20 +08:00
include_directories(
Classes
../../../cocos/scripting/lua-bindings/manual
2014-03-10 20:07:20 +08:00
../../../external/lua/lua
../../../external/lua/tolua
)
# add the executable
add_executable(${APP_NAME} ${SAMPLE_SRC})
2014-03-10 20:07:20 +08:00
target_link_libraries(${APP_NAME} cocos2d luacocos2d)
2014-03-10 20:07:20 +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
set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}")
2014-03-10 20:07:20 +08:00
set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}")
pre_build(${APP_NAME}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../res ${APP_BIN_DIR}${RES_PREFIX}/res
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../src ${APP_BIN_DIR}${RES_PREFIX}/src
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/ ${APP_BIN_DIR}${RES_PREFIX}/src/cocos
)
endif()