CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #/****************************************************************************
  2. # Copyright (c) 2013 cocos2d-x.org
  3. # Copyright (c) 2014 martell malone
  4. # Copyright (c) 2015-2017 Chukong Technologies Inc.
  5. #
  6. # http://www.cocos2d-x.org
  7. #
  8. # Permission is hereby granted, free of charge, to any person obtaining a copy
  9. # of this software and associated documentation files (the "Software"), to deal
  10. # in the Software without restriction, including without limitation the rights
  11. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. # copies of the Software, and to permit persons to whom the Software is
  13. # furnished to do so, subject to the following conditions:
  14. # The above copyright notice and this permission notice shall be included in
  15. # all copies or substantial portions of the Software.
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. # THE SOFTWARE.
  23. # ****************************************************************************/
  24. # build engine library and all tests
  25. cmake_minimum_required(VERSION 3.1)
  26. project(Cocos2d-x)
  27. # cocos2dx root path
  28. set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
  29. set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/)
  30. # works before build libcocos2d
  31. include(CocosBuildSet)
  32. # default tests include lua, js test project, so we set those option on to build libs
  33. set(BUILD_LUA_LIBS ON)
  34. set(BUILD_JS_LIBS ON)
  35. if(NOT USE_COCOS_PREBUILT)
  36. add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
  37. endif()
  38. add_subdirectory(${COCOS2DX_ROOT_PATH}/tests ${ENGINE_BINARY_PATH}/tests)