cmake_minimum_required(VERSION 3.15) project(XCNewEditor VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) file(TO_CMAKE_PATH "${CMAKE_SOURCE_DIR}" XCNEWEDITOR_REPO_ROOT_PATH) set(NEW_EDITOR_RESOURCE_FILES ui/views/editor_shell.xcui ui/themes/editor_shell.xctheme ) add_library(XCNewEditorLib STATIC src/editor/EditorShellAsset.cpp src/editor/UIEditorWorkspaceModel.cpp src/Widgets/UIEditorCollectionPrimitives.cpp ) target_include_directories(XCNewEditorLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/engine/include ) target_compile_definitions(XCNewEditorLib PUBLIC UNICODE _UNICODE XCNEWEDITOR_REPO_ROOT="${XCNEWEDITOR_REPO_ROOT_PATH}" ) if(MSVC) target_compile_options(XCNewEditorLib PRIVATE /utf-8 /FS) set_property(TARGET XCNewEditorLib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") endif() target_link_libraries(XCNewEditorLib PUBLIC XCEngine ) add_library(XCNewEditorHost STATIC src/Host/AutoScreenshot.cpp src/Host/NativeRenderer.cpp ) target_include_directories(XCNewEditorHost PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/engine/include ) target_compile_definitions(XCNewEditorHost PUBLIC UNICODE _UNICODE ) if(MSVC) target_compile_options(XCNewEditorHost PRIVATE /utf-8 /FS) set_property(TARGET XCNewEditorHost PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") endif() target_link_libraries(XCNewEditorHost PUBLIC XCEngine d2d1.lib dwrite.lib windowscodecs.lib ) if(XCENGINE_BUILD_NEW_EDITOR) add_executable(XCNewEditorApp WIN32 src/main.cpp src/Host/Application.cpp ${NEW_EDITOR_RESOURCE_FILES} ) target_include_directories(XCNewEditorApp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/engine/include ) target_compile_definitions(XCNewEditorApp PRIVATE UNICODE _UNICODE XCNEWEDITOR_REPO_ROOT="${XCNEWEDITOR_REPO_ROOT_PATH}" ) if(MSVC) target_compile_options(XCNewEditorApp PRIVATE /utf-8 /FS) set_property(TARGET XCNewEditorApp PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") endif() target_link_libraries(XCNewEditorApp PRIVATE XCNewEditorLib XCNewEditorHost ) set_target_properties(XCNewEditorApp PROPERTIES OUTPUT_NAME "XCNewEditor" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin" ) endif() source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${NEW_EDITOR_RESOURCE_FILES})