mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-02 14:36:44 +00:00
Add CI option for VR build in before script.
Slight cmake refactoring.
This commit is contained in:
parent
21aac5d610
commit
2a4bdfedc1
3 changed files with 99 additions and 125 deletions
|
@ -929,6 +929,14 @@ if [ ! -z $CI ]; then
|
||||||
-DBUILD_OPENCS=no \
|
-DBUILD_OPENCS=no \
|
||||||
-DBUILD_WIZARD=no
|
-DBUILD_WIZARD=no
|
||||||
;;
|
;;
|
||||||
|
vr )
|
||||||
|
echo " Building subproject: OpenMW-VR."
|
||||||
|
add_cmake_opts -DBUILD_ESSIMPORTER=no \
|
||||||
|
-DBUILD_OPENCS=no \
|
||||||
|
-DBUILD_BSATOOL=no \
|
||||||
|
-DBUILD_OPENMW=no \
|
||||||
|
-DBUILD_ESMTOOL=no
|
||||||
|
;;
|
||||||
opencs )
|
opencs )
|
||||||
echo " Building subproject: OpenCS."
|
echo " Building subproject: OpenCS."
|
||||||
add_cmake_opts -DBUILD_ESSIMPORTER=no \
|
add_cmake_opts -DBUILD_ESSIMPORTER=no \
|
||||||
|
|
|
@ -587,7 +587,7 @@ add_subdirectory (components)
|
||||||
target_compile_definitions(components PRIVATE OPENMW_DOC_BASEURL="${OPENMW_DOC_BASEURL}")
|
target_compile_definitions(components PRIVATE OPENMW_DOC_BASEURL="${OPENMW_DOC_BASEURL}")
|
||||||
|
|
||||||
# Apps and tools
|
# Apps and tools
|
||||||
if (BUILD_OPENMW)
|
if (BUILD_OPENMW OR BUILD_VR_OPENXR)
|
||||||
add_subdirectory( apps/openmw )
|
add_subdirectory( apps/openmw )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -101,20 +101,6 @@ add_openmw_dir (mwbase
|
||||||
|
|
||||||
# Main executable
|
# Main executable
|
||||||
|
|
||||||
if (NOT ANDROID)
|
|
||||||
openmw_add_executable(openmw
|
|
||||||
${OPENMW_FILES}
|
|
||||||
${GAME} ${GAME_HEADER}
|
|
||||||
${APPLE_BUNDLE_RESOURCES}
|
|
||||||
)
|
|
||||||
else ()
|
|
||||||
add_library(openmw
|
|
||||||
SHARED
|
|
||||||
${OPENMW_FILES}
|
|
||||||
${GAME} ${GAME_HEADER}
|
|
||||||
)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
set(OPENMW_LINK_TARGETS
|
set(OPENMW_LINK_TARGETS
|
||||||
${OSG_LIBRARIES}
|
${OSG_LIBRARIES}
|
||||||
${OPENTHREADS_LIBRARIES}
|
${OPENTHREADS_LIBRARIES}
|
||||||
|
@ -138,70 +124,15 @@ set(OPENMW_LINK_TARGETS
|
||||||
components
|
components
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_VR_OPENXR)
|
if (USE_SYSTEM_TINYXML)
|
||||||
# TODO: Move this into something akin to add_openmw_dir instead of breaking pattern.
|
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
|
||||||
# Later, openmw and openmw_vr should preferrably share game code as a static or shared library
|
${TinyXML_LIBRARIES})
|
||||||
# instead of being compiled separately, though for now that's not possible as i depend on
|
endif()
|
||||||
# USE_OPENXR preprocessor switches.
|
|
||||||
set(OPENMW_VR_FILES
|
if (NOT UNIX)
|
||||||
vrengine.cpp
|
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
|
||||||
mwvr/openxraction.hpp
|
${SDL2MAIN_LIBRARY})
|
||||||
mwvr/openxraction.cpp
|
|
||||||
mwvr/openxrinput.hpp
|
|
||||||
mwvr/openxrinput.cpp
|
|
||||||
mwvr/openxrmanager.hpp
|
|
||||||
mwvr/openxrmanager.cpp
|
|
||||||
mwvr/openxrmanagerimpl.hpp
|
|
||||||
mwvr/openxrmanagerimpl.cpp
|
|
||||||
mwvr/openxrswapchain.hpp
|
|
||||||
mwvr/openxrswapchain.cpp
|
|
||||||
mwvr/openxrswapchainimpl.hpp
|
|
||||||
mwvr/openxrswapchainimpl.cpp
|
|
||||||
mwvr/realisticcombat.hpp
|
|
||||||
mwvr/realisticcombat.cpp
|
|
||||||
mwvr/vranimation.hpp
|
|
||||||
mwvr/vranimation.cpp
|
|
||||||
mwvr/vrenvironment.hpp
|
|
||||||
mwvr/vrenvironment.cpp
|
|
||||||
mwvr/vrgui.hpp
|
|
||||||
mwvr/vrgui.cpp
|
|
||||||
mwvr/vrinputmanager.hpp
|
|
||||||
mwvr/vrinputmanager.cpp
|
|
||||||
mwvr/vrinput.hpp
|
|
||||||
mwvr/vrinput.cpp
|
|
||||||
mwvr/vrsession.hpp
|
|
||||||
mwvr/vrsession.cpp
|
|
||||||
mwvr/vrframebuffer.hpp
|
|
||||||
mwvr/vrframebuffer.cpp
|
|
||||||
mwvr/vrshadow.hpp
|
|
||||||
mwvr/vrshadow.cpp
|
|
||||||
mwvr/vrtypes.hpp
|
|
||||||
mwvr/vrtypes.cpp
|
|
||||||
mwvr/vrview.hpp
|
|
||||||
mwvr/vrview.cpp
|
|
||||||
mwvr/vrviewer.hpp
|
|
||||||
mwvr/vrviewer.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
openmw_add_executable(openmw_vr
|
|
||||||
${OPENMW_FILES}
|
|
||||||
${OPENMW_VR_FILES}
|
|
||||||
${GAME} ${GAME_HEADER}
|
|
||||||
${APPLE_BUNDLE_RESOURCES}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Preprocessor variable used to control code paths to vr code
|
|
||||||
target_compile_options(openmw_vr PUBLIC -DUSE_OPENXR -DXR_USE_GRAPHICS_API_OPENGL -DXR_USE_PLATFORM_WIN32)
|
|
||||||
target_link_libraries(openmw_vr ${OPENMW_LINK_TARGETS} ${OPENXR_LIBRARY})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Sound stuff - here so CMake doesn't stupidly recompile EVERYTHING
|
|
||||||
# when we change the backend.
|
|
||||||
include_directories(
|
|
||||||
${FFmpeg_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(openmw ${OPENMW_LINK_TARGETS})
|
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set (OSG_PLUGINS
|
set (OSG_PLUGINS
|
||||||
|
@ -214,8 +145,7 @@ if (ANDROID)
|
||||||
set (OSG_PLUGINS
|
set (OSG_PLUGINS
|
||||||
${OSG_PLUGINS} -Wl,--no-whole-archive
|
${OSG_PLUGINS} -Wl,--no-whole-archive
|
||||||
)
|
)
|
||||||
|
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
|
||||||
target_link_libraries(openmw
|
|
||||||
EGL
|
EGL
|
||||||
android
|
android
|
||||||
log
|
log
|
||||||
|
@ -224,30 +154,14 @@ if (ANDROID)
|
||||||
${OPENSCENEGRAPH_LIBRARIES}
|
${OPENSCENEGRAPH_LIBRARIES}
|
||||||
freetype
|
freetype
|
||||||
jpeg
|
jpeg
|
||||||
png
|
png
|
||||||
)
|
)
|
||||||
endif (ANDROID)
|
endif (ANDROID)
|
||||||
|
|
||||||
if (USE_SYSTEM_TINYXML)
|
|
||||||
target_link_libraries(openmw ${TinyXML_LIBRARIES})
|
|
||||||
if(BUILD_VR_OPENXR)
|
|
||||||
target_link_libraries(openmw_vr ${TinyXML_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT UNIX)
|
|
||||||
target_link_libraries(openmw ${SDL2MAIN_LIBRARY})
|
|
||||||
if(BUILD_VR_OPENXR)
|
|
||||||
target_link_libraries(openmw_vr ${SDL2MAIN_LIBRARY})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Fix for not visible pthreads functions for linker with glibc 2.15
|
# Fix for not visible pthreads functions for linker with glibc 2.15
|
||||||
if (UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE)
|
||||||
target_link_libraries(openmw ${CMAKE_THREAD_LIBS_INIT})
|
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
|
||||||
if(BUILD_VR_OPENXR)
|
${CMAKE_THREAD_LIBS_INIT})
|
||||||
target_link_libraries(openmw_vr ${CMAKE_THREAD_LIBS_INIT})
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
@ -262,39 +176,28 @@ if(APPLE)
|
||||||
configure_file("${OpenMW_BINARY_DIR}/openmw.cfg" ${BUNDLE_RESOURCES_DIR} COPYONLY)
|
configure_file("${OpenMW_BINARY_DIR}/openmw.cfg" ${BUNDLE_RESOURCES_DIR} COPYONLY)
|
||||||
configure_file("${OpenMW_BINARY_DIR}/gamecontrollerdb.txt" ${BUNDLE_RESOURCES_DIR} COPYONLY)
|
configure_file("${OpenMW_BINARY_DIR}/gamecontrollerdb.txt" ${BUNDLE_RESOURCES_DIR} COPYONLY)
|
||||||
|
|
||||||
add_custom_command(TARGET openmw
|
|
||||||
POST_BUILD
|
|
||||||
COMMAND cp "${OpenMW_BINARY_DIR}/resources/version" "${BUNDLE_RESOURCES_DIR}/resources")
|
|
||||||
|
|
||||||
if(BUILD_VR_OPENXR)
|
|
||||||
add_custom_command(TARGET openmw_vr
|
|
||||||
POST_BUILD
|
|
||||||
COMMAND cp "${OpenMW_BINARY_DIR}/resources/version" "${BUNDLE_RESOURCES_DIR}/resources")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_library(COCOA_FRAMEWORK Cocoa)
|
find_library(COCOA_FRAMEWORK Cocoa)
|
||||||
find_library(IOKIT_FRAMEWORK IOKit)
|
find_library(IOKIT_FRAMEWORK IOKit)
|
||||||
target_link_libraries(openmw ${COCOA_FRAMEWORK} ${IOKIT_FRAMEWORK})
|
|
||||||
if(BUILD_VR_OPENXR)
|
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
|
||||||
target_link_libraries(openmw_vr ${COCOA_FRAMEWORK} ${IOKIT_FRAMEWORK})
|
${COCOA_FRAMEWORK}
|
||||||
endif()
|
${IOKIT_FRAMEWORK})
|
||||||
|
|
||||||
if (FFmpeg_FOUND)
|
if (FFmpeg_FOUND)
|
||||||
find_library(COREVIDEO_FRAMEWORK CoreVideo)
|
find_library(COREVIDEO_FRAMEWORK CoreVideo)
|
||||||
find_library(VDA_FRAMEWORK VideoDecodeAcceleration)
|
find_library(VDA_FRAMEWORK VideoDecodeAcceleration)
|
||||||
target_link_libraries(openmw z ${COREVIDEO_FRAMEWORK} ${VDA_FRAMEWORK})
|
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
|
||||||
if(BUILD_VR_OPENXR)
|
z
|
||||||
target_link_libraries(openmw_vr z ${COREVIDEO_FRAMEWORK} ${VDA_FRAMEWORK})
|
${COREVIDEO_FRAMEWORK}
|
||||||
endif()
|
${VDA_FRAMEWORK})
|
||||||
endif()
|
endif()
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
if (BUILD_WITH_CODE_COVERAGE)
|
if (BUILD_WITH_CODE_COVERAGE)
|
||||||
add_definitions (--coverage)
|
add_definitions (--coverage)
|
||||||
target_link_libraries(openmw gcov)
|
target_link_libraries(openmw gcov)
|
||||||
if(BUILD_VR_OPENXR)
|
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
|
||||||
target_link_libraries(openmw_vr gcov)
|
gcov)
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
|
@ -303,10 +206,73 @@ if (MSVC)
|
||||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
|
||||||
endif (CMAKE_CL_64)
|
endif (CMAKE_CL_64)
|
||||||
endif (MSVC)
|
endif (MSVC)
|
||||||
|
|
||||||
|
if(BUILD_OPENMW)
|
||||||
|
|
||||||
if (WIN32)
|
if (NOT ANDROID)
|
||||||
INSTALL(TARGETS openmw RUNTIME DESTINATION ".")
|
openmw_add_executable(openmw
|
||||||
if(BUILD_VR_OPENXR)
|
${OPENMW_FILES}
|
||||||
|
${GAME} ${GAME_HEADER}
|
||||||
|
${APPLE_BUNDLE_RESOURCES}
|
||||||
|
)
|
||||||
|
else ()
|
||||||
|
add_library(openmw
|
||||||
|
SHARED
|
||||||
|
${OPENMW_FILES}
|
||||||
|
${GAME} ${GAME_HEADER}
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
target_link_libraries(openmw ${OPENMW_LINK_TARGETS})
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
add_custom_command(TARGET openmw
|
||||||
|
POST_BUILD
|
||||||
|
COMMAND cp "${OpenMW_BINARY_DIR}/resources/version" "${BUNDLE_RESOURCES_DIR}/resources")
|
||||||
|
endif(APPLE)
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
INSTALL(TARGETS openmw RUNTIME DESTINATION ".")
|
||||||
|
endif (WIN32)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_VR_OPENXR)
|
||||||
|
# TODO: Move this into something akin to add_openmw_dir instead of breaking pattern.
|
||||||
|
# Later, 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
|
||||||
|
vranimation vrenvironment vrgui vrinputmanager vrinput vrsession vrframebuffer vrshadow vrtypes vrview vrviewer
|
||||||
|
)
|
||||||
|
|
||||||
|
openmw_add_executable(openmw_vr
|
||||||
|
${OPENMW_FILES}
|
||||||
|
${OPENMW_VR_FILES}
|
||||||
|
${GAME} ${GAME_HEADER}
|
||||||
|
${APPLE_BUNDLE_RESOURCES}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Preprocessor variable used to control code paths to vr code
|
||||||
|
target_compile_options(openmw_vr PUBLIC -DUSE_OPENXR -DXR_USE_GRAPHICS_API_OPENGL -DXR_USE_PLATFORM_WIN32)
|
||||||
|
target_link_libraries(openmw_vr ${OPENMW_LINK_TARGETS} ${OPENXR_LIBRARY})
|
||||||
|
if(APPLE)
|
||||||
|
add_custom_command(TARGET openmw_vr
|
||||||
|
POST_BUILD
|
||||||
|
COMMAND cp "${OpenMW_BINARY_DIR}/resources/version" "${BUNDLE_RESOURCES_DIR}/resources")
|
||||||
|
endif(APPLE)
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
INSTALL(TARGETS openmw_vr RUNTIME DESTINATION ".")
|
INSTALL(TARGETS openmw_vr RUNTIME DESTINATION ".")
|
||||||
endif()
|
endif (WIN32)
|
||||||
endif (WIN32)
|
endif()
|
||||||
|
|
||||||
|
# Sound stuff - here so CMake doesn't stupidly recompile EVERYTHING
|
||||||
|
# when we change the backend.
|
||||||
|
include_directories(
|
||||||
|
${FFmpeg_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue