101 lines
3.9 KiB
CMake
101 lines
3.9 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
|
|
project(XCEngine_EditorTests)
|
|
|
|
set(EDITOR_TEST_SOURCES
|
|
test_action_routing.cpp
|
|
test_application_asset_cache_stub.cpp
|
|
test_play_session_controller.cpp
|
|
test_scene_viewport_camera_controller.cpp
|
|
test_scene_viewport_move_gizmo.cpp
|
|
test_scene_viewport_rotate_gizmo.cpp
|
|
test_scene_viewport_scale_gizmo.cpp
|
|
test_scene_viewport_picker.cpp
|
|
test_scene_viewport_shader_paths.cpp
|
|
test_scene_viewport_overlay_renderer.cpp
|
|
test_scene_viewport_overlay_providers.cpp
|
|
test_script_component_editor_utils.cpp
|
|
test_viewport_host_surface_utils.cpp
|
|
test_viewport_object_id_picker.cpp
|
|
test_viewport_render_targets.cpp
|
|
test_viewport_render_flow_utils.cpp
|
|
test_builtin_icon_layout_utils.cpp
|
|
test_editor_console_sink.cpp
|
|
test_editor_script_assembly_builder.cpp
|
|
test_editor_script_assembly_builder_utils.cpp
|
|
${CMAKE_BINARY_DIR}/_deps/imgui-src/imgui.cpp
|
|
${CMAKE_BINARY_DIR}/_deps/imgui-src/imgui_draw.cpp
|
|
${CMAKE_BINARY_DIR}/_deps/imgui-src/imgui_tables.cpp
|
|
${CMAKE_BINARY_DIR}/_deps/imgui-src/imgui_widgets.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Core/EditorConsoleSink.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Scripting/EditorScriptAssemblyBuilder.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Core/UndoManager.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Core/PlaySessionController.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Managers/SceneManager.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Managers/ProjectManager.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportPicker.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportMoveGizmo.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportRotateGizmo.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportScaleGizmo.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportHudOverlay.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportOrientationGizmo.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportOverlayBuilder.cpp
|
|
${CMAKE_SOURCE_DIR}/editor/src/Viewport/SceneViewportOverlayProviders.cpp
|
|
)
|
|
|
|
if(XCENGINE_ENABLE_MONO_SCRIPTING AND TARGET xcengine_managed_assemblies)
|
|
list(APPEND EDITOR_TEST_SOURCES
|
|
test_play_session_controller_scripting.cpp
|
|
)
|
|
endif()
|
|
|
|
add_executable(editor_tests ${EDITOR_TEST_SOURCES})
|
|
|
|
if(MSVC)
|
|
set_target_properties(editor_tests PROPERTIES
|
|
LINK_FLAGS "/NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:libcmt.lib"
|
|
)
|
|
target_compile_options(editor_tests PRIVATE /FS /utf-8)
|
|
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
|
|
)
|
|
|
|
file(TO_CMAKE_PATH "${CMAKE_SOURCE_DIR}" XCENGINE_EDITOR_TEST_REPO_ROOT_CMAKE)
|
|
file(TO_CMAKE_PATH "${XCENGINE_MONO_ROOT_DIR}" XCENGINE_EDITOR_TEST_MONO_ROOT_CMAKE)
|
|
|
|
target_compile_definitions(editor_tests PRIVATE
|
|
XCENGINE_EDITOR_REPO_ROOT="${XCENGINE_EDITOR_TEST_REPO_ROOT_CMAKE}"
|
|
XCENGINE_EDITOR_MONO_ROOT_DIR="${XCENGINE_EDITOR_TEST_MONO_ROOT_CMAKE}"
|
|
)
|
|
|
|
if(XCENGINE_ENABLE_MONO_SCRIPTING AND TARGET xcengine_managed_assemblies)
|
|
add_dependencies(editor_tests xcengine_managed_assemblies)
|
|
|
|
file(TO_CMAKE_PATH "${XCENGINE_MANAGED_OUTPUT_DIR}" XCENGINE_MANAGED_OUTPUT_DIR_CMAKE)
|
|
file(TO_CMAKE_PATH "${XCENGINE_SCRIPT_CORE_DLL}" XCENGINE_SCRIPT_CORE_DLL_CMAKE)
|
|
file(TO_CMAKE_PATH "${XCENGINE_GAME_SCRIPTS_DLL}" XCENGINE_GAME_SCRIPTS_DLL_CMAKE)
|
|
|
|
target_compile_definitions(editor_tests PRIVATE
|
|
XCENGINE_ENABLE_MONO_SCRIPTING
|
|
XCENGINE_TEST_MANAGED_OUTPUT_DIR="${XCENGINE_MANAGED_OUTPUT_DIR_CMAKE}"
|
|
XCENGINE_TEST_SCRIPT_CORE_DLL="${XCENGINE_SCRIPT_CORE_DLL_CMAKE}"
|
|
XCENGINE_TEST_GAME_SCRIPTS_DLL="${XCENGINE_GAME_SCRIPTS_DLL_CMAKE}"
|
|
)
|
|
endif()
|
|
|
|
include(GoogleTest)
|
|
gtest_discover_tests(editor_tests)
|