2023-03-11 13:16:27 +01:00
|
|
|
set(OPENMW_SOURCES
|
2014-08-26 17:31:34 +02:00
|
|
|
engine.cpp
|
2021-09-30 03:48:47 +02:00
|
|
|
options.cpp
|
2023-03-11 13:16:27 +01:00
|
|
|
)
|
2014-09-05 07:17:31 +10:00
|
|
|
|
2023-03-11 13:16:27 +01:00
|
|
|
set(OPENMW_RESOURCES
|
2014-09-05 22:36:33 +10:00
|
|
|
${CMAKE_SOURCE_DIR}/files/windows/openmw.rc
|
2018-11-03 18:21:22 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/files/windows/openmw.exe.manifest
|
2014-08-26 17:31:34 +02:00
|
|
|
)
|
|
|
|
|
2023-03-11 13:16:27 +01:00
|
|
|
set(OPENMW_HEADERS
|
|
|
|
doc.hpp
|
2011-07-08 14:39:23 +02:00
|
|
|
engine.hpp
|
2023-03-11 13:16:27 +01:00
|
|
|
options.hpp
|
|
|
|
profile.hpp
|
2012-01-28 01:36:17 +01:00
|
|
|
)
|
2018-07-05 22:55:19 +02:00
|
|
|
|
2024-06-30 15:52:46 +02:00
|
|
|
source_group(apps/openmw FILES main.cpp android_main.cpp ${OPENMW_SOURCES} ${OPENMW_HEADERS} ${OPENMW_RESOURCES})
|
2010-07-08 22:53:14 +02:00
|
|
|
|
2011-10-22 13:55:06 +02:00
|
|
|
add_openmw_dir (mwrender
|
2023-08-02 00:55:16 +02:00
|
|
|
actors objects renderingmanager animation rotatecontroller sky skyutil npcanimation esm4npcanimation vismask
|
2021-01-08 19:33:51 +04:00
|
|
|
creatureanimation effectmanager util renderinginterface pathgrid rendermode weaponanimation screenshotmanager
|
2022-04-15 19:14:18 +02:00
|
|
|
bulletdebugdraw globalmap characterpreview camera localmap water terrainstorage ripplesimulation
|
2022-05-13 18:58:00 -07:00
|
|
|
renderbin actoranimation landmanager navmesh actorspaths recastmesh fogmanager objectpaging groundcover
|
2023-10-01 10:36:18 +02:00
|
|
|
postprocessor pingpongcull luminancecalculator pingpongcanvas transparentpass precipitationocclusion ripples
|
2024-04-27 23:31:28 +01:00
|
|
|
actorutil distortion animationpriority bonegroup blendmask animblendcontroller
|
2011-01-08 15:11:37 +01:00
|
|
|
)
|
2010-07-08 22:53:14 +02:00
|
|
|
|
2015-05-03 17:24:35 +02:00
|
|
|
add_openmw_dir (mwinput
|
2020-04-17 15:21:23 +04:00
|
|
|
actions actionmanager bindingsmanager controllermanager controlswitch
|
2022-01-20 15:42:01 +01:00
|
|
|
inputmanagerimp mousemanager keyboardmanager sensormanager gyromanager
|
2015-05-03 17:24:35 +02:00
|
|
|
)
|
2010-07-08 22:53:14 +02:00
|
|
|
|
2011-10-29 13:17:04 +02:00
|
|
|
add_openmw_dir (mwgui
|
2015-05-01 02:09:57 +02:00
|
|
|
layout textinput widgets race class birth review windowmanagerimp console dialogue
|
2013-05-06 15:30:23 +02:00
|
|
|
windowbase statswindow messagebox journalwindow charactercreation
|
2019-04-01 21:47:12 +04:00
|
|
|
mapwindow windowpinnablebase tooltips scrollwindow bookwindow resourceskin
|
2012-05-24 15:57:23 +02:00
|
|
|
formatting inventorywindow container hud countdialog tradewindow settingswindow
|
2012-08-26 10:52:06 +02:00
|
|
|
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
|
2012-09-23 00:36:20 +02:00
|
|
|
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog
|
2014-09-12 05:14:21 +02:00
|
|
|
enchantingdialog trainingwindow travelwindow exposedwindow cursor spellicons
|
2013-01-27 12:07:28 -08:00
|
|
|
merchantrepair repair soulgemdialog companionwindow bookpage journalviewmodel journalbooks
|
2014-10-18 19:51:07 +02:00
|
|
|
itemmodel containeritemmodel inventoryitemmodel sortfilteritemmodel itemview
|
2014-09-12 04:27:23 +02:00
|
|
|
tradeitemmodel companionitemmodel pickpocketitemmodel controllers savegamedialog
|
2014-12-15 13:13:25 +01:00
|
|
|
recharge mode videowidget backgroundimage itemwidget screenfader debugwindow spellmodel spellview
|
2020-06-05 18:22:53 +04:00
|
|
|
draganddrop timeadvancer jailscreen itemchargeview keyboardnavigation textcolours statswatcher
|
2023-04-12 00:33:36 +02:00
|
|
|
postprocessorhud settings
|
2010-07-08 22:53:14 +02:00
|
|
|
)
|
|
|
|
|
2011-10-29 13:17:04 +02:00
|
|
|
add_openmw_dir (mwdialogue
|
2014-12-13 02:47:04 +01:00
|
|
|
dialoguemanagerimp journalimp journalentry quest topic filter selectwrapper hypertextparser keywordsearch scripttest
|
2010-08-03 13:17:31 +02:00
|
|
|
)
|
2011-10-29 13:17:04 +02:00
|
|
|
|
|
|
|
add_openmw_dir (mwscript
|
2012-08-08 15:18:55 +02:00
|
|
|
locals scriptmanagerimp compilercontext interpretercontext cellextensions miscextensions
|
2011-10-29 13:17:04 +02:00
|
|
|
guiextensions soundextensions skyextensions statsextensions containerextensions
|
|
|
|
aiextensions controlextensions extensions globalscripts ref dialogueextensions
|
2014-03-16 21:39:46 +01:00
|
|
|
animationextensions transformationextensions consoleextensions userextensions
|
2010-08-03 13:17:31 +02:00
|
|
|
)
|
|
|
|
|
2020-12-18 23:21:10 +01:00
|
|
|
add_openmw_dir (mwlua
|
2023-08-06 16:21:43 +02:00
|
|
|
luamanagerimp object objectlists userdataserializer luaevents engineevents objectvariant
|
2023-09-05 22:45:38 +02:00
|
|
|
context menuscripts globalscripts localscripts playerscripts luabindings objectbindings cellbindings
|
2024-04-15 22:01:41 +02:00
|
|
|
mwscriptbindings camerabindings vfsbindings uibindings soundbindings inputbindings nearbybindings dialoguebindings
|
2024-03-25 13:46:23 +00:00
|
|
|
postprocessingbindings stats recordstore debugbindings corebindings worldbindings worker magicbindings factionbindings
|
2024-03-05 10:07:35 +04:00
|
|
|
classbindings itemdata inputprocessor animationbindings birthsignbindings racebindings markupbindings
|
2023-09-05 22:45:38 +02:00
|
|
|
types/types types/door types/item types/actor types/container types/lockable types/weapon types/npc
|
|
|
|
types/creature types/player types/activator types/book types/lockpick types/probe types/apparatus
|
|
|
|
types/potion types/ingredient types/misc types/repair types/armor types/light types/static
|
|
|
|
types/clothing types/levelledlist types/terminal
|
2020-12-18 23:21:10 +01:00
|
|
|
)
|
|
|
|
|
2011-10-29 13:17:04 +02:00
|
|
|
add_openmw_dir (mwsound
|
2017-09-11 22:17:36 -07:00
|
|
|
soundmanagerimp openal_output ffmpeg_decoder sound sound_buffer sound_decoder sound_output
|
2023-10-12 20:25:55 +02:00
|
|
|
loudness movieaudiofactory alext efx efx-presets regionsoundselector watersoundupdater
|
2010-09-30 15:42:28 +02:00
|
|
|
)
|
2011-10-29 13:17:04 +02:00
|
|
|
|
|
|
|
add_openmw_dir (mwworld
|
2015-04-01 17:02:15 +02:00
|
|
|
refdata worldimp scene globals class action nullaction actionteleport
|
2015-12-06 18:13:04 +01:00
|
|
|
containerstore actiontalk actiontake manualref player cellvisitors failedaction
|
2022-12-06 00:11:19 +01:00
|
|
|
worldmodel localscripts customdata inventorystore ptr actionopen actionread actionharvest
|
2012-09-13 13:02:26 +02:00
|
|
|
actionequip timestamp actionalchemy cellstore actionapply actioneat
|
2021-11-04 15:56:51 +00:00
|
|
|
store esmstore fallback actionrepair actionsoulgem livecellref actiondoor
|
2019-02-13 11:30:16 +04:00
|
|
|
contentloader esmloader actiontrap cellreflist cellref weather projectilemanager
|
2023-05-28 11:56:02 +02:00
|
|
|
cellpreloader datetimemanager groundcoverstore magiceffects cell ptrregistry
|
2023-10-29 13:05:15 +01:00
|
|
|
positioncellgrid
|
2010-07-26 12:52:32 +02:00
|
|
|
)
|
2010-07-08 22:53:14 +02:00
|
|
|
|
2015-05-10 01:09:00 +02:00
|
|
|
add_openmw_dir (mwphysics
|
2020-03-30 21:39:10 +03:00
|
|
|
physicssystem trace collisiontype actor convert object heightfield closestnotmerayresultcallback
|
2024-02-02 22:16:49 +01:00
|
|
|
contacttestresultcallback stepper movementsolver projectile
|
2021-01-07 11:02:53 +01:00
|
|
|
actorconvexcallback raycasting mtphysics contacttestwrapper projectileconvexcallback
|
2015-05-10 01:09:00 +02:00
|
|
|
)
|
|
|
|
|
2011-10-29 13:17:04 +02:00
|
|
|
add_openmw_dir (mwclass
|
|
|
|
classes activator creature npc weapon armor potion apparatus book clothing container door
|
2016-01-02 00:49:53 +01:00
|
|
|
ingredient creaturelevlist itemlevlist light lockpick misc probe repair static actor bodypart
|
2023-08-02 00:55:16 +02:00
|
|
|
esm4base esm4npc light4
|
2010-07-26 11:15:38 +02:00
|
|
|
)
|
2011-10-29 13:17:04 +02:00
|
|
|
|
|
|
|
add_openmw_dir (mwmechanics
|
2020-07-28 08:33:28 +02:00
|
|
|
mechanicsmanagerimp stat creaturestats magiceffects movement actorutil spelllist
|
2017-07-25 09:51:55 +04:00
|
|
|
drawstate spells activespells npcstats aipackage aisequence aipursue alchemy aiwander aitravel aifollow aiavoiddoor aibreathe
|
2020-04-04 18:28:53 +03:00
|
|
|
aicast aiescort aiface aiactivate aicombat recharge repair enchanting pathfinding pathgrid security spellcasting spellresistance
|
2022-05-18 19:58:53 +02:00
|
|
|
disease pickpocket levelledlist combat steering obstacle autocalcspell difficultyscaling aicombataction summoning
|
2024-03-29 21:50:45 +01:00
|
|
|
character actors objects aistate weaponpriority spellpriority weapontype spellutil
|
2021-10-10 16:28:45 +02:00
|
|
|
spelleffects
|
2010-07-26 11:15:38 +02:00
|
|
|
)
|
2010-07-08 22:53:14 +02:00
|
|
|
|
2013-11-16 10:31:46 +01:00
|
|
|
add_openmw_dir (mwstate
|
2018-01-12 20:02:43 -05:00
|
|
|
statemanagerimp charactermanager character quicksavemanager
|
2010-07-26 11:15:38 +02:00
|
|
|
)
|
2010-07-08 22:53:14 +02:00
|
|
|
|
2012-04-23 10:57:16 +02:00
|
|
|
add_openmw_dir (mwbase
|
2012-08-11 17:30:55 +02:00
|
|
|
environment world scriptmanager dialoguemanager journal soundmanager mechanicsmanager
|
2024-01-26 21:39:33 +00:00
|
|
|
inputmanager windowmanager statemanager luamanager
|
2012-04-23 10:57:16 +02:00
|
|
|
)
|
|
|
|
|
2010-07-08 22:53:14 +02:00
|
|
|
# Main executable
|
2013-02-03 13:47:55 +01:00
|
|
|
|
2024-06-30 15:52:46 +02:00
|
|
|
add_library(openmw-lib STATIC
|
|
|
|
${OPENMW_FILES}
|
|
|
|
${OPENMW_SOURCES}
|
|
|
|
)
|
2011-11-06 09:30:15 +01:00
|
|
|
|
2024-06-09 13:51:15 +02:00
|
|
|
if(BUILD_OPENMW)
|
|
|
|
if (ANDROID)
|
2024-06-30 15:52:46 +02:00
|
|
|
add_library(openmw SHARED
|
|
|
|
main.cpp
|
|
|
|
android_main.cpp
|
2024-06-09 13:51:15 +02:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
openmw_add_executable(openmw
|
|
|
|
${APPLE_BUNDLE_RESOURCES}
|
|
|
|
${OPENMW_RESOURCES}
|
|
|
|
main.cpp
|
|
|
|
)
|
|
|
|
endif()
|
2024-06-30 15:52:46 +02:00
|
|
|
|
|
|
|
target_link_libraries(openmw openmw-lib)
|
2024-06-09 13:51:15 +02:00
|
|
|
endif()
|
|
|
|
|
2010-08-13 22:30:22 +02:00
|
|
|
# Sound stuff - here so CMake doesn't stupidly recompile EVERYTHING
|
|
|
|
# when we change the backend.
|
2015-11-14 16:02:42 +01:00
|
|
|
include_directories(
|
2016-05-09 17:24:17 +03:00
|
|
|
${FFmpeg_INCLUDE_DIRS}
|
2015-11-14 16:02:42 +01:00
|
|
|
)
|
2010-08-13 22:30:22 +02:00
|
|
|
|
2023-03-11 13:16:27 +01:00
|
|
|
target_link_libraries(openmw-lib
|
2021-03-06 19:21:23 +00:00
|
|
|
# CMake's built-in OSG finder does not use pkgconfig, so we have to
|
|
|
|
# manually ensure the order is correct for inter-library dependencies.
|
|
|
|
# This only makes a difference with `-DOPENMW_USE_SYSTEM_OSG=ON -DOSG_STATIC=ON`.
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/-/issues/21701
|
2015-11-29 19:56:43 +01:00
|
|
|
${OSGPARTICLE_LIBRARIES}
|
|
|
|
${OSGVIEWER_LIBRARIES}
|
|
|
|
${OSGGA_LIBRARIES}
|
2017-04-14 15:32:18 +02:00
|
|
|
${OSGSHADOW_LIBRARIES}
|
2021-03-06 19:21:23 +00:00
|
|
|
${OSGDB_LIBRARIES}
|
|
|
|
${OSGUTIL_LIBRARIES}
|
|
|
|
${OSG_LIBRARIES}
|
2024-08-06 23:37:54 +01:00
|
|
|
Boost::program_options
|
2012-01-28 01:36:17 +01:00
|
|
|
${OPENAL_LIBRARY}
|
2016-05-09 17:24:17 +03:00
|
|
|
${FFmpeg_LIBRARIES}
|
2016-06-12 23:34:53 +03:00
|
|
|
${MyGUI_LIBRARIES}
|
2023-11-24 14:26:53 +01:00
|
|
|
SDL2::SDL2
|
2018-03-13 21:58:52 +03:00
|
|
|
${RecastNavigation_LIBRARIES}
|
2015-04-19 20:14:06 +02:00
|
|
|
"osg-ffmpeg-videoplayer"
|
2012-08-12 20:45:02 +02:00
|
|
|
"oics"
|
2012-07-19 16:23:30 +02:00
|
|
|
components
|
2010-07-08 22:53:14 +02:00
|
|
|
)
|
|
|
|
|
2024-03-08 01:22:42 +01:00
|
|
|
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
|
2023-03-11 13:16:27 +01:00
|
|
|
target_precompile_headers(openmw-lib PRIVATE
|
2022-07-01 14:05:17 +00:00
|
|
|
<boost/program_options/options_description.hpp>
|
|
|
|
|
|
|
|
<sol/sol.hpp>
|
|
|
|
|
|
|
|
<osg/StateSet>
|
|
|
|
<osg/Node>
|
|
|
|
<osg/Drawable>
|
|
|
|
<osg/Camera>
|
|
|
|
|
|
|
|
<osgViewer/Viewer>
|
|
|
|
|
|
|
|
<MyGUI_Widget.h>
|
|
|
|
|
|
|
|
<algorithm>
|
|
|
|
<filesystem>
|
|
|
|
<fstream>
|
|
|
|
<functional>
|
|
|
|
<memory>
|
|
|
|
<string>
|
|
|
|
<string_view>
|
|
|
|
<vector>
|
|
|
|
)
|
|
|
|
endif()
|
2021-12-04 11:32:39 +00:00
|
|
|
|
2023-10-22 11:25:39 +02:00
|
|
|
add_definitions(-DMYGUI_DONT_USE_OBSOLETE=ON)
|
|
|
|
|
2021-01-20 02:25:46 +00:00
|
|
|
if (ANDROID)
|
2023-03-11 13:16:27 +01:00
|
|
|
target_link_libraries(openmw-lib EGL android log z)
|
2014-08-04 19:49:54 +04:00
|
|
|
endif (ANDROID)
|
|
|
|
|
2013-09-14 13:33:49 +02:00
|
|
|
if (USE_SYSTEM_TINYXML)
|
2023-03-11 13:16:27 +01:00
|
|
|
target_link_libraries(openmw-lib ${TinyXML_LIBRARIES})
|
2013-09-14 13:33:49 +02:00
|
|
|
endif()
|
|
|
|
|
2013-06-27 21:45:32 +02:00
|
|
|
if (NOT UNIX)
|
2023-03-11 13:16:27 +01:00
|
|
|
target_link_libraries(openmw-lib ${SDL2MAIN_LIBRARY})
|
2013-06-27 21:45:32 +02:00
|
|
|
endif()
|
|
|
|
|
2012-03-21 12:20:19 +01:00
|
|
|
# Fix for not visible pthreads functions for linker with glibc 2.15
|
2012-03-19 20:54:30 +01:00
|
|
|
if (UNIX AND NOT APPLE)
|
2023-03-11 13:16:27 +01:00
|
|
|
target_link_libraries(openmw-lib ${CMAKE_THREAD_LIBS_INIT})
|
2012-03-19 20:54:30 +01:00
|
|
|
endif()
|
|
|
|
|
2024-06-09 13:51:15 +02:00
|
|
|
if(APPLE AND BUILD_OPENMW)
|
2016-10-28 15:39:27 +02:00
|
|
|
set(BUNDLE_RESOURCES_DIR "${APP_BUNDLE_DIR}/Contents/Resources")
|
|
|
|
|
2021-12-08 14:33:49 +01:00
|
|
|
set(OPENMW_RESOURCES_ROOT ${BUNDLE_RESOURCES_DIR})
|
2016-10-28 15:39:27 +02:00
|
|
|
|
|
|
|
add_subdirectory(../../files/ ${CMAKE_CURRENT_BINARY_DIR}/files)
|
|
|
|
|
2021-05-09 21:00:49 +01:00
|
|
|
configure_file("${OpenMW_BINARY_DIR}/defaults.bin" ${BUNDLE_RESOURCES_DIR} COPYONLY)
|
2016-10-28 15:39:27 +02:00
|
|
|
configure_file("${OpenMW_BINARY_DIR}/openmw.cfg" ${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")
|
|
|
|
|
2012-08-20 21:05:02 +04:00
|
|
|
find_library(COCOA_FRAMEWORK Cocoa)
|
|
|
|
find_library(IOKIT_FRAMEWORK IOKit)
|
2016-11-05 12:11:04 +01:00
|
|
|
target_link_libraries(openmw ${COCOA_FRAMEWORK} ${IOKIT_FRAMEWORK})
|
2013-02-07 23:40:20 +04:00
|
|
|
|
2016-05-09 17:24:17 +03:00
|
|
|
if (FFmpeg_FOUND)
|
2022-08-18 00:22:46 +10:00
|
|
|
target_link_options(openmw PRIVATE "LINKER:SHELL:-framework CoreVideo"
|
|
|
|
"LINKER:SHELL:-framework CoreMedia"
|
|
|
|
"LINKER:SHELL:-framework VideoToolbox"
|
|
|
|
"LINKER:SHELL:-framework AudioToolbox"
|
|
|
|
"LINKER:SHELL:-framework VideoDecodeAcceleration")
|
2013-02-07 23:40:20 +04:00
|
|
|
endif()
|
2024-06-12 12:51:03 +03:00
|
|
|
endif()
|
2011-01-04 20:42:09 +01:00
|
|
|
|
2012-08-19 22:23:46 +03:00
|
|
|
if (BUILD_WITH_CODE_COVERAGE)
|
2023-03-11 13:16:27 +01:00
|
|
|
target_compile_options(openmw-lib PRIVATE --coverage)
|
|
|
|
target_link_libraries(openmw-lib gcov)
|
2024-06-09 13:51:15 +02:00
|
|
|
if (NOT ANDROID AND BUILD_OPENMW)
|
2023-03-11 13:16:27 +01:00
|
|
|
target_compile_options(openmw PRIVATE --coverage)
|
|
|
|
target_link_libraries(openmw gcov)
|
|
|
|
endif()
|
2012-08-19 22:23:46 +03:00
|
|
|
endif()
|
2014-03-05 22:11:10 +11:00
|
|
|
|
2024-06-09 13:51:15 +02:00
|
|
|
if (WIN32 AND BUILD_OPENMW)
|
2016-11-13 22:49:01 -06:00
|
|
|
INSTALL(TARGETS openmw RUNTIME DESTINATION ".")
|
2024-06-12 12:51:03 +03:00
|
|
|
endif()
|