78 lines
1.8 KiB
CMake
78 lines
1.8 KiB
CMake
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
|
|
ui/schemas/editor_inspector_shell.xcschema
|
|
)
|
|
|
|
add_library(XCNewEditorLib STATIC
|
|
src/SandboxFrameBuilder.cpp
|
|
)
|
|
|
|
target_include_directories(XCNewEditorLib
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
${CMAKE_SOURCE_DIR}/engine/include
|
|
)
|
|
|
|
target_compile_definitions(XCNewEditorLib PUBLIC
|
|
UNICODE
|
|
_UNICODE
|
|
)
|
|
|
|
if(MSVC)
|
|
target_compile_options(XCNewEditorLib PRIVATE /utf-8 /FS)
|
|
set_property(TARGET XCNewEditorLib PROPERTY
|
|
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
|
endif()
|
|
|
|
target_link_libraries(XCNewEditorLib PUBLIC
|
|
XCEngine
|
|
)
|
|
|
|
add_executable(XCNewEditorApp WIN32
|
|
src/main.cpp
|
|
src/Application.cpp
|
|
src/AutoScreenshot.cpp
|
|
src/NativeRenderer.cpp
|
|
${NEW_EDITOR_RESOURCE_FILES}
|
|
)
|
|
|
|
target_include_directories(XCNewEditorApp PRIVATE
|
|
${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$<$<CONFIG:Debug>:Debug>DLL")
|
|
endif()
|
|
|
|
target_link_libraries(XCNewEditorApp PRIVATE
|
|
XCNewEditorLib
|
|
d2d1.lib
|
|
dwrite.lib
|
|
windowscodecs.lib
|
|
)
|
|
|
|
set_target_properties(XCNewEditorApp PROPERTIES
|
|
OUTPUT_NAME "XCNewEditor"
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin"
|
|
)
|
|
|
|
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${NEW_EDITOR_RESOURCE_FILES})
|