CMakeLists.txt 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #/****************************************************************************
  2. # Copyright (c) 2015-2017 Chukong Technologies Inc.
  3. #
  4. # http://www.cocos2d-x.org
  5. #
  6. # Permission is hereby granted, free of charge, to any person obtaining a copy
  7. # of this software and associated documentation files (the "Software"), to deal
  8. # in the Software without restriction, including without limitation the rights
  9. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. # copies of the Software, and to permit persons to whom the Software is
  11. # furnished to do so, subject to the following conditions:
  12. # The above copyright notice and this permission notice shall be included in
  13. # all copies or substantial portions of the Software.
  14. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. # THE SOFTWARE.
  21. # ****************************************************************************/
  22. include_directories(./platform)
  23. include_directories(../external/glfw3)
  24. include_directories(../external/glfw3/include)
  25. include_directories(../external/glfw3/include/mac)
  26. if(WINDOWS)
  27. include_directories(./platform/win32)
  28. include_directories(./platform/desktop)
  29. set(COCOS_PLATFORM_SPECIFIC_SRC
  30. platform/win32/CCStdC-win32.cpp
  31. platform/win32/CCUtils-win32.cpp
  32. platform/win32/CCFileUtils-win32.cpp
  33. platform/win32/CCCommon-win32.cpp
  34. platform/win32/CCApplication-win32.cpp
  35. platform/win32/CCDevice-win32.cpp
  36. platform/win32/inet_pton_mingw.cpp
  37. platform/desktop/CCGLViewImpl-desktop.cpp
  38. )
  39. elseif(MACOSX OR APPLE)
  40. include_directories(./platform/mac)
  41. include_directories(./platform/apple)
  42. include_directories(./platform/desktop)
  43. set(COCOS_PLATFORM_SPECIFIC_SRC
  44. platform/mac/CCApplication-mac.mm
  45. platform/mac/CCCommon-mac.mm
  46. platform/mac/CCDevice-mac.mm
  47. platform/apple/CCLock-apple.cpp
  48. platform/apple/CCFileUtils-apple.mm
  49. platform/apple/CCThread-apple.mm
  50. platform/apple/CCDevice-apple.mm
  51. platform/desktop/CCGLViewImpl-desktop.cpp
  52. )
  53. elseif(LINUX)
  54. include_directories(
  55. /usr/include
  56. /usr/include/GLFW
  57. /usr/local/include/GLFW
  58. )
  59. include_directories(./platform/linux)
  60. include_directories(./platform/desktop)
  61. set(COCOS_PLATFORM_SPECIFIC_SRC
  62. platform/linux/CCStdC-linux.cpp
  63. platform/linux/CCFileUtils-linux.cpp
  64. platform/linux/CCCommon-linux.cpp
  65. platform/linux/CCApplication-linux.cpp
  66. platform/linux/CCDevice-linux.cpp
  67. platform/desktop/CCGLViewImpl-desktop.cpp
  68. )
  69. elseif(ANDROID)
  70. include_directories(./platform/android)
  71. include_directories(./platform/android/jni)
  72. set(COCOS_PLATFORM_SPECIFIC_SRC
  73. platform/android/CCApplication-android.cpp
  74. platform/android/CCCommon-android.cpp
  75. platform/android/CCGLViewImpl-android.cpp
  76. platform/android/CCFileUtils-android.cpp
  77. platform/android/CCEnhanceAPI-android.cpp
  78. platform/android/jni/JniHelper.cpp
  79. )
  80. set(COCOS2DX_ANDROID_STATIC
  81. platform/android/CCDevice-android.cpp
  82. platform/android/javaactivity-android.cpp
  83. platform/android/jni/TouchesJni.cpp
  84. platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp
  85. platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp
  86. platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp
  87. platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp
  88. )
  89. add_library(cocos2dxandroid_static STATIC ${COCOS2DX_ANDROID_STATIC})
  90. set_property(TARGET cocos2dxandroid_static PROPERTY POSITION_INDEPENDENT_CODE TRUE)
  91. set_target_properties(cocos2dxandroid_static
  92. PROPERTIES
  93. ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
  94. LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
  95. VERSION "${COCOS2D_X_VERSION}"
  96. )
  97. endif()
  98. #leave andatory external stuff here also
  99. include_directories(
  100. ../external
  101. ../external/ConvertUTF
  102. ../external/edtaa3func
  103. ../external/poly2tri
  104. ../external/poly2tri/common
  105. ../external/poly2tri/sweep
  106. )
  107. set(COCOS_PLATFORM_SRC
  108. platform/CCSAXParser.cpp
  109. platform/CCThread.cpp
  110. platform/CCGLView.cpp
  111. platform/CCFileUtils.cpp
  112. platform/CCImage.cpp
  113. ../external/edtaa3func/edtaa3func.cpp
  114. ../external/ConvertUTF/ConvertUTFWrapper.cpp
  115. ../external/ConvertUTF/ConvertUTF.c
  116. ../external/md5/md5.c
  117. ../external/poly2tri/common/shapes.cc
  118. ../external/poly2tri/sweep/advancing_front.cc
  119. ../external/poly2tri/sweep/cdt.cc
  120. ../external/poly2tri/sweep/sweep_context.cc
  121. ../external/poly2tri/sweep/sweep.cc
  122. ${COCOS_PLATFORM_SPECIFIC_SRC}
  123. )