Files
XCEngine/CMakeLists.txt

66 lines
1.8 KiB
CMake

cmake_minimum_required(VERSION 3.15)
if(POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif()
project(XCEngine)
if(MSVC)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT
"$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/MP>")
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(CMAKE_VS_GLOBALS "UseMultiToolTask=true")
endif()
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(XCENGINE_NANOVDB_INCLUDE_HINTS
"${CMAKE_SOURCE_DIR}/engine/third_party/nanovdb/include"
"$ENV{VCPKG_ROOT}/installed/x64-windows/include"
"D:/vcpkg/installed/x64-windows/include"
)
find_path(
XCENGINE_NANOVDB_INCLUDE_DIR
NAMES nanovdb/io/IO.h
HINTS ${XCENGINE_NANOVDB_INCLUDE_HINTS}
)
if(XCENGINE_NANOVDB_INCLUDE_DIR)
set(XCENGINE_HAS_NANOVDB ON)
message(STATUS "NanoVDB headers found: ${XCENGINE_NANOVDB_INCLUDE_DIR}")
else()
set(XCENGINE_HAS_NANOVDB OFF)
message(STATUS "NanoVDB headers not found; .nvdb source-file support will be disabled")
endif()
enable_testing()
option(XCENGINE_ENABLE_MONO_SCRIPTING "Build the Mono-based C# scripting runtime" ON)
option(XCENGINE_BUILD_XCUI_EDITOR_APP "Build the XCUI editor shell app" ON)
set(
XCENGINE_MONO_ROOT_DIR
"${CMAKE_SOURCE_DIR}/参考/Fermion/Fermion/external/mono"
CACHE PATH
"Path to the bundled Mono distribution used by the scripting runtime")
if(EXISTS "${CMAKE_SOURCE_DIR}/engine/third_party/mono/binary/mscorlib.dll")
set(
XCENGINE_MONO_ROOT_DIR
"${CMAKE_SOURCE_DIR}/engine/third_party/mono"
CACHE PATH
"Path to the bundled Mono distribution used by the scripting runtime"
FORCE)
endif()
add_subdirectory(engine)
add_subdirectory(managed)
add_subdirectory(editor)
add_subdirectory(new_editor)
add_subdirectory(mvs/RenderDoc)
add_subdirectory(tests)