1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 20:49:56 +00:00
openmw-tes3mp/apps/openmw/CMakeLists.txt

306 lines
11 KiB
Text
Raw Normal View History

# local files
2014-08-26 15:31:34 +00:00
set(GAME
main.cpp
engine.cpp
2014-09-04 21:17:31 +00:00
${CMAKE_SOURCE_DIR}/files/windows/openmw.rc
${CMAKE_SOURCE_DIR}/files/windows/openmw.exe.manifest
2014-08-26 15:31:34 +00:00
)
if (ANDROID)
2019-04-28 21:52:53 +00:00
set(GAME ${GAME} android_main.cpp)
2014-09-05 22:02:39 +00:00
endif()
2014-08-26 15:31:34 +00:00
set(GAME_HEADER
engine.hpp
2012-01-28 00:36:17 +00:00
)
source_group(game FILES ${GAME} ${GAME_HEADER})
2011-10-22 11:55:06 +00:00
add_openmw_dir (mwrender
actors objects renderingmanager animation rotatecontroller sky npcanimation vismask
2015-05-30 23:07:43 +00:00
creatureanimation effectmanager util renderinginterface pathgrid rendermode weaponanimation
bulletdebugdraw globalmap characterpreview camera viewovershoulder localmap water terrainstorage ripplesimulation
renderbin actoranimation landmanager navmesh actorspaths recastmesh fogmanager objectpaging
)
2015-05-03 15:24:35 +00:00
add_openmw_dir (mwinput
actions actionmanager bindingsmanager controllermanager controlswitch
inputmanagerimp mousemanager keyboardmanager sdlmappings sensormanager
2015-05-03 15:24:35 +00:00
)
add_openmw_dir (mwgui
2015-05-01 00:09:57 +00:00
layout textinput widgets race class birth review windowmanagerimp console dialogue
2013-05-06 13:30:23 +00:00
windowbase statswindow messagebox journalwindow charactercreation
mapwindow windowpinnablebase tooltips scrollwindow bookwindow resourceskin
formatting inventorywindow container hud countdialog tradewindow settingswindow
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
2012-09-22 22:36:20 +00:00
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog
enchantingdialog trainingwindow travelwindow exposedwindow cursor spellicons
merchantrepair repair soulgemdialog companionwindow bookpage journalviewmodel journalbooks
itemmodel containeritemmodel inventoryitemmodel sortfilteritemmodel itemview
tradeitemmodel companionitemmodel pickpocketitemmodel controllers savegamedialog
recharge mode videowidget backgroundimage itemwidget screenfader debugwindow spellmodel spellview
2020-06-05 14:22:53 +00:00
draganddrop timeadvancer jailscreen itemchargeview keyboardnavigation textcolours statswatcher
)
add_openmw_dir (mwdialogue
dialoguemanagerimp journalimp journalentry quest topic filter selectwrapper hypertextparser keywordsearch scripttest
)
add_openmw_dir (mwscript
locals scriptmanagerimp compilercontext interpretercontext cellextensions miscextensions
guiextensions soundextensions skyextensions statsextensions containerextensions
aiextensions controlextensions extensions globalscripts ref dialogueextensions
2014-03-16 20:39:46 +00:00
animationextensions transformationextensions consoleextensions userextensions
)
add_openmw_dir (mwsound
soundmanagerimp openal_output ffmpeg_decoder sound sound_buffer sound_decoder sound_output
2020-07-01 16:37:31 +00:00
loudness movieaudiofactory alext efx efx-presets regionsoundselector watersoundupdater volumesettings
)
add_openmw_dir (mwworld
refdata worldimp scene globals class action nullaction actionteleport
2015-12-06 17:13:04 +00:00
containerstore actiontalk actiontake manualref player cellvisitors failedaction
cells localscripts customdata inventorystore ptr actionopen actionread actionharvest
actionequip timestamp actionalchemy cellstore actionapply actioneat
2015-09-24 13:21:42 +00:00
store esmstore recordcmp fallback actionrepair actionsoulgem livecellref actiondoor
contentloader esmloader actiontrap cellreflist cellref weather projectilemanager
cellpreloader datetimemanager
)
add_openmw_dir (mwphysics
physicssystem trace collisiontype actor convert object heightfield closestnotmerayresultcallback
contacttestresultcallback deepestnotmecontacttestresultcallback stepper movementsolver projectile
Process movement queue in one or several background threads Before movement calculation, the main thread prepare a vector of ActorFrameData, which contains all data necessary to perform the simulation, and feed it to the solver. At the same time it fetches the result from the previous background simulation, which in turn is used by the game mechanics. Other functions of the physics system (weapon hit for instance) interrupt the background simulation, with some exceptions described below. The number of threads is controlled by the numeric setting [Physics] async num threads In case 'async num threads' > 1 and Bullet doesn't support multiple threads, 1 async thread will be used. 0 means synchronous solver. Additional settings (will be silently switched off if async num threads = 0) [Physics] defer aabb update Update AABBs of actors and objects in the background thread(s). It is not an especially costly operation, but it needs exclusive access to the collision world, which blocks other operations. Since AABB needs to be updated for collision detection, one can queue them to defer update before start of the movement solver. Extensive tests on as much as one installation (mine) show no drawback having that switched on. [Physics] lineofsight keep inactive cache Control for how long (how many frames) the line of sight (LOS) request will be kept updated. When a request for LOS is made for the first time, the background threads are stopped to service it. From now on, the LOS will be refreshed preemptively as part of the background routine until it is not required for lineofsight keep inactive cache frames. This mean that subsequent request will not interrupt the background computation.
2020-10-15 04:11:44 +00:00
closestnotmeconvexresultcallback raycasting mtphysics
)
add_openmw_dir (mwclass
classes activator creature npc weapon armor potion apparatus book clothing container door
ingredient creaturelevlist itemlevlist light lockpick misc probe repair static actor bodypart
)
add_openmw_dir (mwmechanics
mechanicsmanagerimp stat creaturestats magiceffects movement actorutil spelllist
drawstate spells activespells npcstats aipackage aisequence aipursue alchemy aiwander aitravel aifollow aiavoiddoor aibreathe
2020-04-04 15:28:53 +00:00
aicast aiescort aiface aiactivate aicombat recharge repair enchanting pathfinding pathgrid security spellcasting spellresistance
disease pickpocket levelledlist combat steering obstacle autocalcspell difficultyscaling aicombataction actor summoning
character actors objects aistate trading weaponpriority spellpriority weapontype spellutil tickableeffects
spellabsorption linkedeffects
)
2013-11-16 09:31:46 +00:00
add_openmw_dir (mwstate
statemanagerimp charactermanager character quicksavemanager
)
add_openmw_dir (mwbase
environment world scriptmanager dialoguemanager journal soundmanager mechanicsmanager
inputmanager windowmanager statemanager
)
# Main executable
2013-02-03 12:47:55 +00:00
set(OPENMW_LINK_TARGETS
${OSG_LIBRARIES}
${OSGPARTICLE_LIBRARIES}
${OSGUTIL_LIBRARIES}
${OSGDB_LIBRARIES}
${OSGVIEWER_LIBRARIES}
${OSGGA_LIBRARIES}
${OSGSHADOW_LIBRARIES}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${OPENAL_LIBRARY}
${FFmpeg_LIBRARIES}
${MyGUI_LIBRARIES}
${SDL2_LIBRARY}
${RecastNavigation_LIBRARIES}
"osg-ffmpeg-videoplayer"
"oics"
components
)
if (USE_SYSTEM_TINYXML)
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
${TinyXML_LIBRARIES})
endif()
if (NOT UNIX)
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
${SDL2MAIN_LIBRARY})
endif()
if (ANDROID)
2015-12-02 19:40:04 +00:00
set (OSG_PLUGINS
-Wl,--whole-archive
)
foreach(PLUGIN_NAME ${USED_OSG_PLUGINS})
set(OSG_PLUGINS ${OSG_PLUGINS} ${OSG_PLUGINS_DIR}/lib${PLUGIN_NAME}.a)
endforeach()
set (OSG_PLUGINS
${OSG_PLUGINS} -Wl,--no-whole-archive
)
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
2014-08-06 03:59:39 +00:00
EGL
android
log
2014-09-14 09:28:28 +00:00
dl
2015-12-02 19:40:04 +00:00
z
${OPENSCENEGRAPH_LIBRARIES}
2018-01-14 23:14:30 +00:00
freetype
2015-12-02 19:40:04 +00:00
jpeg
png
2014-08-06 03:59:39 +00:00
)
endif (ANDROID)
# Fix for not visible pthreads functions for linker with glibc 2.15
if (UNIX AND NOT APPLE)
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
${CMAKE_THREAD_LIBS_INIT})
endif()
2012-01-28 00:36:17 +00:00
if(APPLE)
set(BUNDLE_RESOURCES_DIR "${APP_BUNDLE_DIR}/Contents/Resources")
set(OPENMW_MYGUI_FILES_ROOT ${BUNDLE_RESOURCES_DIR})
set(OPENMW_SHADERS_ROOT ${BUNDLE_RESOURCES_DIR})
add_subdirectory(../../files/ ${CMAKE_CURRENT_BINARY_DIR}/files)
configure_file("${OpenMW_BINARY_DIR}/settings-default.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)
2012-08-20 17:05:02 +00:00
find_library(COCOA_FRAMEWORK Cocoa)
find_library(IOKIT_FRAMEWORK IOKit)
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
${COCOA_FRAMEWORK}
${IOKIT_FRAMEWORK})
if (FFmpeg_FOUND)
find_library(COREVIDEO_FRAMEWORK CoreVideo)
find_library(VDA_FRAMEWORK VideoDecodeAcceleration)
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
z
${COREVIDEO_FRAMEWORK}
${VDA_FRAMEWORK})
endif()
2012-01-28 00:36:17 +00:00
endif(APPLE)
if (BUILD_WITH_CODE_COVERAGE)
add_definitions (--coverage)
target_link_libraries(openmw gcov)
set(OPENMW_LINK_TARGETS ${OPENMW_LINK_TARGETS}
gcov)
endif()
if (MSVC)
# Debug version needs increased number of sections beyond 2^16
if (CMAKE_CL_64)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
endif (CMAKE_CL_64)
endif (MSVC)
if(BUILD_OPENMW)
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 ()
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_OPENMW_VR)
2020-07-22 12:13:15 +00:00
# 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
2020-07-22 12:13:15 +00:00
)
add_openmw_dir (mwvr
openxraction openxractionset openxrdebug openxrinput openxrmanager openxrmanagerimpl openxrswapchain openxrswapchainimpl
realisticcombat
vranimation vrcamera vrenvironment vrframebuffer vrgui vrinputmanager vrinput vrmetamenu vrsession vrshadow vrtypes vrview vrviewer vrvirtualkeyboard
)
openmw_add_executable(openmw_vr
${OPENMW_FILES}
${OPENMW_VR_FILES}
${GAME} ${GAME_HEADER}
${APPLE_BUNDLE_RESOURCES}
)
configure_resource_file(${OpenMW_SOURCE_DIR}/files/xrcontrollersuggestions.xml
"${OpenMW_BINARY_DIR}" "xrcontrollersuggestions.xml")
########### Import the OpenXR SDK
# Force the openxr-sdk to use its bundled jsoncpp to avoid problems from system jsoncpp if present
set(BUILD_WITH_SYSTEM_JSONCPP off)
include(FetchContent)
FetchContent_Declare(
OpenXR
GIT_REPOSITORY https://github.com/KhronosGroup/OpenXR-SDK.git
GIT_TAG release-1.0.13
)
FetchContent_MakeAvailable(OpenXR)
2020-07-22 12:13:15 +00:00
target_link_libraries(openmw_vr openxr_loader)
2020-07-22 12:13:15 +00:00
# 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
if (WIN32)
target_compile_options(openmw_vr PUBLIC -DUSE_OPENXR -DXR_USE_GRAPHICS_API_OPENGL -DXR_USE_PLATFORM_WIN32)
elseif(UNIX)
target_compile_options(openmw_vr PUBLIC -DUSE_OPENXR -DXR_USE_GRAPHICS_API_OPENGL -DXR_USE_PLATFORM_XLIB)
find_package(X11 REQUIRED)
target_link_libraries(openmw_vr ${X11_LIBRARIES})
endif()
target_link_libraries(openmw_vr ${OPENMW_LINK_TARGETS})
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 ".")
endif (WIN32)
endif()
# Sound stuff - here so CMake doesn't stupidly recompile EVERYTHING
# when we change the backend.
include_directories(
${FFmpeg_INCLUDE_DIRS}
)