axmol/tests/cpp-tests/CMakeLists.txt

642 lines
24 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.10)
2019-11-23 20:27:39 +08:00
set(APP_NAME cpp_tests)
2019-11-23 20:27:39 +08:00
# "too large PDB" error often occurs in cpp-tests when using default "/Zi"
if (MSVC)
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
endif()
2019-11-23 20:27:39 +08:00
project(${APP_NAME})
if(NOT DEFINED BUILD_ENGINE_DONE)
if(XCODE)
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
endif()
set(_AX_ROOT "$ENV{AX_ROOT}")
if(NOT (_AX_ROOT STREQUAL ""))
file(TO_CMAKE_PATH ${_AX_ROOT} _AX_ROOT)
message(STATUS "Using system env var _AX_ROOT=${_AX_ROOT}")
else()
set(_AX_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
endif()
2023-09-02 19:56:33 +08:00
set(CMAKE_MODULE_PATH ${_AX_ROOT}/cmake/Modules/)
2019-11-23 20:27:39 +08:00
2022-08-08 18:02:17 +08:00
include(AXBuildSet)
add_subdirectory(${_AX_ROOT}/core ${ENGINE_BINARY_PATH}/axmol/core)
2019-11-23 20:27:39 +08:00
endif()
# record sources, headers, resources...
file(GLOB GAME_SOURCE Source/*.cpp)
file(GLOB GAME_HEADER Source/*.h)
set(GAME_INC_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/Source"
)
2019-11-23 20:27:39 +08:00
set(content_folder
"${CMAKE_CURRENT_SOURCE_DIR}/Content"
2019-11-23 20:27:39 +08:00
)
if(APPLE)
ax_mark_multi_resources(common_content_files RES_TO "Resources" FOLDERS ${content_folder})
elseif(WINDOWS)
ax_mark_multi_resources(common_content_files RES_TO "Content" FOLDERS ${content_folder})
2019-11-23 20:27:39 +08:00
endif()
if(ANDROID)
list(APPEND GAME_HEADER
Source/JNITest/JNITest.h
2019-11-23 20:27:39 +08:00
)
list(APPEND GAME_SOURCE
Source/JNITest/JNITest.cpp
2019-11-23 20:27:39 +08:00
proj.android/app/jni/main.cpp
)
elseif(LINUX)
list(APPEND GAME_SOURCE
proj.linux/main.cpp
)
list(APPEND GAME_SOURCE ${common_content_files})
elseif(EMSCRIPTEN)
list(APPEND GAME_SOURCE
proj.emscripten/main.cpp
)
list(APPEND GAME_SOURCE ${common_content_files})
2019-11-23 20:27:39 +08:00
elseif(WINDOWS)
if(NOT WINRT)
list(APPEND GAME_HEADER
proj.win32/main.h
)
list(APPEND GAME_SOURCE
proj.win32/main.cpp
${common_content_files}
)
else()
ax_setup_winrt_sources()
endif()
list(APPEND GAME_SOURCE ${common_content_files})
2019-11-23 20:27:39 +08:00
elseif(APPLE)
if(IOS)
list(APPEND GAME_HEADER
proj.ios/Source/testsAppDelegate.h
proj.ios/Source/RootViewController.h
2019-11-23 20:27:39 +08:00
)
if (TVOS)
set(APP_UI_RES
proj.ios/LaunchScreenBackground.png
proj.ios/targets/tvos/LaunchScreen.storyboard
proj.ios/targets/tvos/Images.xcassets
)
else()
set(APP_UI_RES
proj.ios/LaunchScreenBackground.png
proj.ios/targets/ios/LaunchScreen.storyboard
proj.ios/targets/ios/Images.xcassets
)
endif()
2019-11-23 20:27:39 +08:00
list(APPEND GAME_SOURCE
proj.ios/main.m
proj.ios/Source/testsAppDelegate.mm
proj.ios/Source/RootViewController.mm
2019-11-23 20:27:39 +08:00
proj.ios/Prefix.pch
${APP_UI_RES}
)
elseif(MACOSX)
set(APP_UI_RES
proj.mac/Icon.icns
proj.mac/Info.plist
proj.mac/Prefix.pch
proj.mac/en.lproj/InfoPlist.strings
)
list(APPEND GAME_SOURCE
proj.mac/main.cpp
${APP_UI_RES}
)
endif()
list(APPEND GAME_SOURCE ${common_content_files})
2019-11-23 20:27:39 +08:00
endif()
list(APPEND GAME_HEADER
Source/ActionsEaseTest/ActionsEaseTest.h
Source/ParallaxTest/ParallaxTest.h
Source/testBasic.h
Source/ZwoptexTest/ZwoptexTest.h
Source/CurlTest/CurlTest.h
Source/UnitTest/UnitTest.h
# Source/UnitTest/RefPtrTest.h
Source/ConfigurationTest/ConfigurationTest.h
Source/CurrentLanguageTest/CurrentLanguageTest.h
Source/AppDelegate.h
Source/LabelTest/LabelTestNew.h
# Source/LabelTest/LabelTest.h
Source/Particle3DTest/Particle3DTest.h
Source/VibrateTest/VibrateTest.h
Source/ClippingNodeTest/ClippingNodeTest.h
Source/UserDefaultTest/UserDefaultTest.h
Source/ImGuiTest/ImGuiTest.h
Source/tests.h
Source/DataVisitorTest/DataVisitorTest.h
Source/NewAudioEngineTest/NewAudioEngineTest.h
Source/BugsTest/Bug-422.h
Source/BugsTest/Bug-DrawNode.h
Source/BugsTest/BugsTest.h
Source/BugsTest/Bug-12847.h
Source/BugsTest/Bug-899.h
Source/BugsTest/Bug-1159.h
Source/BugsTest/Bug-350.h
Source/BugsTest/Bug-15594.h
Source/BugsTest/Bug-914.h
Source/BugsTest/Bug-624.h
Source/BugsTest/Bug-458/QuestionContainerSprite.h
Source/BugsTest/Bug-458/Bug-458.h
Source/BugsTest/Bug-886.h
Source/BugsTest/Bug-Child.h
Source/BugsTest/Bug-15776.h
Source/BugsTest/Bug-1174.h
Source/ActionsTest/ActionsTest.h
Source/TouchesTest/TouchesTest.h
Source/TouchesTest/Ball.h
Source/TouchesTest/Paddle.h
Source/ActionManagerTest/ActionManagerTest.h
Source/ClickAndMoveTest/ClickAndMoveTest.h
Source/MaterialSystemTest/MaterialSystemTest.h
Source/IntervalTest/IntervalTest.h
Source/TileMapTest/TileMapTest2.h
# Source/TileMapTest/TileMapTest.h
Source/NewEventDispatcherTest/NewEventDispatcherTest.h
Source/ActionsProgressTest/ActionsProgressTest.h
Source/RotateWorldTest/RotateWorldTest.h
Source/Camera3DTest/Camera3DTest.h
Source/TextInputTest/TextInputTest.h
Source/Texture2dTest/Texture2dTest.h
Source/TerrainTest/TerrainTest.h
Source/controller.h
Source/TransitionsTest/TransitionsTest.h
Source/TextureCacheTest/TextureCacheTest.h
Source/MotionStreakTest/MotionStreakTest.h
Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h
Source/ExtensionsTest/ExtensionsTest.h
Source/ExtensionsTest/TableViewTest/CustomTableViewCell.h
Source/ExtensionsTest/TableViewTest/TableViewTestScene.h
Source/MeshRendererTest/MeshRendererTest.h
Source/MeshRendererTest/DrawNode3D.h
Source/BaseTest.h
Source/SceneTest/SceneTest.h
Source/ReleasePoolTest/ReleasePoolTest.h
Source/InputTest/MouseTest.h
Source/SpineTest/SpineTest.h
# Source/Scene3DTest/Scene3DTest.h
Source/ParticleTest/ParticleTest.h
Source/EffectsTest/EffectsTest.h
Source/UITest/UITest.h
Source/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h
Source/UITest/CocoStudioGUITest/CocosGUIScene.h
Source/UITest/CocoStudioGUITest/UITabControlTest/UITabControlTest.h
Source/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h
Source/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h
Source/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h
Source/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.h
Source/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h
Source/UITest/CocoStudioGUITest/UIEditBoxTest.h
Source/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.h
Source/UITest/CocoStudioGUITest/UIScene.h
Source/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h
Source/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h
Source/UITest/CocoStudioGUITest/UIScale9SpriteTest.h
Source/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.h
Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h
Source/UITest/CocoStudioGUITest/UISceneManager.h
Source/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.h
Source/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h
Source/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.h
Source/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h
Source/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.h
Source/UITest/CocoStudioGUITest/UITextTest/UITextTest.h
Source/DrawPrimitivesTest/DrawPrimitivesTest.h
Source/BillBoardTest/BillBoardTest.h
Source/SpriteFrameCacheTest/SpriteFrameCacheTest.h
Source/EffectsAdvancedTest/EffectsAdvancedTest.h
Source/SchedulerTest/SchedulerTest.h
Source/MultiTouchTest/MultiTouchTest.h
Source/testResource.h
2023-09-02 19:56:33 +08:00
Source/ShaderTest/ShaderTest.vsh.h
Source/ShaderTest/shaderTest.psh.h
Source/ShaderTest/ShaderTest.h
Source/ShaderTest/ShaderTest2.h
Source/NewRendererTest/NewRendererTest.h
Source/SpritePolygonTest/SpritePolygonTest.h
Source/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.h
Source/NodeTest/NodeTest.h
Source/FileUtilsTest/FileUtilsTest.h
Source/RenderTextureTest/RenderTextureTest.h
Source/LayerTest/LayerTest.h
Source/SpriteTest/SpriteTest.h
Source/FontTest/FontTest.h
Source/LightTest/LightTest.h
Source/VisibleRect.h
Source/NetworkTest/NetworkTest.h
Source/NetworkTest/DownloaderTest/DownloaderTest.h
Source/NetworkTest/HttpClientTest/HttpClientTest.h
Source/OpenURLTest/OpenURLTest.h
Source/ConsoleTest/ConsoleTest.h
Source/MenuTest/MenuTest.h
Source/ZipTest/ZipTests.h
2019-11-23 20:27:39 +08:00
)
list(APPEND GAME_SOURCE
Source/ActionManagerTest/ActionManagerTest.cpp
Source/ActionsEaseTest/ActionsEaseTest.cpp
Source/ActionsProgressTest/ActionsProgressTest.cpp
Source/ActionsTest/ActionsTest.cpp
Source/AppDelegate.cpp
Source/BaseTest.cpp
Source/BillBoardTest/BillBoardTest.cpp
Source/BugsTest/Bug-DrawNode.cpp
Source/BugsTest/Bug-1159.cpp
Source/BugsTest/Bug-1174.cpp
Source/BugsTest/Bug-350.cpp
Source/BugsTest/Bug-422.cpp
Source/BugsTest/Bug-458/Bug-458.cpp
Source/BugsTest/Bug-458/QuestionContainerSprite.cpp
Source/BugsTest/Bug-624.cpp
Source/BugsTest/Bug-886.cpp
Source/BugsTest/Bug-899.cpp
Source/BugsTest/Bug-914.cpp
Source/BugsTest/Bug-12847.cpp
Source/BugsTest/Bug-15594.cpp
Source/BugsTest/Bug-15776.cpp
Source/BugsTest/Bug-Child.cpp
Source/BugsTest/BugsTest.cpp
Source/Camera3DTest/Camera3DTest.cpp
Source/ClickAndMoveTest/ClickAndMoveTest.cpp
Source/ClippingNodeTest/ClippingNodeTest.cpp
Source/ConfigurationTest/ConfigurationTest.cpp
Source/ConsoleTest/ConsoleTest.cpp
Source/CurlTest/CurlTest.cpp
Source/CurrentLanguageTest/CurrentLanguageTest.cpp
Source/DataVisitorTest/DataVisitorTest.cpp
Source/NetworkTest/NetworkTest.cpp
Source/NetworkTest/DownloaderTest/DownloaderTest.cpp
Source/NetworkTest/HttpClientTest/HttpClientTest.cpp
Source/DrawPrimitivesTest/DrawPrimitivesTest.cpp
Source/EffectsAdvancedTest/EffectsAdvancedTest.cpp
Source/EffectsTest/EffectsTest.cpp
Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp
Source/ExtensionsTest/ExtensionsTest.cpp
Source/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp
Source/ExtensionsTest/TableViewTest/TableViewTestScene.cpp
Source/FileUtilsTest/FileUtilsTest.cpp
Source/FontTest/FontTest.cpp
Source/InputTest/MouseTest.cpp
Source/IntervalTest/IntervalTest.cpp
# Source/LabelTest/LabelTest.cpp
Source/LabelTest/LabelTestNew.cpp
Source/LayerTest/LayerTest.cpp
Source/LightTest/LightTest.cpp
Source/MaterialSystemTest/MaterialSystemTest.cpp
Source/MenuTest/MenuTest.cpp
Source/MotionStreakTest/MotionStreakTest.cpp
Source/MultiTouchTest/MultiTouchTest.cpp
Source/NewAudioEngineTest/NewAudioEngineTest.cpp
Source/NewEventDispatcherTest/NewEventDispatcherTest.cpp
Source/NewRendererTest/NewRendererTest.cpp
Source/NodeTest/NodeTest.cpp
Source/OpenURLTest/OpenURLTest.cpp
Source/ParallaxTest/ParallaxTest.cpp
Source/Particle3DTest/Particle3DTest.cpp
Source/ParticleTest/ParticleTest.cpp
Source/ReleasePoolTest/ReleasePoolTest.cpp
Source/RenderTextureTest/RenderTextureTest.cpp
Source/RotateWorldTest/RotateWorldTest.cpp
Source/SceneTest/SceneTest.cpp
Source/SchedulerTest/SchedulerTest.cpp
Source/ShaderTest/ShaderTest.cpp
Source/ShaderTest/ShaderTest2.cpp
Source/SpineTest/SpineTest.cpp
# Source/Scene3DTest/Scene3DTest.cpp
Source/MeshRendererTest/DrawNode3D.cpp
Source/MeshRendererTest/MeshRendererTest.cpp
Source/SpritePolygonTest/SpritePolygonTest.cpp
Source/SpriteTest/SpriteTest.cpp
Source/TerrainTest/TerrainTest.cpp
Source/TextInputTest/TextInputTest.cpp
Source/Texture2dTest/Texture2dTest.cpp
Source/TextureCacheTest/TextureCacheTest.cpp
Source/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp
#Source/TileMapTest/TileMapTest.cpp
Source/TileMapTest/TileMapTest2.cpp
Source/TouchesTest/Ball.cpp
Source/TouchesTest/Paddle.cpp
Source/TouchesTest/TouchesTest.cpp
Source/TransitionsTest/TransitionsTest.cpp
Source/UITest/CocoStudioGUITest/CocosGUIScene.cpp
Source/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp
Source/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp
Source/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp
Source/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp
Source/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp
Source/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp
Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp
Source/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp
Source/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp
Source/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp
Source/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp
Source/UITest/CocoStudioGUITest/UIScene.cpp
Source/UITest/CocoStudioGUITest/UISceneManager.cpp
Source/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp
Source/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp
Source/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp
Source/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp
Source/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp
Source/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp
Source/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp
Source/UITest/CocoStudioGUITest/UITabControlTest/UITabControlTest.cpp
Source/UITest/UITest.cpp
# Source/UnitTest/RefPtrTest.cpp
Source/UnitTest/UnitTest.cpp
Source/UserDefaultTest/UserDefaultTest.cpp
Source/ImGuiTest/ImGuiTest.cpp
Source/VisibleRect.cpp
Source/VibrateTest/VibrateTest.cpp
Source/ZwoptexTest/ZwoptexTest.cpp
Source/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp
Source/controller.cpp
Source/ZipTest/ZipTests.cpp
2019-11-23 20:27:39 +08:00
)
if(ANDROID OR MACOSX OR IOS OR (WINDOWS AND AX_ENABLE_MFMEDIA) OR AX_ENABLE_VLC_MEDIA)
2022-02-24 19:00:49 +08:00
list(APPEND GAME_HEADER
Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h)
2022-02-24 19:00:49 +08:00
list(APPEND GAME_SOURCE
Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp)
2022-02-24 19:00:49 +08:00
endif()
2023-03-14 12:08:31 +08:00
if(ANDROID OR IOS OR (WINDOWS AND AX_ENABLE_MSEDGE_WEBVIEW2))
2019-11-23 20:27:39 +08:00
list(APPEND GAME_HEADER
Source/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.h
2019-11-23 20:27:39 +08:00
)
list(APPEND GAME_SOURCE
Source/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp
2019-11-23 20:27:39 +08:00
)
endif()
if(WINDOWS OR MACOSX OR LINUX)
list(APPEND GAME_HEADER
Source/WindowTest/WindowTest.h
Source/BugsTest/Bug-14327.h
2019-11-23 20:27:39 +08:00
)
list(APPEND GAME_SOURCE
Source/WindowTest/WindowTest.cpp
Source/BugsTest/Bug-14327.cpp
2019-11-23 20:27:39 +08:00
)
endif()
2020-11-20 13:38:09 +08:00
list(APPEND GAME_HEADER
Source/Box2DTest/Box2dTest.h
)
list(APPEND GAME_SOURCE
Source/Box2DTest/Box2dTest.cpp
)
if((WINDOWS OR MACOSX OR LINUX) AND (NOT WINRT))
list(APPEND GAME_HEADER
Source/Box2DTestBed/tests/test.h
Source/Box2DTestBed/tests/settings.h
Source/Box2DTestBed/Box2DTestBed.h
2020-11-20 13:38:09 +08:00
)
2020-11-20 13:19:30 +08:00
list(APPEND GAME_SOURCE
Source/Box2DTestBed/Box2DTestBed.cpp
Source/Box2DTestBed/test.cpp
Source/Box2DTestBed/tests/add_pair.cpp
Source/Box2DTestBed/tests/apply_force.cpp
Source/Box2DTestBed/tests/body_types.cpp
Source/Box2DTestBed/tests/box_stack.cpp
Source/Box2DTestBed/tests/breakable.cpp
Source/Box2DTestBed/tests/bridge.cpp
Source/Box2DTestBed/tests/bullet_test.cpp
Source/Box2DTestBed/tests/cantilever.cpp
Source/Box2DTestBed/tests/car.cpp
Source/Box2DTestBed/tests/chain.cpp
Source/Box2DTestBed/tests/chain_problem.cpp
Source/Box2DTestBed/tests/character_collision.cpp
Source/Box2DTestBed/tests/circle_stack.cpp
Source/Box2DTestBed/tests/collision_filtering.cpp
Source/Box2DTestBed/tests/collision_processing.cpp
Source/Box2DTestBed/tests/compound_shapes.cpp
Source/Box2DTestBed/tests/confined.cpp
Source/Box2DTestBed/tests/continuous_test.cpp
Source/Box2DTestBed/tests/convex_hull.cpp
Source/Box2DTestBed/tests/conveyor_belt.cpp
Source/Box2DTestBed/tests/distance_joint.cpp
Source/Box2DTestBed/tests/distance_test.cpp
Source/Box2DTestBed/tests/dominos.cpp
Source/Box2DTestBed/tests/dump_loader.cpp
Source/Box2DTestBed/tests/dynamic_tree.cpp
Source/Box2DTestBed/tests/edge_shapes.cpp
Source/Box2DTestBed/tests/edge_test.cpp
Source/Box2DTestBed/tests/friction.cpp
Source/Box2DTestBed/tests/gear_joint.cpp
Source/Box2DTestBed/tests/heavy1.cpp
Source/Box2DTestBed/tests/heavy2.cpp
Source/Box2DTestBed/tests/mobile_balanced.cpp
Source/Box2DTestBed/tests/mobile_unbalanced.cpp
Source/Box2DTestBed/tests/motor_joint.cpp
Source/Box2DTestBed/tests/pinball.cpp
Source/Box2DTestBed/tests/platformer.cpp
Source/Box2DTestBed/tests/polygon_collision.cpp
Source/Box2DTestBed/tests/polygon_shapes.cpp
Source/Box2DTestBed/tests/prismatic_joint.cpp
Source/Box2DTestBed/tests/pulley_joint.cpp
Source/Box2DTestBed/tests/pyramid.cpp
Source/Box2DTestBed/tests/ray_cast.cpp
Source/Box2DTestBed/tests/restitution.cpp
Source/Box2DTestBed/tests/revolute_joint.cpp
Source/Box2DTestBed/tests/rope.cpp
Source/Box2DTestBed/tests/sensor.cpp
Source/Box2DTestBed/tests/shape_cast.cpp
Source/Box2DTestBed/tests/shape_editing.cpp
Source/Box2DTestBed/tests/skier.cpp
Source/Box2DTestBed/tests/slider_crank_1.cpp
Source/Box2DTestBed/tests/slider_crank_2.cpp
Source/Box2DTestBed/tests/theo_jansen.cpp
Source/Box2DTestBed/tests/tiles.cpp
Source/Box2DTestBed/tests/time_of_impact.cpp
Source/Box2DTestBed/tests/tumbler.cpp
Source/Box2DTestBed/tests/web.cpp
Source/Box2DTestBed/tests/wheel_joint.cpp
Source/Box2DTestBed/tests/wrecking_ball.cpp
)
endif()
2019-11-23 20:27:39 +08:00
list(APPEND GAME_HEADER
Source/Physics3DTest/Physics3DTest.h
Source/NavMeshTest/NavMeshTest.h
2019-11-23 20:27:39 +08:00
)
list(APPEND GAME_SOURCE
Source/Physics3DTest/Physics3DTest.cpp
Source/NavMeshTest/NavMeshTest.cpp
2019-11-23 20:27:39 +08:00
)
list(APPEND GAME_HEADER
Source/PhysicsTest/PhysicsTest.h
Source/ChipmunkTest/ChipmunkTest.h
)
2019-11-23 20:27:39 +08:00
list(APPEND GAME_SOURCE
Source/PhysicsTest/PhysicsTest.cpp
Source/ChipmunkTest/ChipmunkTest.cpp
)
if(WINDOWS OR MACOSX OR LINUX)
list(APPEND GAME_HEADER
Source/ChipmunkTestBed/demo/ChipmunkDemo.h
Source/ChipmunkTestBed/ChipmunkTestBed.h
)
set (TESTBED_C_SORUCES
Source/ChipmunkTestBed/demo/Bench.c
Source/ChipmunkTestBed/demo/Chains.c
Source/ChipmunkTestBed/demo/Convex.c
Source/ChipmunkTestBed/demo/Crane.c
Source/ChipmunkTestBed/demo/Joints.c
Source/ChipmunkTestBed/demo/LogoSmash.c
Source/ChipmunkTestBed/demo/OneWay.c
Source/ChipmunkTestBed/demo/Planet.c
Source/ChipmunkTestBed/demo/Player.c
Source/ChipmunkTestBed/demo/Plink.c
Source/ChipmunkTestBed/demo/Pump.c
Source/ChipmunkTestBed/demo/PyramidStack.c
Source/ChipmunkTestBed/demo/PyramidTopple.c
Source/ChipmunkTestBed/demo/Shatter.c
Source/ChipmunkTestBed/demo/Springies.c
Source/ChipmunkTestBed/demo/Sticky.c
Source/ChipmunkTestBed/demo/Tank.c
Source/ChipmunkTestBed/demo/TheoJansen.c
Source/ChipmunkTestBed/demo/Buoyancy.c
Source/ChipmunkTestBed/demo/ContactGraph.c
Source/ChipmunkTestBed/demo/Example.c
Source/ChipmunkTestBed/demo/Query.c
Source/ChipmunkTestBed/demo/Slice.c
Source/ChipmunkTestBed/demo/Unicycle.c
Source/ChipmunkTestBed/demo/Tumble.c)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set_source_files_properties(${TESTBED_C_SORUCES} PROPERTIES COMPILE_FLAGS "/TP")
else()
set_source_files_properties(${TESTBED_C_SORUCES} PROPERTIES LANGUAGE CXX)
endif()
list(APPEND GAME_SOURCE
${TESTBED_C_SORUCES}
Source/ChipmunkTestBed/ChipmunkTestBed.cpp
)
endif()
2022-11-01 19:50:43 +08:00
if (AX_ENABLE_EXT_EFFEKSEER)
list(APPEND GAME_HEADER Source/EffekseerTest/EffekseerTest.h)
list(APPEND GAME_SOURCE Source/EffekseerTest/EffekseerTest.cpp)
2022-11-01 19:50:43 +08:00
endif()
2019-11-23 20:27:39 +08:00
if(NOT LINUX)
list(APPEND GAME_SOURCE
Source/UITest/CocoStudioGUITest/UIEditBoxTest.cpp
2019-11-23 20:27:39 +08:00
)
endif()
# mark app complie info and libs info
set(all_code_files
${GAME_HEADER}
${GAME_SOURCE}
)
if(NOT ANDROID)
add_executable(${APP_NAME} ${all_code_files})
else()
add_library(${APP_NAME} SHARED ${all_code_files})
# whole archive for jni
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
2022-10-01 16:24:52 +08:00
config_android_shared_libs("org.axmol.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
2019-11-23 20:27:39 +08:00
endif()
2022-08-08 18:02:17 +08:00
target_link_libraries(${APP_NAME} ${_AX_CORE_LIB})
target_include_directories(${APP_NAME} PRIVATE ${GAME_INC_DIRS})
2019-11-23 20:27:39 +08:00
# mark app resources
ax_setup_app_config(${APP_NAME})
2019-11-23 20:27:39 +08:00
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)")
2022-10-01 16:24:52 +08:00
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.axmol.cpp-tests")
2019-11-23 20:27:39 +08:00
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist")
elseif(TVOS)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/targets/tvos/Info.plist")
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "Brand Assets")
2019-11-23 20:27:39 +08:00
elseif(IOS)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios/targets/ios/Info.plist")
2022-05-23 23:40:37 +08:00
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
2019-11-23 20:27:39 +08:00
endif()
# For code-signing, set the DEVELOPMENT_TEAM:
#set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "GRLXXXX2K9")
elseif(WINDOWS AND NOT WINRT)
2022-08-11 15:41:10 +08:00
ax_copy_target_dll(${APP_NAME})
2019-11-23 20:27:39 +08:00
endif()
if ((NOT APPLE) AND (NOT WINRT))
2022-08-11 15:41:10 +08:00
ax_get_resource_path(APP_RES_DIR ${APP_NAME})
ax_sync_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR} FOLDERS ${content_folder} SYM_LINK 1)
if(WINDOWS)
set_property(TARGET ${APP_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${content_folder}")
endif()
elseif(WINRT)
if(NOT DEFINED BUILD_ENGINE_DONE)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME})
endif()
2019-11-23 20:27:39 +08:00
endif()
if((NOT IOS) AND (NOT WINRT))
message("CMake ${APP_NAME} target_precompile_headers")
target_precompile_headers(${APP_NAME} PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:axmol.h>"
)
2019-12-02 18:17:42 +08:00
endif()
if (NOT DEFINED BUILD_ENGINE_DONE)
ax_uwp_set_all_targets_deploy_min_version()
endif()
set(GAME_RES_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/Content")
if(EMSCRIPTEN)
set(CMAKE_C_FLAGS "-s FORCE_FILESYSTEM=1 -s FETCH=1 -s USE_GLFW=3 -s VERBOSE=1 -s USE_LIBJPEG=1 -s USE_LIBPNG=1 -s USE_ZLIB=1 -s USE_FREETYPE=1")
set(CMAKE_CXX_FLAGS "-s FORCE_FILESYSTEM=1 -s FETCH=1 -s USE_GLFW=3 -s VERBOSE=1 -s USE_LIBJPEG=1 -s USE_LIBPNG=1 -s USE_ZLIB=1 -s USE_FREETYPE=1")
endif()
if(EMSCRIPTEN)
set(CMAKE_EXECUTABLE_SUFFIX ".html")
target_link_options(${APP_NAME} PRIVATE
"-sEXPORTED_FUNCTIONS=[_main]"
"-sEXPORTED_RUNTIME_METHODS=[ccall,cwrap]"
)
2023-09-02 19:56:33 +08:00
set(EMSCRIPTEN_LINK_FLAGS "-lidbfs.js -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2 -s INITIAL_MEMORY=512MB --shell-file ${CMAKE_CURRENT_SOURCE_DIR}/index.html --use-preload-cache")
# Disable wasm, generate js build
# string(APPEND EMSCRIPTEN_LINK_FLAGS " -s WASM=0")
foreach(FOLDER IN LISTS GAME_RES_FOLDER)
string(APPEND EMSCRIPTEN_LINK_FLAGS " --preload-file ${FOLDER}/@/")
endforeach()
set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS "${EMSCRIPTEN_LINK_FLAGS}")
endif()