2026-03-27 12:06:24 +08:00
|
|
|
cmake_minimum_required(VERSION 3.15)
|
|
|
|
|
|
|
|
|
|
project(XCEngine_EditorTests)
|
|
|
|
|
|
|
|
|
|
set(EDITOR_TEST_SOURCES
|
|
|
|
|
test_action_routing.cpp
|
2026-03-28 17:40:14 +08:00
|
|
|
test_scene_viewport_camera_controller.cpp
|
2026-03-29 16:18:13 +08:00
|
|
|
test_scene_viewport_move_gizmo.cpp
|
2026-03-31 21:54:00 +08:00
|
|
|
test_scene_viewport_rotate_gizmo.cpp
|
2026-04-01 16:42:57 +08:00
|
|
|
test_scene_viewport_scale_gizmo.cpp
|
2026-03-29 15:12:38 +08:00
|
|
|
test_scene_viewport_picker.cpp
|
|
|
|
|
test_scene_viewport_overlay_renderer.cpp
|
2026-04-01 19:47:15 +08:00
|
|
|
test_viewport_host_surface_utils.cpp
|
2026-04-01 20:03:44 +08:00
|
|
|
test_builtin_icon_layout_utils.cpp
|
2026-03-27 12:06:24 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/editor/src/Core/UndoManager.cpp
|
|
|
|
|
${CMAKE_SOURCE_DIR}/editor/src/Managers/SceneManager.cpp
|
|
|
|
|
${CMAKE_SOURCE_DIR}/editor/src/Managers/ProjectManager.cpp
|
2026-03-29 15:12:38 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportPicker.cpp
|
2026-03-29 16:18:13 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportMoveGizmo.cpp
|
2026-03-31 21:54:00 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportRotateGizmo.cpp
|
2026-04-01 16:42:57 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportScaleGizmo.cpp
|
2026-03-27 12:06:24 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
add_executable(editor_tests ${EDITOR_TEST_SOURCES})
|
|
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
|
set_target_properties(editor_tests PROPERTIES
|
|
|
|
|
LINK_FLAGS "/NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:libcmt.lib"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
target_link_libraries(editor_tests PRIVATE
|
|
|
|
|
XCEngine
|
|
|
|
|
GTest::gtest
|
|
|
|
|
GTest::gtest_main
|
|
|
|
|
user32
|
|
|
|
|
comdlg32
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_include_directories(editor_tests PRIVATE
|
|
|
|
|
${CMAKE_SOURCE_DIR}/engine/include
|
|
|
|
|
${CMAKE_SOURCE_DIR}/editor/src
|
|
|
|
|
${CMAKE_BINARY_DIR}/_deps/imgui-src
|
|
|
|
|
${CMAKE_BINARY_DIR}/_deps/imgui-src/backends
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
include(GoogleTest)
|
|
|
|
|
gtest_discover_tests(editor_tests)
|