201 lines
6.3 KiB
CMake
201 lines
6.3 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
project(XCUIEditor VERSION 0.1 LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
file(TO_CMAKE_PATH "${CMAKE_SOURCE_DIR}" XCUIEDITOR_REPO_ROOT_PATH)
|
|
|
|
function(xcui_editor_apply_common_target_settings target visibility)
|
|
target_compile_definitions(${target} ${visibility}
|
|
UNICODE
|
|
_UNICODE
|
|
)
|
|
|
|
if(MSVC)
|
|
target_compile_options(${target} PRIVATE /utf-8 /FS)
|
|
set_property(TARGET ${target} PROPERTY
|
|
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
|
endif()
|
|
endfunction()
|
|
|
|
set(XCUI_EDITOR_FOUNDATION_SOURCES
|
|
src/Foundation/UIEditorCommandDispatcher.cpp
|
|
src/Foundation/UIEditorCommandRegistry.cpp
|
|
src/Foundation/UIEditorRuntimeTrace.cpp
|
|
src/Foundation/UIEditorShortcutManager.cpp
|
|
src/Foundation/UIEditorTheme.cpp
|
|
)
|
|
|
|
set(XCUI_EDITOR_FIELD_SOURCES
|
|
src/Fields/UIEditorAssetField.cpp
|
|
src/Fields/UIEditorAssetFieldInteraction.cpp
|
|
src/Fields/UIEditorBoolField.cpp
|
|
src/Fields/UIEditorBoolFieldInteraction.cpp
|
|
src/Fields/UIEditorColorField.cpp
|
|
src/Fields/UIEditorColorFieldInteraction.cpp
|
|
src/Fields/UIEditorEnumField.cpp
|
|
src/Fields/UIEditorEnumFieldInteraction.cpp
|
|
src/Fields/UIEditorFieldStyle.cpp
|
|
src/Fields/UIEditorNumberField.cpp
|
|
src/Fields/UIEditorNumberFieldInteraction.cpp
|
|
src/Fields/UIEditorObjectField.cpp
|
|
src/Fields/UIEditorObjectFieldInteraction.cpp
|
|
src/Fields/UIEditorPropertyGrid.cpp
|
|
src/Fields/UIEditorPropertyGridInteraction.cpp
|
|
src/Fields/UIEditorTextField.cpp
|
|
src/Fields/UIEditorTextFieldInteraction.cpp
|
|
src/Fields/UIEditorVector2Field.cpp
|
|
src/Fields/UIEditorVector2FieldInteraction.cpp
|
|
src/Fields/UIEditorVector3Field.cpp
|
|
src/Fields/UIEditorVector3FieldInteraction.cpp
|
|
src/Fields/UIEditorVector4Field.cpp
|
|
src/Fields/UIEditorVector4FieldInteraction.cpp
|
|
)
|
|
|
|
set(XCUI_EDITOR_COLLECTION_SOURCES
|
|
src/Collections/UIEditorInlineRenameSession.cpp
|
|
src/Collections/UIEditorListView.cpp
|
|
src/Collections/UIEditorListViewInteraction.cpp
|
|
src/Collections/UIEditorScrollView.cpp
|
|
src/Collections/UIEditorScrollViewInteraction.cpp
|
|
src/Collections/UIEditorTabStrip.cpp
|
|
src/Collections/UIEditorTabStripInteraction.cpp
|
|
src/Collections/UIEditorTreeView.cpp
|
|
src/Collections/UIEditorTreeViewInteraction.cpp
|
|
)
|
|
|
|
set(XCUI_EDITOR_SHELL_SOURCES
|
|
src/Shell/UIEditorShellAsset.cpp
|
|
src/Shell/UIEditorDockHost.cpp
|
|
src/Shell/UIEditorDockHostInteraction.cpp
|
|
src/Shell/UIEditorMenuBar.cpp
|
|
src/Shell/UIEditorMenuModel.cpp
|
|
src/Shell/UIEditorMenuPopup.cpp
|
|
src/Shell/UIEditorMenuSession.cpp
|
|
src/Shell/UIEditorPanelContentHost.cpp
|
|
src/Shell/UIEditorPanelFrame.cpp
|
|
src/Shell/UIEditorPanelHostLifecycle.cpp
|
|
src/Shell/UIEditorPanelRegistry.cpp
|
|
src/Shell/UIEditorShellCompose.cpp
|
|
src/Shell/UIEditorShellInteraction.cpp
|
|
src/Shell/UIEditorStatusBar.cpp
|
|
src/Shell/UIEditorViewportInputBridge.cpp
|
|
src/Shell/UIEditorViewportShell.cpp
|
|
src/Shell/UIEditorViewportSlot.cpp
|
|
src/Shell/UIEditorWorkspaceCompose.cpp
|
|
src/Shell/UIEditorWorkspaceController.cpp
|
|
src/Shell/UIEditorWorkspaceInteraction.cpp
|
|
src/Shell/UIEditorWorkspaceLayoutPersistence.cpp
|
|
src/Shell/UIEditorWorkspaceModel.cpp
|
|
src/Shell/UIEditorWorkspaceSession.cpp
|
|
)
|
|
|
|
set(XCUI_EDITOR_WIDGET_SUPPORT_SOURCES
|
|
src/Widgets/UIEditorCollectionPrimitives.cpp
|
|
src/Widgets/UIEditorFieldRowLayout.cpp
|
|
)
|
|
|
|
add_library(XCUIEditorLib STATIC
|
|
${XCUI_EDITOR_FOUNDATION_SOURCES}
|
|
${XCUI_EDITOR_FIELD_SOURCES}
|
|
${XCUI_EDITOR_COLLECTION_SOURCES}
|
|
${XCUI_EDITOR_SHELL_SOURCES}
|
|
${XCUI_EDITOR_WIDGET_SUPPORT_SOURCES}
|
|
)
|
|
|
|
target_include_directories(XCUIEditorLib
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
${CMAKE_SOURCE_DIR}/engine/include
|
|
PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
)
|
|
|
|
target_compile_definitions(XCUIEditorLib PUBLIC
|
|
XCUIEDITOR_REPO_ROOT="${XCUIEDITOR_REPO_ROOT_PATH}"
|
|
)
|
|
|
|
xcui_editor_apply_common_target_settings(XCUIEditorLib PUBLIC)
|
|
|
|
target_link_libraries(XCUIEditorLib PUBLIC
|
|
XCEngine
|
|
)
|
|
|
|
add_library(XCUIEditorHost STATIC
|
|
app/Host/AutoScreenshot.cpp
|
|
app/Host/BorderlessWindowChrome.cpp
|
|
app/Host/BorderlessWindowFrame.cpp
|
|
app/Host/D3D12HostDevice.cpp
|
|
app/Host/D3D12ShaderResourceDescriptorAllocator.cpp
|
|
app/Host/D3D12WindowInteropContext.cpp
|
|
app/Host/D3D12WindowRenderer.cpp
|
|
app/Host/D3D12WindowSwapChainPresenter.cpp
|
|
app/Host/D3D12WindowRenderLoop.cpp
|
|
app/Host/NativeRenderer.cpp
|
|
app/Host/WindowMessageDispatcher.cpp
|
|
)
|
|
|
|
target_include_directories(XCUIEditorHost
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/app
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
${CMAKE_SOURCE_DIR}/engine/include
|
|
)
|
|
|
|
xcui_editor_apply_common_target_settings(XCUIEditorHost PUBLIC)
|
|
|
|
target_link_libraries(XCUIEditorHost PUBLIC
|
|
XCEngine
|
|
d2d1.lib
|
|
d3d11.lib
|
|
d3d12.lib
|
|
d3dcompiler.lib
|
|
dwrite.lib
|
|
dxgi.lib
|
|
windowscodecs.lib
|
|
)
|
|
|
|
if(XCENGINE_BUILD_XCUI_EDITOR_APP)
|
|
add_executable(XCUIEditorApp WIN32
|
|
app/main.cpp
|
|
app/Application.cpp
|
|
app/Commands/ProductEditorHostCommandBridge.cpp
|
|
app/Core/ProductEditorContext.cpp
|
|
app/Core/ProductEditorSession.cpp
|
|
app/Panels/ProductConsolePanel.cpp
|
|
app/Hierarchy/ProductHierarchyModel.cpp
|
|
app/Icons/ProductBuiltInIcons.cpp
|
|
app/Panels/ProductHierarchyPanel.cpp
|
|
app/Panels/ProductInspectorPanel.cpp
|
|
app/Panels/ProductProjectPanel.cpp
|
|
app/Project/ProductProjectBrowserModel.cpp
|
|
app/Shell/ProductShellAsset.cpp
|
|
app/Viewport/ProductViewportHostService.cpp
|
|
app/Viewport/ProductViewportRenderTargetManager.cpp
|
|
app/Viewport/ProductViewportRenderTargets.cpp
|
|
app/Workspace/ProductEditorWorkspace.cpp
|
|
app/Workspace/ProductEditorWorkspaceEventRouter.cpp
|
|
)
|
|
|
|
target_include_directories(XCUIEditorApp PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_SOURCE_DIR}/app
|
|
)
|
|
|
|
target_compile_definitions(XCUIEditorApp PRIVATE
|
|
XCUIEDITOR_REPO_ROOT="${XCUIEDITOR_REPO_ROOT_PATH}"
|
|
)
|
|
|
|
xcui_editor_apply_common_target_settings(XCUIEditorApp PRIVATE)
|
|
|
|
target_link_libraries(XCUIEditorApp PRIVATE
|
|
XCUIEditorLib
|
|
XCUIEditorHost
|
|
)
|
|
|
|
set_target_properties(XCUIEditorApp PROPERTIES
|
|
OUTPUT_NAME "XCUIEditor"
|
|
)
|
|
endif()
|