Files
XCEngine/new_editor/CMakeLists.txt

126 lines
3.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)
set(XCUI_EDITOR_RESOURCE_FILES
ui/views/editor_shell.xcui
ui/themes/editor_shell.xctheme
)
add_library(XCUIEditorLib STATIC
src/Core/EditorShellAsset.cpp
src/Core/UIEditorCommandDispatcher.cpp
src/Core/UIEditorCommandRegistry.cpp
src/Core/UIEditorMenuModel.cpp
src/Core/UIEditorMenuSession.cpp
src/Core/UIEditorPanelRegistry.cpp
src/Core/UIEditorShortcutManager.cpp
src/Core/UIEditorWorkspaceLayoutPersistence.cpp
src/Core/UIEditorWorkspaceController.cpp
src/Core/UIEditorWorkspaceModel.cpp
src/Core/UIEditorWorkspaceSession.cpp
src/Widgets/UIEditorCollectionPrimitives.cpp
src/Widgets/UIEditorDockHost.cpp
src/Widgets/UIEditorPanelFrame.cpp
src/Widgets/UIEditorTabStrip.cpp
)
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
UNICODE
_UNICODE
XCUIEDITOR_REPO_ROOT="${XCUIEDITOR_REPO_ROOT_PATH}"
)
if(MSVC)
target_compile_options(XCUIEditorLib PRIVATE /utf-8 /FS)
set_property(TARGET XCUIEditorLib PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()
target_link_libraries(XCUIEditorLib PUBLIC
XCEngine
)
add_library(XCUIEditorHost STATIC
app/Host/AutoScreenshot.cpp
app/Host/NativeRenderer.cpp
)
target_include_directories(XCUIEditorHost
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/app
${CMAKE_SOURCE_DIR}/engine/include
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_compile_definitions(XCUIEditorHost PUBLIC
UNICODE
_UNICODE
)
if(MSVC)
target_compile_options(XCUIEditorHost PRIVATE /utf-8 /FS)
set_property(TARGET XCUIEditorHost PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()
target_link_libraries(XCUIEditorHost PUBLIC
XCEngine
d2d1.lib
dwrite.lib
windowscodecs.lib
)
if(XCENGINE_BUILD_XCUI_EDITOR_APP)
add_executable(XCUIEditorApp WIN32
app/main.cpp
app/Application.cpp
${XCUI_EDITOR_RESOURCE_FILES}
)
target_include_directories(XCUIEditorApp PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/app
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/engine/include
)
target_compile_definitions(XCUIEditorApp PRIVATE
UNICODE
_UNICODE
XCUIEDITOR_REPO_ROOT="${XCUIEDITOR_REPO_ROOT_PATH}"
)
if(MSVC)
target_compile_options(XCUIEditorApp PRIVATE /utf-8 /FS)
set_property(TARGET XCUIEditorApp PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()
target_link_libraries(XCUIEditorApp PRIVATE
XCUIEditorLib
XCUIEditorHost
)
set_target_properties(XCUIEditorApp PROPERTIES
OUTPUT_NAME "XCUIEditor"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin"
)
endif()
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${XCUI_EDITOR_RESOURCE_FILES})