mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 03:06:43 +00:00
cmake versioning
This commit is contained in:
parent
cdb8505f1d
commit
40e9b970b9
3 changed files with 22 additions and 3 deletions
|
@ -21,7 +21,7 @@ else()
|
|||
endif()
|
||||
|
||||
# set the minimum required version across the board
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
cmake_minimum_required(VERSION 3.1.0)
|
||||
|
||||
project(OpenMW)
|
||||
|
||||
|
|
|
@ -207,7 +207,6 @@ if (MSVC)
|
|||
endif (MSVC)
|
||||
|
||||
if(BUILD_OPENMW)
|
||||
|
||||
if (NOT ANDROID)
|
||||
openmw_add_executable(openmw
|
||||
${OPENMW_FILES}
|
||||
|
@ -236,12 +235,17 @@ if(BUILD_OPENMW)
|
|||
endif()
|
||||
|
||||
if(BUILD_OPENMW_VR)
|
||||
# Use of FetchContent to include the OpenXR SDK requires CMake 3.11
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.11")
|
||||
message(FATAL_ERROR "Building openmw_vr requires CMake version 3.11 or later.")
|
||||
endif()
|
||||
|
||||
# TODO: Openmw and openmw_vr should preferrably share game code as a static or shared library
|
||||
# instead of being compiled separately, though for now that's not possible as i depend on
|
||||
# USE_OPENXR preprocessor switches.
|
||||
set(OPENMW_VR_FILES
|
||||
vrengine.cpp
|
||||
)
|
||||
)
|
||||
add_openmw_dir (mwvr
|
||||
openxraction openxrinput openxrmanager openxrmanagerimpl openxrswapchain openxrswapchainimpl
|
||||
realisticcombat
|
||||
|
@ -263,7 +267,10 @@ if(BUILD_OPENMW_VR)
|
|||
GIT_TAG release-1.0.9
|
||||
)
|
||||
FetchContent_MakeAvailable(OpenXR)
|
||||
|
||||
target_link_libraries(openmw_vr openxr_loader)
|
||||
# openxr makes include directories private
|
||||
# Delete this line when the issue is solved: https://github.com/KhronosGroup/OpenXR-SDK-Source/issues/195
|
||||
target_include_directories(openmw_vr PRIVATE ${openxr_SOURCE_DIR}/include)
|
||||
|
||||
# Preprocessor variable used to control code paths to vr code
|
||||
|
|
|
@ -205,3 +205,15 @@ macro (copy_all_resource_files source_dir destination_dir_base destination_dir_r
|
|||
copy_resource_file("${source_dir}/${f}" "${destination_dir_base}" "${destination_dir_relative}/${filename}")
|
||||
endforeach (f)
|
||||
endmacro (copy_all_resource_files)
|
||||
|
||||
if(NOT ${CMAKE_VERSION} VERSION_LESS 3.11)
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.14)
|
||||
macro(FetchContent_MakeAvailable NAME)
|
||||
FetchContent_GetProperties(${NAME})
|
||||
if(NOT ${NAME}_POPULATED)
|
||||
FetchContent_Populate(${NAME})
|
||||
add_subdirectory(${${NAME}_SOURCE_DIR} ${${NAME}_BINARY_DIR})
|
||||
endif()
|
||||
endmacro()
|
||||
endif()
|
||||
endif()
|
Loading…
Reference in a new issue